From 7208d75742be63a50ccdc14df67fc05640e5a75c Mon Sep 17 00:00:00 2001 From: Ivan Furnadjiev Date: Mon, 5 Sep 2016 16:00:11 +0300 Subject: [PATCH] Fix FindBugs warning in PageDescriptor Use Arrays#equals and Arrays#hashCode for image byte array in PageDescriptor#equals and PageDescriptor#hashCode. Change-Id: I94150d4ec35641d9f392000d040903eccc6f90fc --- .../eclipsesource/tabris/internal/ui/PageDescriptor.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/com.eclipsesource.tabris/src/com/eclipsesource/tabris/internal/ui/PageDescriptor.java b/com.eclipsesource.tabris/src/com/eclipsesource/tabris/internal/ui/PageDescriptor.java index cdd1cb7..1fef414 100644 --- a/com.eclipsesource.tabris/src/com/eclipsesource/tabris/internal/ui/PageDescriptor.java +++ b/com.eclipsesource.tabris/src/com/eclipsesource/tabris/internal/ui/PageDescriptor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013 EclipseSource and others. + * Copyright (c) 2013, 2016 EclipseSource and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -99,7 +99,7 @@ public int hashCode() { int result = 1; result = prime * result + ( ( actions == null ) ? 0 : actions.hashCode() ); result = prime * result + ( ( id == null ) ? 0 : id.hashCode() ); - result = prime * result + ( ( image == null ) ? 0 : image.hashCode() ); + result = prime * result + Arrays.hashCode( image ); result = prime * result + ( topLevel ? 1231 : 1237 ); result = prime * result + ( ( pageType == null ) ? 0 : pageType.hashCode() ); result = prime * result + Arrays.hashCode( style ); @@ -126,10 +126,7 @@ public boolean equals( Object obj ) { return false; } else if( !id.equals( other.id ) ) return false; - if( image == null ) { - if( other.image != null ) - return false; - } else if( !image.equals( other.image ) ) + if( !Arrays.equals( image, other.image ) ) return false; if( topLevel != other.topLevel ) return false;