Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 58956 Details for
Bug 174131
[assist] Result of test CompletionTests#testCompletionInsideExtends10 is wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug174131_001.txt (text/plain), 7.24 KB, created by
David Audel
on 2007-02-14 03:59:07 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2007-02-14 03:59:07 EST
Size:
7.24 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java,v >retrieving revision 1.25 >diff -u -r1.25 CompletionOnSingleTypeReference.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java 10 May 2006 18:03:43 -0000 1.25 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java 14 Feb 2007 08:50:25 -0000 >@@ -74,6 +74,9 @@ > public boolean isException(){ > return this.kind == K_EXCEPTION; > } >+public boolean isSuperType(){ >+ return this.kind == K_CLASS || this.kind == K_INTERFACE; >+} > public StringBuffer printExpression(int indent, StringBuffer output){ > switch (this.kind) { > case K_CLASS : >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java,v >retrieving revision 1.22 >diff -u -r1.22 CompletionOnQualifiedTypeReference.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java 10 May 2006 18:03:43 -0000 1.22 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java 14 Feb 2007 08:50:25 -0000 >@@ -73,6 +73,10 @@ > public boolean isException(){ > return this.kind == K_EXCEPTION; > } >+ >+public boolean isSuperType(){ >+ return this.kind == K_CLASS || this.kind == K_INTERFACE; >+} > public StringBuffer printExpression(int indent, StringBuffer output) { > switch (this.kind) { > case K_CLASS : >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java,v >retrieving revision 1.8 >diff -u -r1.8 CompletionOnParameterizedQualifiedTypeReference.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java 10 May 2006 18:03:43 -0000 1.8 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java 14 Feb 2007 08:50:25 -0000 >@@ -72,6 +72,10 @@ > return this.kind == K_EXCEPTION; > } > >+ public boolean isSuperType(){ >+ return this.kind == K_CLASS || this.kind == K_INTERFACE; >+ } >+ > public TypeBinding resolveType(BlockScope scope, boolean checkBounds) { > super.resolveType(scope, checkBounds); > throw new CompletionNodeFound(this, this.resolvedType, scope); >Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.317 >diff -u -r1.317 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 12 Feb 2007 14:17:08 -0000 1.317 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 14 Feb 2007 08:50:25 -0000 >@@ -246,6 +246,7 @@ > boolean assistNodeIsInterface; > boolean assistNodeIsAnnotation; > boolean assistNodeIsConstructor; >+ boolean assistNodeIsSuperType; > int assistNodeInJavadoc = 0; > boolean assistNodeCanBeSingleMemberAnnotation = false; > >@@ -921,7 +922,8 @@ > this.assistNodeIsException = singleRef.isException(); > this.assistNodeIsInterface = singleRef.isInterface(); > this.assistNodeIsConstructor = singleRef.isConstructorType; >- >+ this.assistNodeIsSuperType = singleRef.isSuperType(); >+ > // can be the start of a qualified type name > if (qualifiedBinding == null) { > if (this.completionToken.length == 0 && >@@ -1115,6 +1117,7 @@ > this.assistNodeIsClass = ref.isClass(); > this.assistNodeIsException = ref.isException(); > this.assistNodeIsInterface = ref.isInterface(); >+ this.assistNodeIsSuperType = ref.isSuperType(); > > this.completionToken = ref.completionIdentifier; > long completionPosition = ref.sourcePositions[ref.tokens.length]; >@@ -1354,6 +1357,7 @@ > this.assistNodeIsClass = ref.isClass(); > this.assistNodeIsException = ref.isException(); > this.assistNodeIsInterface = ref.isInterface(); >+ this.assistNodeIsSuperType = ref.isSuperType(); > > this.completionToken = ref.completionIdentifier; > long completionPosition = ref.sourcePositions[ref.tokens.length]; >@@ -4307,9 +4311,10 @@ > if (typeName == null) > return; > >- if (currentType.superInterfaces() == null) >- return; // we're trying to find a supertype >- >+ if (this.assistNodeIsSuperType && !this.insideQualifiedReference) return; // we're trying to find a supertype >+ >+ if (currentType.superInterfaces() == null) return; >+ > if (this.insideQualifiedReference > || typeName.length == 0) { // do not search up the hierarchy > >@@ -4463,9 +4468,10 @@ > if (typeName == null || typeName.length == 0) > return; > >- if (currentType.superInterfaces() == null) >- return; // we're trying to find a supertype >+ if (this.assistNodeIsSuperType && !this.insideQualifiedReference) return; // we're trying to find a supertype > >+ if (currentType.superInterfaces() == null) return; >+ > findMemberTypes( > typeName, > currentType.memberTypes(), >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java,v >retrieving revision 1.144 >diff -u -r1.144 CompletionTests.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 13 Feb 2007 08:53:57 -0000 1.144 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 14 Feb 2007 08:50:37 -0000 >@@ -3946,7 +3946,6 @@ > this.wc.codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( >- "CompletionInsideExtends10.CompletionInsideExtends10Inner.CompletionInsideExtends10InnerInner[TYPE_REF]{test.CompletionInsideExtends10.CompletionInsideExtends10Inner.CompletionInsideExtends10InnerInner, test, Ltest.CompletionInsideExtends10$CompletionInsideExtends10Inner$CompletionInsideExtends10InnerInner;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_NON_RESTRICTED) + "}\n" + > "CompletionInsideExtends10[TYPE_REF]{CompletionInsideExtends10, test, Ltest.CompletionInsideExtends10;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" + > "CompletionInsideExtends10TopLevel[TYPE_REF]{CompletionInsideExtends10TopLevel, test, Ltest.CompletionInsideExtends10TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", > requestor.getResults());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 174131
: 58956