Author: akazakov
Date: 2010-10-12 10:57:27 -0400 (Tue, 12 Oct 2010)
New Revision: 25749
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
https://jira.jboss.org/browse/JBIDE-7318 Fixed NPE
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2010-10-12
14:56:11 UTC (rev 25748)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2010-10-12
14:57:27 UTC (rev 25749)
@@ -103,7 +103,9 @@
ELResolutionImpl resolution;
try {
resolution = resolveELOperand(context.getResource(), parseOperand(el), false, vars,
new ElVarSearcher(context.getResource(), this));
- completions.addAll(resolution.getProposals());
+ if(resolution!=null) {
+ completions.addAll(resolution.getProposals());
+ }
} catch (StringIndexOutOfBoundsException e) {
log(e);
} catch (BadLocationException e) {
@@ -315,6 +317,9 @@
String prefix = operand.toString();
if(v.getName().startsWith(prefix)) {
ELResolution r = resolveEL(file, v.getElToken(), true, vars, varSearcher);
+ if(r==null) {
+ continue;
+ }
ELSegment lastSegment = r.getLastSegment();
JavaMemberELSegment jmSegment = null;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java 2010-10-12
14:56:11 UTC (rev 25748)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java 2010-10-12
14:57:27 UTC (rev 25749)
@@ -104,7 +104,7 @@
for (String var : elVars) {
try {
ELResolution resolution = resolveEL(file, IMPLICT_OBJECTS_ELS.get(var), false);
- if(resolution.isResolved()) {
+ if(resolution!=null && resolution.isResolved()) {
ELSegment segment = resolution.getLastSegment();
if(segment instanceof JavaMemberELSegment) {
TypeInfoCollector.MemberInfo info =
((JavaMemberELSegment)segment).getMemberInfo();
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2010-10-12
14:56:11 UTC (rev 25748)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2010-10-12
14:57:27 UTC (rev 25749)
@@ -334,7 +334,7 @@
List<Var> vars = varSearcher.findAllVars(file, expr.getStartPosition());
ELResolution resolution = resolveELOperand(file, expr, true, vars, varSearcher);
- if (resolution.isResolved()) {
+ if (resolution!=null && resolution.isResolved()) {
ELSegment segment = resolution.getLastSegment();
if(segment instanceof JavaMemberELSegment) {
IJavaElement el = ((JavaMemberELSegment)segment).getJavaElement();