klute       2003/11/07 11:24:29

  Modified:    src/java/org/apache/poi/hpsf ClassID.java
  Log:
  
  
  Revision  Changes    Path
  1.11      +23 -19    jakarta-poi/src/java/org/apache/poi/hpsf/ClassID.java
  
  Index: ClassID.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hpsf/ClassID.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ClassID.java      31 Oct 2003 16:39:05 -0000      1.10
  +++ ClassID.java      7 Nov 2003 19:24:29 -0000       1.11
  @@ -233,32 +233,36 @@
           return true;
       }
   
  +
  +
       /**
  -     * Returns a human readable representation of the Class ID
  -     *   in standard format <code>"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"</code>
  -     * @return String representation of the Class ID represented
  -     *   by this object.
  +     * @see Object#hashCode()
        */
  -    public String toString()
  +    public int hashCode()
       {
  -        StringBuffer sbClassId = new StringBuffer( 38);
  -        sbClassId.append( '{');
  -        for( int i=0; i < 16; i++) {
  -            sbClassId.append( HexDump.toHex( bytes[ i]));
  -            if( i == 3 || i == 5 || i == 7 || i == 9) {
  -                sbClassId.append( '-');
  -            }
  -        }
  -        sbClassId.append( '}');
  -        return sbClassId.toString();
  +        return new String(bytes).hashCode();
       }
   
  +
  +
       /**
  -     * @see Object#hashCode()
  +     * <p>Returns a human-readable representation of the Class ID in standard 
  +     * format <code>"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"</code>.</p>
  +     * 
  +     * @return String representation of the Class ID represented by this object.
        */
  -    public int hashCode()
  +    public String toString()
       {
  -        return new String(bytes).hashCode();
  +        StringBuffer sbClassId = new StringBuffer(38);
  +        sbClassId.append('{');
  +        for (int i = 0; i < 16; i++)
  +        {
  +            sbClassId.append(HexDump.toHex(bytes[i]));
  +            if (i == 3 || i == 5 || i == 7 || i == 9)
  +                sbClassId.append('-');
  +        }
  +        sbClassId.append('}');
  +        return sbClassId.toString();
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to