Author: scabanovich
Date: 2012-07-27 19:13:10 -0400 (Fri, 27 Jul 2012)
New Revision: 42770
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
Log:
JBIDE-12358
https://issues.jboss.org/browse/JBIDE-12358
Test is added.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2012-07-27
22:03:45 UTC (rev 42769)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2012-07-27
23:13:10 UTC (rev 42770)
@@ -41,6 +41,7 @@
import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.el.core.ELReference;
import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInstance;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
import org.jboss.tools.common.el.core.parser.ELParserFactory;
@@ -293,7 +294,7 @@
disableProblemAnnotations(el);
}
- if(context!=null && !el.getSyntaxErrors().isEmpty()) {
+ if(context!=null && !el.getSyntaxErrors().isEmpty() &&
!isDollarExpressionInXML(el)) {
for (SyntaxError error: el.getSyntaxErrors()) {
markers++;
IJavaSourceReference reference = getJavaReference(el.getResource(),
el.getStartPosition() + error.getPosition(), 1);
@@ -318,6 +319,20 @@
}
}
+ private boolean isDollarExpressionInXML(ELReference el) {
+ String ext = el.getResource().getFileExtension();
+ return ("xml".equals(ext) && isDollarExpression(el));
+ }
+ private boolean isDollarExpression(ELReference el) {
+ List<ELInstance> is = el.getELModel().getInstances();
+ for (ELInstance i:is) {
+ if(i.getFirstToken().getText().equals("${")) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private void validateELExpression(ELReference elReference, ELExpression el, boolean
asYouType, ELContext context) {
List<ELInvocationExpression> es = el.getInvocations();
for (ELInvocationExpression token: es) {