You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by cz...@apache.org on 2003/07/14 19:16:27 UTC

cvs commit: avalon-excalibur/store/src/java/org/apache/excalibur/store/impl JispKey.java

cziegeler    2003/07/14 10:16:27

  Modified:    store    default.properties
               store/src/java/org/apache/excalibur/store/impl JispKey.java
  Removed:     store/lib jisp.LICENSE.txt jisp-2.5.1.jar
  Log:
  Fixing (hopefully) build of store
  
  Revision  Changes    Path
  1.9       +2 -2      avalon-excalibur/store/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/store/default.properties,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- default.properties	4 Jun 2003 13:15:15 -0000	1.8
  +++ default.properties	14 Jul 2003 17:16:27 -0000	1.9
  @@ -20,8 +20,8 @@
   avalon-framework.lib=${avalon-framework.home}/target/lib
   avalon-framework.jar=${avalon-framework.lib}/avalon-framework.jar
   
  -# ----- Jisp 2.0.1 -----
  -jisp.jar=lib/jisp-2.0.1.jar
  +# ----- Jisp 2.5.1 -----
  +jisp.jar=${basedir}/../lib/jisp.2.5.1.jar
   
   # --------------------------------------------------
   
  
  
  
  1.2       +13 -21    avalon-excalibur/store/src/java/org/apache/excalibur/store/impl/JispKey.java
  
  Index: JispKey.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/store/src/java/org/apache/excalibur/store/impl/JispKey.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JispKey.java	14 Jul 2003 13:58:19 -0000	1.1
  +++ JispKey.java	14 Jul 2003 17:16:27 -0000	1.2
  @@ -67,23 +67,12 @@
    */
   public final class JispKey extends KeyObject 
   {
  -// TODO
  -    //final static long serialVersionUID = -6894793231339165076L;
  +    final static long serialVersionUID = 798806649359364728L;
   
       protected Object m_Key;
   
  -    protected int    m_KeyHashCode;
  +    static protected JispKey NULL_KEY = new JispKey("");
       
  -    static protected final String INIT = new String("");
  -    static protected final int    INIT_HASH_CODE = INIT.hashCode();
  -    /**
  -     *  Constructor for the JispStringKey object
  -     */
  -    public JispKey() {
  -        m_Key = INIT;
  -        m_KeyHashCode = INIT_HASH_CODE;
  -    }
  -
       /**
        *  Constructor for the JispStringKey object
        *
  @@ -92,7 +81,6 @@
       public JispKey(Object keyValue) 
       {
           m_Key = keyValue;
  -        m_KeyHashCode = m_Key.hashCode();
       }
   
       /**
  @@ -107,14 +95,19 @@
           if (key instanceof JispKey) 
           {
               final JispKey other = (JispKey)key;
  -            if ( other.m_KeyHashCode == m_KeyHashCode ) 
  +            if ( other.m_Key.hashCode() == m_Key.hashCode() ) 
               {
  -                if ( m_Key.equals(other.m_Key) ) 
  +                if ( m_Key == other.m_Key || m_Key.equals(other.m_Key) ) 
                   {
                       return KEY_EQUAL;
                   }
                   // we have the same hashcode, but different keys
  -                if ( m_Key.hashCode() < other.m_Key.hashCode() ) 
  +                // this is usually an error condition, but we deal
  +                // with it anway
  +                // if they would have the same classname, they
  +                // can only have the same hashCode if they are equal:
  +                int comp = m_Key.getClass().getName().compareTo(other.m_Key.getClass().getName());
  +                if ( comp < 0 ) 
                   {
                       return KEY_LESS;
                   }
  @@ -122,7 +115,7 @@
               } 
               else 
               {
  -                if ( m_KeyHashCode < other.m_KeyHashCode ) 
  +                if ( m_Key.hashCode() < other.m_Key.hashCode() ) 
                   {
                       return KEY_LESS;
                   }
  @@ -142,7 +135,7 @@
        */
       public KeyObject makeNullKey() 
       {
  -        return new JispKey();
  +        return NULL_KEY;
       }
   
       /**
  @@ -170,7 +163,6 @@
        * @exception IOException
        * @exception ClassNotFoundException
        */
  -
       public void readExternal(ObjectInput in)
       throws IOException, ClassNotFoundException 
       {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org