geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject cvs commit: incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable MuCharacter.java MuDouble.java MuFloat.java MuInteger.java MuLong.java MuShort.java
Date Wed, 27 Aug 2003 09:08:11 GMT
jdillon     2003/08/27 02:08:11

  Modified:    modules/common/src/java/org/apache/geronimo/common/mutable
                        MuCharacter.java MuDouble.java MuFloat.java
                        MuInteger.java MuLong.java MuShort.java
  Log:
   o Applied patch GERONIMO-27 (compareTo Bug in mutable objects)
     by Sivasundaram Umapathy
  
  Revision  Changes    Path
  1.2       +4 -5      incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuCharacter.java
  
  Index: MuCharacter.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuCharacter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MuCharacter.java	24 Aug 2003 20:51:22 -0000	1.1
  +++ MuCharacter.java	27 Aug 2003 09:08:10 -0000	1.2
  @@ -141,7 +141,7 @@
       /**
        * Compares this object with the specified object for order.
        *
  -     * @param other   Value to compare with.
  +     * @param obj     Value to compare with.
        * @return        A negative integer, zero, or a positive integer as
        *                this object is less than, equal to, or greater than
        *                the specified object.
  @@ -149,7 +149,7 @@
        * @throws ClassCastException    Object is not a MuCharacter.
        */
       public int compareTo(Object obj) {
  -        return compareTo((MuCharacter)obj);
  +        return compareTo(((MuCharacter)obj).get());
       }
       
       /**
  @@ -221,5 +221,4 @@
       public Object getValue() {
           return new Character(value);
       }
  -}
  -
  +}
  \ No newline at end of file
  
  
  
  1.2       +6 -6      incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuDouble.java
  
  Index: MuDouble.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuDouble.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MuDouble.java	24 Aug 2003 20:51:22 -0000	1.1
  +++ MuDouble.java	27 Aug 2003 09:08:10 -0000	1.2
  @@ -192,7 +192,7 @@
        * @return     The new value.
        */
       public double negate() {
  -        value = ((double)-value);
  +        value = (-value);
           return value;
       }
       
  @@ -211,7 +211,7 @@
       /**
        * Compares this object with the specified object for order.
        *
  -     * @param other   Value to compare with.
  +     * @param obj     Value to compare with.
        * @return        A negative integer, zero, or a positive integer as
        *                this object is less than, equal to, or greater than
        *                the specified object.
  @@ -219,7 +219,7 @@
        * @throws ClassCastException    Object is not a MuDouble.
        */
       public int compareTo(Object obj) {
  -        return compareTo((MuDouble)obj);
  +        return compareTo(((MuDouble)obj).get());
       }
       
       /**
  @@ -312,7 +312,7 @@
        * @return   <code>double</code> value.
        */
       public double doubleValue() {
  -        return (double)value;
  +        return value;
       }
   
   
  @@ -344,4 +344,4 @@
       public Object getValue() {
           return new Double(value);
       }
  -}
  +}
  \ No newline at end of file
  
  
  
  1.2       +6 -6      incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuFloat.java
  
  Index: MuFloat.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuFloat.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MuFloat.java	24 Aug 2003 20:51:22 -0000	1.1
  +++ MuFloat.java	27 Aug 2003 09:08:10 -0000	1.2
  @@ -192,7 +192,7 @@
        * @return     The new value.
        */
       public float negate() {
  -        value = ((float)-value);
  +        value = (-value);
           return value;
       }
       
  @@ -211,7 +211,7 @@
       /**
        * Compares this object with the specified object for order.
        *
  -     * @param other   Value to compare with.
  +     * @param obj     Value to compare with.
        * @return        A negative integer, zero, or a positive integer as
        *                this object is less than, equal to, or greater than
        *                the specified object.
  @@ -219,7 +219,7 @@
        * @throws ClassCastException    Object is not a MuFloat.
        */
       public int compareTo(Object obj) {
  -        return compareTo((MuFloat)obj);
  +        return compareTo(((MuFloat)obj).get());
       }
       
       /**
  @@ -303,7 +303,7 @@
        * @return   <code>float</code> value.
        */
       public float floatValue() {
  -        return (float)value;
  +        return value;
       }
       
       /**
  @@ -352,4 +352,4 @@
       public Object getValue() {
           return new Float(value);
       }
  -}
  +}
  \ No newline at end of file
  
  
  
  1.2       +34 -12    incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuInteger.java
  
  Index: MuInteger.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuInteger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MuInteger.java	24 Aug 2003 20:51:22 -0000	1.1
  +++ MuInteger.java	27 Aug 2003 09:08:10 -0000	1.2
  @@ -91,7 +91,29 @@
       public MuInteger(Object obj) {
           setValue(obj);
       }
  -    
  +
  +    /**
  +     * Set the value.
  +     *
  +     * @param i    <code>int</code> value.
  +     * @return     The previous value.
  +     */
  +    public int set(int i) {
  +        int old = value;
  +        value = i;
  +        return old;
  +    }
  +
  +    /**
  +     * Get the current value.
  +     *
  +     * @return  The current value.
  +     */
  +    public int get() {
  +        return value;
  +    }
  +
  +
       /**
        * Set the value to value only if the current value is equal to 
        * the assumed value.
  @@ -186,7 +208,7 @@
        * @return     The new value.
        */
       public int negate() {
  -        value = ((int)-value);
  +        value = -value;
           return value;
       }
       
  @@ -196,7 +218,7 @@
        * @return     The new value.
        */
       public int complement() {
  -        value = (int)~value;
  +        value = ~value;
           return value;
       }
       
  @@ -207,7 +229,7 @@
        * @return     The new value.
        */
       public int and(int b) {
  -        value = (int)(value & b);
  +        value = value & b;
           return value;
       }
       
  @@ -218,7 +240,7 @@
        * @return     The new value.
        */
       public int or(int b) {
  -        value = (int)(value | b);
  +        value = value | b;
           return value;
       }
       
  @@ -229,7 +251,7 @@
        * @return     The new value.
        */
       public int xor(int b) {
  -        value = (int)(value ^ b);
  +        value = value ^ b;
           return value;
       }
       
  @@ -281,7 +303,7 @@
       /**
        * Compares this object with the specified object for order.
        *
  -     * @param other   Value to compare with.
  +     * @param obj     Value to compare with.
        * @return        A negative integer, zero, or a positive integer as
        *                this object is less than, equal to, or greater than
        *                the specified object.
  @@ -289,7 +311,7 @@
        * @throws ClassCastException    Object is not a MuInteger.
        */
       public int compareTo(Object obj) {
  -        return compareTo((MuInteger)obj);
  +        return compareTo(((MuInteger)obj).value);
       }
       
       /**
  @@ -355,7 +377,7 @@
        * @return   <code>int</code> value.
        */
       public int intValue() {
  -        return (int)value;
  +        return value;
       }
       
       /**
  @@ -393,7 +415,7 @@
       /**
        * Set the value of this mutable integer.
        *
  -     * @param value  Object to convert to an integer value.
  +     * @param obj  Object to convert to an integer value.
        *
        * @throws NotCoercibleException    Can not convert to <code>int</code>.
        */
  @@ -414,4 +436,4 @@
       public Object getValue() {
           return new Integer(value);
       }
  -}
  +}
  \ No newline at end of file
  
  
  
  1.2       +20 -12    incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuLong.java
  
  Index: MuLong.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuLong.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MuLong.java	24 Aug 2003 20:51:22 -0000	1.1
  +++ MuLong.java	27 Aug 2003 09:08:10 -0000	1.2
  @@ -188,7 +188,7 @@
        * @return     The new value.
        */
       public long negate() {
  -        value = ((long)-value);
  +        value = -value;
           return value;
       }
       
  @@ -198,7 +198,7 @@
        * @return     The new value.
        */
       public long complement() {
  -        value = (long)~value;
  +        value = ~value;
           return value;
       }
       
  @@ -209,7 +209,7 @@
        * @return     The new value.
        */
       public long and(long b) {
  -        value = (long)(value & b);
  +        value = value & b;
           return value;
       }
       
  @@ -220,7 +220,7 @@
        * @return     The new value.
        */
       public long or(long b) {
  -        value = (long)(value | b);
  +        value = value | b;
           return value;
       }
       
  @@ -231,7 +231,7 @@
        * @return     The new value.
        */
       public long xor(long b) {
  -        value = (long)(value ^ b);
  +        value = value ^ b;
           return value;
       }
       
  @@ -283,7 +283,7 @@
       /**
        * Compares this object with the specified object for order.
        *
  -     * @param other   Value to compare with.
  +     * @param obj     Value to compare with.
        * @return        A negative integer, zero, or a positive integer as
        *                this object is less than, equal to, or greater than
        *                the specified object.
  @@ -291,7 +291,7 @@
        * @throws ClassCastException    Object is not a MuLong.
        */
       public int compareTo(Object obj) {
  -        return compareTo((MuLong)obj);
  +        return compareTo(((MuLong)obj).value);
       }
       
       /**
  @@ -366,7 +366,7 @@
        * @return   <code>long</code> value.
        */
       public long longValue() {
  -        return (long)value;
  +        return value;
       }
       
       /**
  @@ -392,11 +392,19 @@
        *
        * @param value    The new value.
        */
  -    public void set(long value)
  -    {
  +    public void set(long value) {
           this.value = value;
       }
   
  +    /**
  +     * Get the current value.
  +     *
  +     * @return     The current value.
  +     */
  +    public long get() {
  +        return value;
  +    }
  +
   
       /////////////////////////////////////////////////////////////////////////
       //                            Mutable Support                          //
  @@ -426,4 +434,4 @@
       public Object getValue() {
           return new Long(value);
       }
  -}
  +}
  \ No newline at end of file
  
  
  
  1.2       +5 -5      incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuShort.java
  
  Index: MuShort.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/mutable/MuShort.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MuShort.java	24 Aug 2003 20:51:22 -0000	1.1
  +++ MuShort.java	27 Aug 2003 09:08:10 -0000	1.2
  @@ -302,7 +302,7 @@
       /**
        * Compares this object with the specified object for order.
        *
  -     * @param other   Value to compare with.
  +     * @param obj     Value to compare with.
        * @return        A negative integer, zero, or a positive integer as
        *                this object is less than, equal to, or greater than
        *                the specified object.
  @@ -310,7 +310,7 @@
        * @throws ClassCastException    Object is not a MuShort.
        */
       public int compareTo(Object obj) {
  -        return compareTo((MuShort)obj);
  +        return compareTo(((MuShort)obj).get());
       }
       
       /**
  @@ -367,7 +367,7 @@
        * @return   <code>short</code> value.
        */
       public short shortValue() {
  -        return (short)value;
  +        return value;
       }
       
       /**
  @@ -435,4 +435,4 @@
       public Object getValue() {
           return new Short(value);
       }
  -}
  +}
  \ No newline at end of file
  
  
  

Mime
View raw message