Author: akazakov
Date: 2009-12-09 10:04:45 -0500 (Wed, 09 Dec 2009)
New Revision: 19157
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/resolver/ELResolutionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath
Log:
https://jira.jboss.org/jira/browse/JBIDE-5232
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 2009-12-09
13:56:46 UTC (rev 19156)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2009-12-09
15:04:45 UTC (rev 19157)
@@ -748,7 +748,7 @@
// token.getType() == ELOperandToken.EL_METHOD_TOKEN)
{
// return filtered methods + properties
- Set<TypeInfoCollector.MemberPresentation> proposalsToFilter = new
TreeSet<TypeInfoCollector.MemberPresentation>(TypeInfoCollector.MEMBER_PRESENTATION_COMPARATOR);
+ Set<TypeInfoCollector.MemberPresentation> proposalsToFilter = new
TreeSet<TypeInfoCollector.MemberPresentation>(TypeInfoCollector.MEMBER_PRESENTATION_COMPARATOR);
for (TypeInfoCollector.MemberInfo mbr : members) {
if(isSingularMember(mbr)) {
filterSingularMember(mbr, proposalsToFilter);
@@ -761,7 +761,7 @@
}
proposalsToFilter.addAll(infos.getMethodPresentations());
proposalsToFilter.addAll(infos.getPropertyPresentations(segment.getUnpairedGettersOrSetters()));
- segment.setMemberInfo(mbr);
+// segment.setMemberInfo(mbr);
}
for (TypeInfoCollector.MemberPresentation proposal : proposalsToFilter) {
// We do expect nothing but name for method tokens (No round brackets)
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2009-12-09
13:56:46 UTC (rev 19156)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2009-12-09
15:04:45 UTC (rev 19157)
@@ -43,9 +43,11 @@
public List<ELSegment> findSegmentsByVariable(IVariable variable) {
ArrayList<ELSegment> list = new ArrayList<ELSegment>();
for(ELSegment segment : segments){
- for(IVariable var : segment.getVariables()){
- if(var.getName().equals(variable.getName())){
- list.add(segment);
+ if(segment.isResolved()) {
+ for(IVariable var : segment.getVariables()){
+ if(var.getName().equals(variable.getName())){
+ list.add(segment);
+ }
}
}
}
@@ -59,8 +61,12 @@
public List<ELSegment> findSegmentsByJavaElement(IJavaElement element) {
ArrayList<ELSegment> list = new ArrayList<ELSegment>();
for(ELSegment segment : segments){
- if(segment instanceof JavaMemberELSegment &&
((JavaMemberELSegment)segment).getJavaElement() != null &&
((JavaMemberELSegment)segment).getJavaElement().equals(element))
- list.add(segment);
+ if(segment.isResolved() && segment instanceof JavaMemberELSegment) {
+ JavaMemberELSegment javaSegment = (JavaMemberELSegment)segment;
+ if(javaSegment.getJavaElement() != null &&
javaSegment.getJavaElement().equals(element)) {
+ list.add(segment);
+ }
+ }
}
return list;
}
@@ -232,4 +238,20 @@
public void setValue(String value) {
this.value = value;
}
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ if(segments!=null) {
+ StringBuffer result = new StringBuffer("["); //$NON-NLS-1$
+ for (ELSegment segment : segments) {
+ result.append(segment.toString()).append(';');
+ }
+ result.append(']');
+ return result.toString();
+ }
+ return super.toString();
+ }
}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java 2009-12-09
13:56:46 UTC (rev 19156)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java 2009-12-09
15:04:45 UTC (rev 19157)
@@ -107,4 +107,12 @@
public void setVariables(List<IVariable> variables) {
this.variables = variables;
}
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return token!=null?token.getText() + "(" + resolved + ")":
super.toString(); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
\ No newline at end of file
Modified:
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath
===================================================================
---
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath 2009-12-09
13:56:46 UTC (rev 19156)
+++
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath 2009-12-09
15:04:45 UTC (rev 19157)
@@ -8,7 +8,7 @@
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.5.0_10">
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="owner.project.facets" value="jst.java"/>
</attributes>