db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r724041 - /db/jdo/trunk/api2/src/java/javax/jdo/identity/ObjectIdentity.java
Date Sat, 06 Dec 2008 21:30:47 GMT
Author: clr
Date: Sat Dec  6 13:30:47 2008
New Revision: 724041

URL: http://svn.apache.org/viewvc?rev=724041&view=rev
Log:
Clean up some java 5 warnings

Modified:
    db/jdo/trunk/api2/src/java/javax/jdo/identity/ObjectIdentity.java

Modified: db/jdo/trunk/api2/src/java/javax/jdo/identity/ObjectIdentity.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/identity/ObjectIdentity.java?rev=724041&r1=724040&r2=724041&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/identity/ObjectIdentity.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/identity/ObjectIdentity.java Sat Dec  6 13:30:47
2008
@@ -60,6 +60,7 @@
      * @param pcClass the class
      * @param param the key
      */
+    @SuppressWarnings("static-access")
     public ObjectIdentity (Class pcClass, Object param) {
         super (pcClass);
         assertKeyNotNull(param);
@@ -112,6 +113,7 @@
      * of the key is used to construct the key itself.
      * @return the String form of the key
      */
+    @Override
     public String toString () {
         return keyAsObject.getClass().getName()
                 + STRING_DELIMITER
@@ -122,6 +124,7 @@
      * @param obj the other object
      * @return true if both objects represent the same object id
      */
+    @Override
     public boolean equals (Object obj) {
         if (this == obj) {
             return true;
@@ -133,6 +136,15 @@
         }
     }
 
+    /** Provide the hash code for this instance. The hash code is the
+     * hash code of the contained key.
+     * @return the hash code
+     */
+    @Override
+    public int hashCode() {
+        return keyAsObject.hashCode();
+    }
+
     /** Determine the ordering of identity objects.
      * @param o Other identity
      * @return The relative ordering between the objects
@@ -168,6 +180,7 @@
     /** Write this object. Write the superclass first.
      * @param out the output
      */
+    @Override
     public void writeExternal(ObjectOutput out) throws IOException {
         super.writeExternal (out);
         out.writeObject(keyAsObject);
@@ -176,6 +189,7 @@
     /** Read this object. Read the superclass first.
      * @param in the input
      */
+    @Override
     public void readExternal(ObjectInput in)
 		throws IOException, ClassNotFoundException {
         super.readExternal (in);



Mime
View raw message