db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r159633 - in incubator/jdo/trunk/api20/src/java/javax/jdo/identity: ByteIdentity.java CharIdentity.java IntIdentity.java LongIdentity.java ShortIdentity.java SingleFieldIdentity.java
Date Thu, 31 Mar 2005 19:58:24 GMT
Author: clr
Date: Thu Mar 31 11:58:22 2005
New Revision: 159633

URL: http://svn.apache.org/viewcvs?view=rev&rev=159633
Log:
removed target class name from toString

Modified:
    incubator/jdo/trunk/api20/src/java/javax/jdo/identity/ByteIdentity.java
    incubator/jdo/trunk/api20/src/java/javax/jdo/identity/CharIdentity.java
    incubator/jdo/trunk/api20/src/java/javax/jdo/identity/IntIdentity.java
    incubator/jdo/trunk/api20/src/java/javax/jdo/identity/LongIdentity.java
    incubator/jdo/trunk/api20/src/java/javax/jdo/identity/ShortIdentity.java
    incubator/jdo/trunk/api20/src/java/javax/jdo/identity/SingleFieldIdentity.java

Modified: incubator/jdo/trunk/api20/src/java/javax/jdo/identity/ByteIdentity.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/api20/src/java/javax/jdo/identity/ByteIdentity.java?view=diff&r1=159632&r2=159633
==============================================================================
--- incubator/jdo/trunk/api20/src/java/javax/jdo/identity/ByteIdentity.java (original)
+++ incubator/jdo/trunk/api20/src/java/javax/jdo/identity/ByteIdentity.java Thu Mar 31 11:58:22
2005
@@ -58,7 +58,7 @@
      * @param str the key
      */
     public ByteIdentity(Class pcClass, String str) {
-        this (pcClass, Byte.parseByte(justTheId(str)));
+        this (pcClass, Byte.parseByte(str));
     }
 
     /** Constructor only for Externalizable.
@@ -77,7 +77,7 @@
      * @return the key.
      */
     public String toString() {
-        return getTargetClassName() + SEPARATOR_CHARACTER + Byte.toString(key);
+        return Byte.toString(key);
     }
 
     /** Determine if the other object represents the same object id.

Modified: incubator/jdo/trunk/api20/src/java/javax/jdo/identity/CharIdentity.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/api20/src/java/javax/jdo/identity/CharIdentity.java?view=diff&r1=159632&r2=159633
==============================================================================
--- incubator/jdo/trunk/api20/src/java/javax/jdo/identity/CharIdentity.java (original)
+++ incubator/jdo/trunk/api20/src/java/javax/jdo/identity/CharIdentity.java Thu Mar 31 11:58:22
2005
@@ -66,10 +66,10 @@
      */
     public CharIdentity (Class pcClass, String str) {
         super(pcClass);
-        String justTheId = justTheId(str);
-        if (justTheId.length() != 1) 
-            throw new IllegalArgumentException(msg.msg("EXC_StringWrongLength"));
-        this.key = justTheId.charAt(0);
+        if (str.length() != 1) 
+            throw new IllegalArgumentException(
+                    msg.msg("EXC_StringWrongLength"));
+        this.key = str.charAt(0);
         computeHashCode();
     }
 
@@ -89,7 +89,7 @@
      * @return the String form of the key
      */
     public String toString () {
-        return getTargetClassName() + SEPARATOR_CHARACTER + key;
+        return Character.toString(key);
     }
 
     /** Determine if the other object represents the same object id.

Modified: incubator/jdo/trunk/api20/src/java/javax/jdo/identity/IntIdentity.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/api20/src/java/javax/jdo/identity/IntIdentity.java?view=diff&r1=159632&r2=159633
==============================================================================
--- incubator/jdo/trunk/api20/src/java/javax/jdo/identity/IntIdentity.java (original)
+++ incubator/jdo/trunk/api20/src/java/javax/jdo/identity/IntIdentity.java Thu Mar 31 11:58:22
2005
@@ -56,7 +56,7 @@
      * @param str the key
      */
     public IntIdentity (Class pcClass, String str) {
-        this (pcClass, Integer.parseInt (justTheId(str)));
+        this (pcClass, Integer.parseInt(str));
     }
 
     /** Constructor only for Externalizable.
@@ -75,7 +75,7 @@
      * @return the String form of the key
      */
     public String toString () {
-        return getTargetClassName() + SEPARATOR_CHARACTER + key;
+        return Integer.toString(key);
     }
 
     /** Determine if the other object represents the same object id.

Modified: incubator/jdo/trunk/api20/src/java/javax/jdo/identity/LongIdentity.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/api20/src/java/javax/jdo/identity/LongIdentity.java?view=diff&r1=159632&r2=159633
==============================================================================
--- incubator/jdo/trunk/api20/src/java/javax/jdo/identity/LongIdentity.java (original)
+++ incubator/jdo/trunk/api20/src/java/javax/jdo/identity/LongIdentity.java Thu Mar 31 11:58:22
2005
@@ -58,7 +58,7 @@
      * @param str the key
      */
     public LongIdentity (Class pcClass, String str) {
-        this (pcClass, Long.parseLong (justTheId(str)));
+        this (pcClass, Long.parseLong(str));
     }
 
     /** Constructor only for Externalizable.
@@ -77,7 +77,7 @@
      * @return the String form of the key
      */
     public String toString () {
-        return getTargetClassName() + SEPARATOR_CHARACTER + key;
+        return Long.toString(key);
     }
 
     /** Determine if the other object represents the same object id.

Modified: incubator/jdo/trunk/api20/src/java/javax/jdo/identity/ShortIdentity.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/api20/src/java/javax/jdo/identity/ShortIdentity.java?view=diff&r1=159632&r2=159633
==============================================================================
--- incubator/jdo/trunk/api20/src/java/javax/jdo/identity/ShortIdentity.java (original)
+++ incubator/jdo/trunk/api20/src/java/javax/jdo/identity/ShortIdentity.java Thu Mar 31 11:58:22
2005
@@ -58,7 +58,7 @@
      * @param str the key
      */
     public ShortIdentity (Class pcClass, String str) {
-        this (pcClass, Short.parseShort (justTheId(str)));
+        this (pcClass, Short.parseShort (str));
     }
 
     /** Constructor only for Externalizable.
@@ -77,7 +77,7 @@
      * @return the String form of the key
      */
     public String toString () {
-        return getTargetClassName() + SEPARATOR_CHARACTER + key;
+        return Short.toString(key);
     }
 
     /** Determine if the other object represents the same object id.

Modified: incubator/jdo/trunk/api20/src/java/javax/jdo/identity/SingleFieldIdentity.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/api20/src/java/javax/jdo/identity/SingleFieldIdentity.java?view=diff&r1=159632&r2=159633
==============================================================================
--- incubator/jdo/trunk/api20/src/java/javax/jdo/identity/SingleFieldIdentity.java (original)
+++ incubator/jdo/trunk/api20/src/java/javax/jdo/identity/SingleFieldIdentity.java Thu Mar
31 11:58:22 2005
@@ -48,11 +48,6 @@
      */
     protected int hashCode;
 
-    /** The single character that separates the class name from the key value
-     * in String representations of SingleFieldIdentity and its subclasses.
-     */
-    public static final char SEPARATOR_CHARACTER = ':';
-    
     /** Constructor with target class.
      * @param pcClass the class of the target
      * @since 2.0
@@ -118,14 +113,6 @@
         return hashCode;
     }
     
-    /** Convert the toString representation of a single field identity
-     * to remove the class name. The format of the toString is
-     * <targetClass name:id>.
-     */
-    protected static String justTheId(String str) {
-        return str.substring(str.indexOf(':') + 1);
-    }
-
     /** Write to the output stream.
      * @param out the stream
      */



Mime
View raw message