X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Febi%2Fpicr%2Fmodel%2FCrossReference.java;h=498a47b6983311ac5cdde9991b4192bfc5900642;hb=be32c14cd8e48fe0a207cd7030cb9cd46f894678;hp=aef2ca975e05746700211b11ac91cc9815227362;hpb=10e637daad8983c41db8679baabea5563d7371f4;p=jalview.git diff --git a/src/uk/ac/ebi/picr/model/CrossReference.java b/src/uk/ac/ebi/picr/model/CrossReference.java index aef2ca9..498a47b 100644 --- a/src/uk/ac/ebi/picr/model/CrossReference.java +++ b/src/uk/ac/ebi/picr/model/CrossReference.java @@ -244,15 +244,22 @@ public class CrossReference implements java.io.Serializable private java.lang.Object __equalsCalc = null; + @Override public synchronized boolean equals(java.lang.Object obj) { + if (obj == null) + { + return false; + } if (!(obj instanceof CrossReference)) + { return false; + } CrossReference other = (CrossReference) obj; - if (obj == null) - return false; if (this == obj) + { return true; + } if (__equalsCalc != null) { return (__equalsCalc == obj); @@ -285,6 +292,11 @@ public class CrossReference implements java.io.Serializable private boolean __hashCodeCalc = false; + /** + * hashCode designed to ensure that if two instances satisfy o1.equals(o2) + * then they have the same hashcode. + */ + @Override public synchronized int hashCode() { if (__hashCodeCalc)