From 01e08029e93ceb75f24297fc3471f3afe299620d Mon Sep 17 00:00:00 2001 From: Catalina Wei Date: Fri, 9 May 2008 17:05:45 +0000 Subject: [PATCH] OPENJPA-595 A common path() action in JPQL.jjt being used for Enum literal causes a simple aliase resolution to fail git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@654885 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java index 5678aed24..c9088e9ab 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java @@ -1322,7 +1322,7 @@ public class JPQLExpressionBuilder Object value = field.get(null); return factory.newLiteral(value, Literal.TYPE_UNKNOWN); } catch (NoSuchFieldException nsfe) { - if (node.parser.inEnumPath) + if (node.inEnumPath) throw parseException(EX_USER, "no-field", new Object[]{ c.getName(), fieldName }, nsfe); else @@ -1559,10 +1559,12 @@ public class JPQLExpressionBuilder JPQLNode[] children; String text; boolean not = false; + boolean inEnumPath = false; public JPQLNode(JPQL parser, int id) { this.id = id; this.parser = parser; + this.inEnumPath = parser.inEnumPath; } public void jjtOpen() {