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 37731 Details for
Bug 134976
[completion] relevance of some types aren't correct
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch001.txt (text/plain), 22.09 KB, created by
David Audel
on 2006-04-05 10:03:40 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-04-05 10:03:40 EDT
Size:
22.09 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.282 >diff -u -r1.282 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 28 Mar 2006 20:30:02 -0000 1.282 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 5 Apr 2006 13:44:24 -0000 >@@ -98,6 +98,7 @@ > int expectedTypesPtr = -1; > TypeBinding[] expectedTypes = new TypeBinding[1]; > int expectedTypesFilter; >+ boolean hasJavaLangObjectAsExpectedType = false; > int uninterestingBindingsPtr = -1; > Binding[] uninterestingBindings = new Binding[1]; > int forbbidenBindingsPtr = -1; >@@ -4228,6 +4229,9 @@ > return R_EXACT_EXPECTED_TYPE; > } > } >+ if(this.hasJavaLangObjectAsExpectedType) { >+ return R_EXPECTED_TYPE; >+ } > } > return 0; > } >@@ -5829,6 +5833,7 @@ > > // default filter > this.expectedTypesFilter = SUBTYPE; >+ this.hasJavaLangObjectAsExpectedType = false; > > // find types from parent > if(parent instanceof AbstractVariableDeclaration) { >@@ -5836,27 +5841,27 @@ > TypeBinding binding = variable.type.resolvedType; > if(binding != null) { > if(!(variable.initialization instanceof ArrayInitializer)) { >- addExpectedType(binding); >+ addExpectedType(binding, scope); > } > } > } else if(parent instanceof Assignment) { > TypeBinding binding = ((Assignment)parent).lhs.resolvedType; > if(binding != null) { >- addExpectedType(binding); >+ addExpectedType(binding, scope); > } > } else if(parent instanceof ReturnStatement) { > if(scope.methodScope().referenceContext instanceof AbstractMethodDeclaration) { > MethodBinding methodBinding = ((AbstractMethodDeclaration) scope.methodScope().referenceContext).binding; > TypeBinding binding = methodBinding == null ? null : methodBinding.returnType; > if(binding != null) { >- addExpectedType(binding); >+ addExpectedType(binding, scope); > } > } > } else if(parent instanceof CastExpression) { > Expression e = ((CastExpression)parent).type; > TypeBinding binding = e.resolvedType; > if(binding != null){ >- addExpectedType(binding); >+ addExpectedType(binding, scope); > this.expectedTypesFilter = SUBTYPE | SUPERTYPE; > } > } else if(parent instanceof MessageSend) { >@@ -5906,34 +5911,34 @@ > InstanceOfExpression e = (InstanceOfExpression) parent; > TypeBinding binding = e.expression.resolvedType; > if(binding != null){ >- addExpectedType(binding); >+ addExpectedType(binding, scope); > this.expectedTypesFilter = SUBTYPE | SUPERTYPE; > } > } else if(parent instanceof BinaryExpression) { > switch(operator) { > case OperatorIds.PLUS : >- addExpectedType(TypeBinding.SHORT); >- addExpectedType(TypeBinding.INT); >- addExpectedType(TypeBinding.LONG); >- addExpectedType(TypeBinding.FLOAT); >- addExpectedType(TypeBinding.DOUBLE); >- addExpectedType(TypeBinding.CHAR); >- addExpectedType(TypeBinding.BYTE); >- addExpectedType(scope.getJavaLangString()); >+ addExpectedType(TypeBinding.SHORT, scope); >+ addExpectedType(TypeBinding.INT, scope); >+ addExpectedType(TypeBinding.LONG, scope); >+ addExpectedType(TypeBinding.FLOAT, scope); >+ addExpectedType(TypeBinding.DOUBLE, scope); >+ addExpectedType(TypeBinding.CHAR, scope); >+ addExpectedType(TypeBinding.BYTE, scope); >+ addExpectedType(scope.getJavaLangString(), scope); > break; > case OperatorIds.AND_AND : > case OperatorIds.OR_OR : > case OperatorIds.XOR : >- addExpectedType(TypeBinding.BOOLEAN); >+ addExpectedType(TypeBinding.BOOLEAN, scope); > break; > default : >- addExpectedType(TypeBinding.SHORT); >- addExpectedType(TypeBinding.INT); >- addExpectedType(TypeBinding.LONG); >- addExpectedType(TypeBinding.FLOAT); >- addExpectedType(TypeBinding.DOUBLE); >- addExpectedType(TypeBinding.CHAR); >- addExpectedType(TypeBinding.BYTE); >+ addExpectedType(TypeBinding.SHORT, scope); >+ addExpectedType(TypeBinding.INT, scope); >+ addExpectedType(TypeBinding.LONG, scope); >+ addExpectedType(TypeBinding.FLOAT, scope); >+ addExpectedType(TypeBinding.DOUBLE, scope); >+ addExpectedType(TypeBinding.CHAR, scope); >+ addExpectedType(TypeBinding.BYTE, scope); > break; > } > BinaryExpression binaryExpression = (BinaryExpression) parent; >@@ -5944,7 +5949,7 @@ > if(b instanceof ReferenceBinding) { > TypeVariableBinding[] typeVariableBindings =((ReferenceBinding)b).typeVariables(); > if(typeVariableBindings != null && typeVariableBindings.length > 0) { >- addExpectedType(typeVariableBindings[0].firstBound); >+ addExpectedType(typeVariableBindings[0].firstBound, scope); > } > > } >@@ -5953,33 +5958,33 @@ > } else if(parent instanceof UnaryExpression) { > switch(operator) { > case OperatorIds.NOT : >- addExpectedType(TypeBinding.BOOLEAN); >+ addExpectedType(TypeBinding.BOOLEAN, scope); > break; > case OperatorIds.TWIDDLE : >- addExpectedType(TypeBinding.SHORT); >- addExpectedType(TypeBinding.INT); >- addExpectedType(TypeBinding.LONG); >- addExpectedType(TypeBinding.CHAR); >- addExpectedType(TypeBinding.BYTE); >+ addExpectedType(TypeBinding.SHORT, scope); >+ addExpectedType(TypeBinding.INT, scope); >+ addExpectedType(TypeBinding.LONG, scope); >+ addExpectedType(TypeBinding.CHAR, scope); >+ addExpectedType(TypeBinding.BYTE, scope); > break; > case OperatorIds.PLUS : > case OperatorIds.MINUS : > case OperatorIds.PLUS_PLUS : > case OperatorIds.MINUS_MINUS : >- addExpectedType(TypeBinding.SHORT); >- addExpectedType(TypeBinding.INT); >- addExpectedType(TypeBinding.LONG); >- addExpectedType(TypeBinding.FLOAT); >- addExpectedType(TypeBinding.DOUBLE); >- addExpectedType(TypeBinding.CHAR); >- addExpectedType(TypeBinding.BYTE); >+ addExpectedType(TypeBinding.SHORT, scope); >+ addExpectedType(TypeBinding.INT, scope); >+ addExpectedType(TypeBinding.LONG, scope); >+ addExpectedType(TypeBinding.FLOAT, scope); >+ addExpectedType(TypeBinding.DOUBLE, scope); >+ addExpectedType(TypeBinding.CHAR, scope); >+ addExpectedType(TypeBinding.BYTE, scope); > break; > } > } > } else if(parent instanceof ArrayReference) { >- addExpectedType(TypeBinding.SHORT); >- addExpectedType(TypeBinding.INT); >- addExpectedType(TypeBinding.LONG); >+ addExpectedType(TypeBinding.SHORT, scope); >+ addExpectedType(TypeBinding.INT, scope); >+ addExpectedType(TypeBinding.LONG, scope); > } else if(parent instanceof ParameterizedSingleTypeReference) { > ParameterizedSingleTypeReference ref = (ParameterizedSingleTypeReference) parent; > TypeVariableBinding[] typeVariables = ((ReferenceBinding)ref.resolvedType).typeVariables(); >@@ -5987,7 +5992,9 @@ > if(typeVariables != null && typeVariables.length >= length) { > int index = length - 1; > while(index > -1 && ref.typeArguments[index] != node) index--; >- addExpectedType(typeVariables[index].firstBound); >+ >+ TypeBinding bound = typeVariables[index].firstBound; >+ addExpectedType(bound == null ? scope.getJavaLangObject() : bound, scope); > } > } else if(parent instanceof ParameterizedQualifiedTypeReference) { > ParameterizedQualifiedTypeReference ref = (ParameterizedQualifiedTypeReference) parent; >@@ -5999,7 +6006,8 @@ > int jLength = arguments[i] == null ? 0 : arguments[i].length; > for (int j = 0; j < jLength; j++) { > if(arguments[i][j] == node && typeVariables.length > j) { >- addExpectedType(typeVariables[j].firstBound); >+ TypeBinding bound = typeVariables[j].firstBound; >+ addExpectedType(bound == null ? scope.getJavaLangObject() : bound, scope); > break done; > } > } >@@ -6008,7 +6016,7 @@ > } else if(parent instanceof MemberValuePair) { > MemberValuePair memberValuePair = (MemberValuePair) parent; > if(memberValuePair.binding != null) { >- addExpectedType(memberValuePair.binding.returnType); >+ addExpectedType(memberValuePair.binding.returnType, scope); > } > } else if (parent instanceof NormalAnnotation) { > NormalAnnotation annotation = (NormalAnnotation) parent; >@@ -6020,7 +6028,7 @@ > if(methodBindings != null && > methodBindings.length == 1 && > CharOperation.equals(methodBindings[0].selector, VALUE)) { >- addExpectedType(methodBindings[0].returnType); >+ addExpectedType(methodBindings[0].returnType, scope); > } > } > } >@@ -6033,7 +6041,7 @@ > ReferenceBinding[] exceptions = methodDecl.binding.thrownExceptions; > if (exceptions != null) { > for (int i = 0; i < exceptions.length; i++) { >- addExpectedType(exceptions[i]); >+ addExpectedType(exceptions[i], scope); > } > } > } >@@ -6076,7 +6084,7 @@ > > TypeBinding expectedType = method.parameters[arguments.length - 1]; > if(expectedType != null) { >- addExpectedType(expectedType); >+ addExpectedType(expectedType, scope); > } > } > } >@@ -6182,17 +6190,21 @@ > > TypeBinding expectedType = method.parameters[arguments.length - 1]; > if(expectedType != null) { >- addExpectedType(expectedType); >+ addExpectedType(expectedType, scope); > } > } > } >- private void addExpectedType(TypeBinding type){ >+ private void addExpectedType(TypeBinding type, Scope scope){ > if (type == null || !type.isValidBinding()) return; > > int length = this.expectedTypes.length; > if (++this.expectedTypesPtr >= length) > System.arraycopy(this.expectedTypes, 0, this.expectedTypes = new TypeBinding[length * 2], 0, length); > this.expectedTypes[this.expectedTypesPtr] = type; >+ >+ if(type == scope.getJavaLangObject()) { >+ this.hasJavaLangObjectAsExpectedType = true; >+ } > } > private void addForbiddenBindings(Binding binding){ > if (binding == null) return; >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java,v >retrieving revision 1.62 >diff -u -r1.62 CompletionTests_1_5.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 29 Mar 2006 04:03:07 -0000 1.62 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 5 Apr 2006 13:44:38 -0000 >@@ -19,7 +19,9 @@ > import junit.framework.*; > > public class CompletionTests_1_5 extends AbstractJavaModelCompletionTests implements RelevanceConstants { >- >+ static { >+// TESTS_NAMES = new String[]{"test0040"}; >+ } > public CompletionTests_1_5(String name) { > super(name); > } >@@ -122,7 +124,7 @@ > cu.codeComplete(cursorLocation, requestor); > > assertEquals("should have one class", >- "element:String completion:String relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED), >+ "element:String completion:String relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED), > requestor.getResults()); > } > public void test0002() throws JavaModelException { >@@ -135,7 +137,7 @@ > cu.codeComplete(cursorLocation, requestor); > > assertEquals("should have one class", >- "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED), >+ "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED), > requestor.getResults()); > } > public void test0003() throws JavaModelException { >@@ -183,12 +185,12 @@ > "Y<St"); > > assertResults( >- "expectedTypesSignatures=null\n" + >- "expectedTypesKeys=null", >+ "expectedTypesSignatures={Ljava.lang.Object;}\n" + >+ "expectedTypesKeys={Ljava/lang/Object;}", > result.context); > > assertResults( >- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", >+ "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", > result.proposals); > } > public void test0006() throws JavaModelException { >@@ -209,12 +211,12 @@ > "Y<Ob"); > > assertResults( >- "expectedTypesSignatures=null\n" + >- "expectedTypesKeys=null", >+ "expectedTypesSignatures={Ljava.lang.Object;}\n" + >+ "expectedTypesKeys={Ljava/lang/Object;}", > result.context); > > assertResults( >- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) +"}", >+ "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) +"}", > result.proposals); > } > public void test0007() throws JavaModelException { >@@ -642,7 +644,7 @@ > cu.codeComplete(cursorLocation, requestor); > > assertEquals("should have one class", >- "element:String completion:String relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED), >+ "element:String completion:String relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED), > requestor.getResults()); > } > public void test0026() throws JavaModelException { >@@ -669,7 +671,7 @@ > this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( >- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", >+ "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > public void test0027() throws JavaModelException { >@@ -696,7 +698,7 @@ > this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( >- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", >+ "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", > requestor.getResults()); > > >@@ -786,7 +788,7 @@ > cu.codeComplete(cursorLocation, requestor); > > assertEquals("unexpected result", >- "element:String completion:String relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED), >+ "element:String completion:String relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED), > requestor.getResults()); > } > /* >@@ -802,7 +804,7 @@ > cu.codeComplete(cursorLocation, requestor); > > assertEquals("unexpected result", >- "element:String completion:String relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED), >+ "element:String completion:String relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED), > requestor.getResults()); > } > /* >@@ -920,12 +922,12 @@ > "Stri"); > > assertResults( >- "expectedTypesSignatures=null\n" + >- "expectedTypesKeys=null", >+ "expectedTypesSignatures={Ljava.lang.Object;}\n" + >+ "expectedTypesKeys={Ljava/lang/Object;}", > result.context); > > assertResults( >- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) +"}", >+ "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) +"}", > result.proposals); > } > /* >@@ -949,12 +951,12 @@ > "Stri"); > > assertResults( >- "expectedTypesSignatures=null\n" + >- "expectedTypesKeys=null", >+ "expectedTypesSignatures={Ljava.lang.Object;}\n" + >+ "expectedTypesKeys={Ljava/lang/Object;}", > result.context); > > assertResults( >- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) +"}", >+ "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) +"}", > result.proposals); > } > /* >@@ -6001,12 +6003,12 @@ > "ZZClass1<"); > > assertResults( >- "expectedTypesSignatures=null\n" + >- "expectedTypesKeys=null", >+ "expectedTypesSignatures={Ljava.lang.Object;}\n" + >+ "expectedTypesKeys={Ljava/lang/Object;}", > result.context); > > assertResults( >- "ZZClass1<X,Y>[TYPE_REF]{, test0192, Ltest0192.ZZClass1<TX;TY;>;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_UNQUALIFIED + + R_NON_RESTRICTED) + "}", >+ "ZZClass1<X,Y>[TYPE_REF]{, test0192, Ltest0192.ZZClass1<TX;TY;>;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_EXACT_NAME+ R_UNQUALIFIED + + R_NON_RESTRICTED) + "}", > result.proposals); > } > public void test0193() throws JavaModelException { >@@ -6023,12 +6025,12 @@ > "ZZClass1<"); > > assertResults( >- "expectedTypesSignatures=null\n" + >- "expectedTypesKeys=null", >+ "expectedTypesSignatures={Ljava.lang.Object;}\n" + >+ "expectedTypesKeys={Ljava/lang/Object;}", > result.context); > > assertResults( >- "ZZClass1<X,Y>[TYPE_REF]{, test0193, Ltest0193.ZZClass1<TX;TY;>;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + + R_NON_RESTRICTED) + "}", >+ "ZZClass1<X,Y>[TYPE_REF]{, test0193, Ltest0193.ZZClass1<TX;TY;>;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_EXACT_NAME + R_UNQUALIFIED + + R_NON_RESTRICTED) + "}", > result.proposals); > } > public void test0194() throws JavaModelException { >@@ -6043,12 +6045,12 @@ > "ZZClass1<Object,"); > > assertResults( >- "expectedTypesSignatures=null\n" + >- "expectedTypesKeys=null", >+ "expectedTypesSignatures={Ljava.lang.Object;}\n" + >+ "expectedTypesKeys={Ljava/lang/Object;}", > result.context); > > assertResults( >- "ZZClass1<X,Y>[TYPE_REF]{, test0194, Ltest0194.ZZClass1<TX;TY;>;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_UNQUALIFIED + + R_NON_RESTRICTED) + "}", >+ "ZZClass1<X,Y>[TYPE_REF]{, test0194, Ltest0194.ZZClass1<TX;TY;>;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_EXACT_NAME+ R_UNQUALIFIED + + R_NON_RESTRICTED) + "}", > result.proposals); > } > public void test0195() throws JavaModelException { >@@ -6065,12 +6067,12 @@ > "ZZClass1<Object,"); > > assertResults( >- "expectedTypesSignatures=null\n" + >- "expectedTypesKeys=null", >+ "expectedTypesSignatures={Ljava.lang.Object;}\n" + >+ "expectedTypesKeys={Ljava/lang/Object;}", > result.context); > > assertResults( >- "ZZClass1<X,Y>[TYPE_REF]{, test0195, Ltest0195.ZZClass1<TX;TY;>;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + + R_NON_RESTRICTED) + "}", >+ "ZZClass1<X,Y>[TYPE_REF]{, test0195, Ltest0195.ZZClass1<TX;TY;>;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_EXACT_NAME + R_UNQUALIFIED + + R_NON_RESTRICTED) + "}", > result.proposals); > } > public void test0196() throws JavaModelException { >@@ -8162,4 +8164,36 @@ > "foo[METHOD_DECLARATION]{public <T> void foo(), Ltest.SuperTest;, <T:Ljava.lang.Object;>()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_METHOD_OVERIDE + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } >+public void test0270() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[3]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/test/Test270_2.java", >+ "package test;\n"+ >+ "public class Test270_2 extends SuperTest<Test270> {\n"+ >+ "}"); >+ >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/test/SuperTest.java", >+ "package test;\n"+ >+ "public class SuperTest<T> {\n"+ >+ "}"); >+ >+ this.workingCopies[2] = getWorkingCopy( >+ "/Completion/src/test/Test270.java", >+ "package test;\n"+ >+ "public class Test270 {\n"+ >+ "}"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "Test270"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "Test270_2[TYPE_REF]{Test270_2, test, Ltest.Test270_2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" + >+ "Test270[TYPE_REF]{Test270, test, Ltest.Test270;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_EXACT_NAME + 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 134976
: 37731