--- old/src/java.desktop/share/classes/java/awt/image/BandedSampleModel.java 2016-04-25 14:51:34.115512111 +0530 +++ new/src/java.desktop/share/classes/java/awt/image/BandedSampleModel.java 2016-04-25 14:51:33.911410118 +0530 @@ -842,8 +842,38 @@ return bankIndices; } - // Differentiate hash code from other ComponentSampleModel subclasses + /** + * Tests if the specified {@code Object} is an instance + * of {@code BandedSampleModel} and equals this + * {@code BandedSampleModel}. + * @param obj the {@code Object} to test for equality + * @return {@code true} if the specified {@code Object} + * is an instance of {@code BandedSampleModel} and equals this + * {@code BandedSampleModel}; {@code false} otherwise. + */ + @Override + public boolean equals(Object obj) { + + BandedSampleModel cm = (BandedSampleModel) obj; + if (this == cm) { + return true; + } + + if (!super.equals(obj)) { + return false; + } + return true; + } + + /** + * Returns the hash code for this BandedSampleModel. + * + * @return a hash code for this BandedSampleModel. + */ + @Override public int hashCode() { - return super.hashCode() ^ 0x2; + int hash = 5; + hash = 13 * hash + super.hashCode(); + return hash; } }