提交 ccc6be9a 编写于 作者: D dxu

8017109: Cleanup overrides warning in src/solaris/classes/sun/print/AttributeClass.java

Reviewed-by: jgodinez
上级 024583ab
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
*/ */
package sun.print; package sun.print;
import java.util.Objects;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
public class AttributeClass { public class AttributeClass {
...@@ -248,11 +249,24 @@ public class AttributeClass { ...@@ -248,11 +249,24 @@ public class AttributeClass {
return myName; return myName;
} }
@Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return if (!(obj instanceof AttributeClass)) {
obj != null && return false;
obj instanceof AttributeClass && }
obj.toString().equals (((AttributeClass) obj).toString()); 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() { public String toString() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册