openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1650604 - /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java
Date Fri, 09 Jan 2015 17:20:25 GMT
Author: struberg
Date: Fri Jan  9 17:20:25 2015
New Revision: 1650604

URL: http://svn.apache.org/r1650604
Log:
OPENJPA-2018 improve readability

Modified:
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java?rev=1650604&r1=1650603&r2=1650604&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java
Fri Jan  9 17:20:25 2015
@@ -1450,15 +1450,16 @@ class Expressions {
                 ExpressionImpl<?> e1 = e.e1;
 
                 Class<?> e1JavaType = e1.getJavaType();
-                Class<?> e2jt = e2.getJavaType();
+                Class<?> e2JavaType = e2.getJavaType();
 
-                // array
+                // array and Collection
                 if (BindableParameter.class.isInstance(e2) && BindableParameter.class.cast(e2).value()
!= null &&
-                    ((e2jt.isArray() && e2jt.getComponentType().equals(e1JavaType))
-                    || (Class.class.isInstance(e2jt) ||
-                        (ParameterizedType.class.isInstance(e2jt)
-                            && ParameterizedType.class.cast(e2jt).getActualTypeArguments().length
> 0
-                            && e1JavaType.equals(ParameterizedType.class.cast(e2jt).getActualTypeArguments()[0])))))
{
+                    ((e2JavaType.isArray() && e2JavaType.getComponentType().equals(e1JavaType))
+                    || (Class.class.isInstance(e2JavaType) ||
+                        (ParameterizedType.class.isInstance(e2JavaType)
+                            && ParameterizedType.class.cast(e2JavaType).getActualTypeArguments().length
> 0
+                            && e1JavaType.equals(ParameterizedType.class.cast(e2JavaType).getActualTypeArguments()[0]))
+                       ))) {
                     final BindableParameter bp = BindableParameter.class.cast(e2);
                     final Object value = bp.value();
 



Mime
View raw message