Author: scabanovich
Date: 2010-12-02 08:19:54 -0500 (Thu, 02 Dec 2010)
New Revision: 27091
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
Log:
JBIDE-7787
https://jira.jboss.org/browse/JBIDE-7787
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-12-02
13:15:11 UTC (rev 27090)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java 2010-12-02
13:19:54 UTC (rev 27091)
@@ -213,7 +213,7 @@
if(text != null) {
boolean found = false;
for (IRelevanceCheck check: checks) {
- if(check.isRelevant(text)) {
+ if(check != null && check.isRelevant(text)) {
found = true;
break;
}
@@ -238,7 +238,7 @@
ELResolver resolver = resolvers[i];
if (!(resolver instanceof ELCompletionEngine))
continue;
- if(!checks[i].isRelevant(operand.getText()))
+ if(checks[i] != null && !checks[i].isRelevant(operand.getText()))
continue;
ELResolution resolution = resolver.resolve(context, operand, offset);
@@ -275,14 +275,11 @@
protected IRelevanceCheck[] getRelevanceChecks(ELResolver[] resolvers) {
if(resolvers == null) return new IRelevanceCheck[0];
- List<IRelevanceCheck> checks = new ArrayList<IRelevanceCheck>();
- for (ELResolver resolver : resolvers) {
- IRelevanceCheck check = resolver.createRelevanceCheck(javaElement);
- if(check!=null) {
- checks.add(check);
- }
+ IRelevanceCheck[] checks = new IRelevanceCheck[resolvers.length];
+ for (int i = 0; i < checks.length; i++) {
+ checks[i] = resolvers[i].createRelevanceCheck(javaElement);
}
- return checks.toArray(new IRelevanceCheck[0]);
+ return checks;
}
// looking for component references in EL