cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1063282 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/exp/parser/ASTObjPath.java test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTest.java
Date Tue, 25 Jan 2011 14:07:14 GMT
Author: aadamchik
Date: Tue Jan 25 14:07:14 2011
New Revision: 1063282

URL: http://svn.apache.org/viewvc?rev=1063282&view=rev
Log:
CAY-1528 Undo CAY-1213

undoing r1001041

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ASTObjPath.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ASTObjPath.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ASTObjPath.java?rev=1063282&r1=1063281&r2=1063282&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ASTObjPath.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ASTObjPath.java
Tue Jan 25 14:07:14 2011
@@ -24,16 +24,13 @@ import java.io.PrintWriter;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.DataObject;
 import org.apache.cayenne.exp.Expression;
-import org.apache.cayenne.exp.ExpressionException;
 import org.apache.cayenne.map.Entity;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.reflect.PropertyUtils;
-import org.apache.cayenne.util.Util;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 public class ASTObjPath extends ASTPath {
-
     private static final Log logObj = LogFactory.getLog(ASTObjPath.class);
 
     /**
@@ -54,15 +51,6 @@ public class ASTObjPath extends ASTPath 
 
     @Override
     protected Object evaluateNode(Object o) throws Exception {
-        try {
-            Object constValue = Util.getClassFieldValue(path);
-            if (constValue != null) {
-                return constValue;
-            }
-        }
-        catch (IllegalAccessException e) {
-            throw new ExpressionException("Can't access const field", e);
-        }
         return (o instanceof DataObject)
                 ? ((DataObject) o).readNestedProperty(path)
                 : (o instanceof Entity) ? evaluateEntityNode((Entity) o) : PropertyUtils

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTest.java?rev=1063282&r1=1063281&r2=1063282&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTest.java
Tue Jan 25 14:07:14 2011
@@ -27,7 +27,6 @@ import org.apache.cayenne.map.DbAttribut
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.ObjAttribute;
 import org.apache.cayenne.map.ObjEntity;
-import org.apache.cayenne.testdo.consttest.Const1Type;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.unit.CayenneCase;
@@ -61,13 +60,6 @@ public class ExpressionEvaluateInMemoryT
         assertEquals(new Integer(-3), node.evaluate(b2));
     }
 
-    public void testEvaluateOBJ_PATH_EnumConstant() {
-        ASTObjPath node = new ASTObjPath(
-                "org.apache.cayenne.testdo.consttest.Const1Type.ADMIN");
-
-        assertEquals(Const1Type.ADMIN, node.evaluate(new Artist()));
-    }
-
     public void testEvaluateOBJ_PATH_ObjEntity() throws Exception {
         ASTObjPath node = new ASTObjPath("paintingArray.paintingTitle");
 



Mime
View raw message