Author: akazakov
Date: 2010-03-13 02:10:33 -0500 (Sat, 13 Mar 2010)
New Revision: 20815
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.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ExpressionHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6054
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-03-12
18:48:47 UTC (rev 20814)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2010-03-13
07:10:33 UTC (rev 20815)
@@ -251,6 +251,9 @@
: operand;
ELResolutionImpl resolution = resolveELOperand(file, newOperand,
returnEqualedVariablesOnly, prefixWasChanged);
+ if(resolution==null) {
+ return null;
+ }
if(prefixWasChanged) {
resolution.setSourceOperand(operand);
@@ -296,12 +299,18 @@
var.resolveValue("#{" + var.getElToken().getText() + suffix +
"}"); //$NON-NLS-1$ //$NON-NLS-2$
ELResolutionImpl oldElResolution = resolveELOperand(file, operand,
returnEqualedVariablesOnly, false);
- resolution.getProposals().addAll(oldElResolution.getProposals());
+ if(oldElResolution!=null) {
+ resolution.getProposals().addAll(oldElResolution.getProposals());
+ }
} else {
resolution = resolveELOperand(file, operand, returnEqualedVariablesOnly, false);
}
}
+ if(resolution==null) {
+ return null;
+ }
+
// JBIDE-512, JBIDE-2541 related changes ===>>>
if(!returnEqualedVariablesOnly && vars!=null) {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java 2010-03-12
18:48:47 UTC (rev 20814)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java 2010-03-13
07:10:33 UTC (rev 20815)
@@ -414,11 +414,12 @@
context.setVars(vars);
ELResolution resolution = resolver.resolve(context, operand, offset);
-
- List<ELSegment> segments = resolution.findSegmentsByJavaElement(javaElement);
-
- for(ELSegment segment : segments){
- match(file, offset+segment.getSourceReference().getStartPosition(),
segment.getSourceReference().getLength());
+ if(resolution!=null) {
+ List<ELSegment> segments = resolution.findSegmentsByJavaElement(javaElement);
+
+ for(ELSegment segment : segments){
+ match(file, offset+segment.getSourceReference().getStartPosition(),
segment.getSourceReference().getLength());
+ }
}
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2010-03-12
18:48:47 UTC (rev 20814)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2010-03-13
07:10:33 UTC (rev 20815)
@@ -307,6 +307,9 @@
for (int i = 0; i < resolvers.length; i++) {
ELResolution elResolution = resolvers[i].resolve(context, operandToken,
documnetOffset);
+ if(elResolution==null) {
+ continue;
+ }
if(elResolution.isResolved()) {
resolution = elResolution;
break;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ExpressionHyperlink.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ExpressionHyperlink.java 2010-03-12
18:48:47 UTC (rev 20814)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ExpressionHyperlink.java 2010-03-13
07:10:33 UTC (rev 20815)
@@ -41,6 +41,9 @@
if(invocationExpression != null){
for(ELResolver resolver : context.getElResolvers()){
ELResolution resolution = resolver.resolve(context, invocationExpression,
invocationExpression.getStartPosition());
+ if(resolution==null) {
+ return null;
+ }
ELSegment segment =
resolution.findSegmentByOffset(offset-eStructure.reference.getStartPosition());
if(segment != null){
if(segment instanceof JavaMemberELSegment){
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java 2010-03-12
18:48:47 UTC (rev 20814)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java 2010-03-13
07:10:33 UTC (rev 20815)
@@ -130,6 +130,9 @@
public boolean decide(ELContext context, ELExpression expression, ELInvocationExpression
invocationExpression, int offset){
for(ELResolver resolver : context.getElResolvers()){
ELResolution resolution = resolver.resolve(context, invocationExpression,
invocationExpression.getStartPosition());
+ if(resolution==null) {
+ return false;
+ }
ELSegment segment = resolution.findSegmentByOffset(offset);
if(segment != null){
if(segment instanceof JavaMemberELSegment){
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2010-03-12
18:48:47 UTC (rev 20814)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2010-03-13
07:10:33 UTC (rev 20815)
@@ -139,11 +139,12 @@
context.setVars(vars);
ELResolution resolution = resolver.resolve(context, operand, offset);
-
- List<ELSegment> segments = resolution.findSegmentsByVariable(seamComponent);
-
- for(ELSegment segment : segments){
- match(file, offset+segment.getSourceReference().getStartPosition(),
segment.getSourceReference().getLength());
+ if(resolution!=null) {
+ List<ELSegment> segments = resolution.findSegmentsByVariable(seamComponent);
+
+ for(ELSegment segment : segments){
+ match(file, offset+segment.getSourceReference().getStartPosition(),
segment.getSourceReference().getLength());
+ }
}
}
}