Author: scabanovich
Date: 2010-10-14 08:24:18 -0400 (Thu, 14 Oct 2010)
New Revision: 25827
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
Log:
JBIDE-7265
https://jira.jboss.org/browse/JBIDE-7265
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java 2010-10-14
12:22:38 UTC (rev 25826)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java 2010-10-14
12:24:18 UTC (rev 25827)
@@ -42,6 +42,7 @@
import org.jboss.tools.common.el.core.resolver.ELResolverFactoryManager;
import org.jboss.tools.common.el.core.resolver.ELSegment;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
import org.jboss.tools.common.el.core.resolver.SimpleELContext;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -198,14 +199,22 @@
ELReference[] references = context.getELReferences();
ELResolver[] resolvers = context.getElResolvers();
+
+ IRelevanceCheck[] checks = new IRelevanceCheck[resolvers.length];
+ for (int i = 0; i < checks.length; i++) {
+ checks[i] = resolvers[i].createRelevanceCheck(javaElement);
+ }
if(javaElement != null){
for(ELReference reference : references){
int offset = reference.getStartPosition();
for(ELExpression operand : reference.getEl()){
- for (ELResolver resolver : resolvers) {
+ for (int i = 0; i < resolvers.length; i++) {
+ ELResolver resolver = resolvers[i];
if (!(resolver instanceof ELCompletionEngine))
continue;
+ if(!checks[i].isRelevant(operand.getText()))
+ continue;
ELResolution resolution = resolver.resolve(context, operand, offset);