directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r887979 - /directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObjectWrapper.java
Date Mon, 07 Dec 2009 16:23:26 GMT
Author: elecharny
Date: Mon Dec  7 16:23:25 2009
New Revision: 887979

URL: http://svn.apache.org/viewvc?rev=887979&view=rev
Log:
Modified the toString() method for clarity

Modified:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObjectWrapper.java

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObjectWrapper.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObjectWrapper.java?rev=887979&r1=887978&r2=887979&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObjectWrapper.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObjectWrapper.java
Mon Dec  7 16:23:25 2009
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.ldap.schema;
 
+
 /**
  * A class containing a SchemaObject, used by the global registries. As the hash code
  * method of the SchemaObjetc class is too complex, we had to define a simplest class
@@ -32,8 +33,8 @@
 {
     /** The internal schemaObject */
     private SchemaObject schemaObject;
-    
-    
+
+
     /**
      * Creates a new instance of SchemaObjectWrapper.
      *
@@ -43,7 +44,8 @@
     {
         this.schemaObject = schemaObject;
     }
-    
+
+
     /**
      * Compute the hash code for this wrapper. We only use the object type
      * and its oid.
@@ -51,13 +53,13 @@
     public int hashCode()
     {
         int h = 37;
-        h += h*17 + schemaObject.getObjectType().getValue();
-        h += h*17 + schemaObject.getOid().hashCode();
-        
+        h += h * 17 + schemaObject.getObjectType().getValue();
+        h += h * 17 + schemaObject.getOid().hashCode();
+
         return h;
     }
-    
-    
+
+
     /**
      * @see Object#equals(Object)
      */
@@ -67,20 +69,19 @@
         {
             return true;
         }
-        
-        if ( !(o instanceof SchemaObjectWrapper ) )
+
+        if ( !( o instanceof SchemaObjectWrapper ) )
         {
             return false;
         }
-        
-        SchemaObject that = ((SchemaObjectWrapper)o).get();
+
+        SchemaObject that = ( ( SchemaObjectWrapper ) o ).get();
         SchemaObject current = get();
-        
-        return ( that.getOid().equals( current.getOid() ) &&
-            ( that.getObjectType() == current.getObjectType() ) );
+
+        return ( that.getOid().equals( current.getOid() ) && ( that.getObjectType()
== current.getObjectType() ) );
     }
 
-    
+
     /**
      *  @return The interned SchemaObject
      */
@@ -88,13 +89,13 @@
     {
         return schemaObject;
     }
-    
-    
+
+
     /**
      * @see Object#toString()
      */
     public String toString()
     {
-        return schemaObject.toString();
+        return "<" + schemaObject.getObjectType() + "," + schemaObject.getOid() + ">";
     }
 }



Mime
View raw message