src/solaris/classes/sun/print/AttributeClass.java

Print this page

        

*** 22,31 **** --- 22,32 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ package sun.print; + import java.util.Objects; import java.io.ByteArrayInputStream; public class AttributeClass { private String myName; private int myType;
*** 246,260 **** */ public String getName() { return myName; } public boolean equals(Object obj) { ! return ! obj != null && ! obj instanceof AttributeClass && ! obj.toString().equals (((AttributeClass) obj).toString()); } public String toString() { return myName; } --- 247,274 ---- */ public String getName() { return myName; } + @Override public boolean equals(Object obj) { ! if (!(obj instanceof AttributeClass)) { ! return false; ! } ! if (this == obj) { ! return true; ! } ! ! AttributeClass acObj = (AttributeClass) obj; ! return myType == acObj.getType() && ! Objects.equals(myName, acObj.getName()) && ! Objects.equals(myValue, acObj.getObjectValue()); ! } ! ! @Override ! public int hashCode() { ! return Objects.hash(myType, myName, myValue); } public String toString() { return myName; }