cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From and...@apache.org
Subject svn commit: r824131 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/
Date Sun, 11 Oct 2009 19:53:21 GMT
Author: andrey
Date: Sun Oct 11 19:53:21 2009
New Revision: 824131

URL: http://svn.apache.org/viewvc?rev=824131&view=rev
Log:
CAY-1257 NullPointerException in Class Qualifier when using "field = null"

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/SimpleNode.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=824131&r1=824130&r2=824131&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Sun Oct 11 19:53:21 2009
@@ -47,6 +47,7 @@
 CAY-1248 ClassCastException with OracleLOBBatchAction
 CAY-1250 Prefetching doesn't work with prefetched subentity
 CAY-1252 Bad XML generated when saving DBEntity qualifiers
+CAY-1257 NullPointerException in Class Qualifier when using "field = null"
 CAY-1259 Wrong Mapping for NUMERIC Type
 CAY-1265 error while search inheritance relationship
 CAY-1274 CreateTableToDb should not create existing AUTO_PK_SUPPORT

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/SimpleNode.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/SimpleNode.java?rev=824131&r1=824130&r2=824131&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/SimpleNode.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/SimpleNode.java
Sun Oct 11 19:53:21 2009
@@ -312,7 +312,8 @@
     }
 
     protected Object evaluateChild(int index, Object o) throws Exception {
-        return ((SimpleNode) jjtGetChild(index)).evaluate(o);
+    	SimpleNode node = (SimpleNode) jjtGetChild(index);
+    	return node != null ? node.evaluate(o) : null;
     }
 
     @Override

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java?rev=824131&r1=824130&r2=824131&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java
Sun Oct 11 19:53:21 2009
@@ -26,7 +26,9 @@
 import org.apache.art.Artist;
 import org.apache.cayenne.CayenneDataObject;
 import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.exp.Expression;
+import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.exp.parser.ASTObjPath;
 import org.apache.cayenne.unit.CayenneCase;
 import org.apache.cayenne.util.Util;
@@ -437,4 +439,14 @@
                                 + "and db:toArtist.artistExhibitArray.toExhibit.CLOSING_DATE
= $d"),
                 translated);
     }
+    
+    public void testTranslateNullArg() {
+        ObjectContext context = createDataContext();
+        ObjEntity entity = context.getEntityResolver().getObjEntity("Artist");
+        
+        Expression exp = ExpressionFactory.noMatchExp("dateOfBirth", null);
+        Expression translated = entity.translateToDbPath(exp);
+        
+        assertFalse(translated.match(new Artist()));
+    } 
 }



Mime
View raw message