openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r428090 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java
Date Wed, 02 Aug 2006 19:02:54 GMT
Author: awhite
Date: Wed Aug  2 12:02:53 2006
New Revision: 428090

URL: http://svn.apache.org/viewvc?rev=428090&view=rev
Log:
Fix bug in numeric promotion in queries.


Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java?rev=428090&r1=428089&r2=428090&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java
Wed Aug  2 12:02:53 2006
@@ -110,10 +110,14 @@
      * to before performing any mathematical operations between them.
      */
     public static Class promote(Class c1, Class c2) {
-        c1 = wrap(c1);
-        c2 = wrap(c2);
         if (c1 == c2)
             return c1;
+        Class w1 = wrap(c1);
+        Class w2 = wrap(c2);
+        if (w1 == w2)
+            return c1;
+        c1 = w1;
+        c2 = w2;
 
         // not numbers?
         boolean c1Number = Number.class.isAssignableFrom(c1);



Mime
View raw message