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 160811 Details for
Bug 204100
[assist] getDeclarationSignature() returns different results for the same kind of proposals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed fix v0.5 + regression tests
patchStaticImport.txt (text/plain), 5.48 KB, created by
Ayushman Jain
on 2010-03-03 12:30:42 EST
(
hide
)
Description:
proposed fix v0.5 + regression tests
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2010-03-03 12:30:42 EST
Size:
5.48 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.410 >diff -u -r1.410 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 7 Jan 2010 20:18:50 -0000 1.410 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 3 Mar 2010 17:23:40 -0000 >@@ -7449,6 +7449,7 @@ > } > > private void findImportsOfStaticFields(char[] fieldName, ReferenceBinding ref) { >+ ref = (ReferenceBinding) ref.erasure(); > FieldBinding[] fields = ref.availableFields(); > > int fieldLength = fieldName.length; >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java,v >retrieving revision 1.118 >diff -u -r1.118 CompletionTests_1_5.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 9 Jul 2009 10:47:24 -0000 1.118 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 3 Mar 2010 17:23:48 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -24,7 +24,7 @@ > > public class CompletionTests_1_5 extends AbstractJavaModelCompletionTests { > static { >-// TESTS_NAMES = new String[]{"test0040"}; >+// TESTS_NAMES = new String[]{"testBug204100"}; > } > public CompletionTests_1_5(String name) { > super(name); >@@ -13790,5 +13790,90 @@ > (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=204100 >+// To verify that the declaration signature for a proposal in >+// static import is the generic signature >+public void testBug204100a() throws JavaModelException { >+ this.oldOptions = JavaCore.getOptions(); >+ try { >+ Hashtable options = new Hashtable(this.oldOptions); >+ options.put(JavaCore.CODEASSIST_SUGGEST_STATIC_IMPORTS, JavaCore.ENABLED); >+ JavaCore.setOptions(options); >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src3/test/pack/AClass.java", >+ "package test.pack;\n"+ >+ "public class AClass <T> {\n" + >+ " public static int zork;\n" + >+ "}\n"); >+ >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src3/test/Test.java", >+ "package test;\n" + >+ "import static test.pack.AClass.;\n" + >+ "public class Test {\n" + >+ " public void bar() {\n" + >+ " }\n" + >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ requestor.allowAllRequiredProposals(); >+ String str = this.workingCopies[1].getSource(); >+ String completeBehind = "test.pack.AClass."; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[1].codeComplete(cursorLocation, requestor, this.wcOwner); >+ assertResults( >+ "zork[FIELD_REF]{zork;, Ltest.pack.AClass<TT;>;, I, zork, null, " + >+ (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+ } >+ finally { >+ JavaCore.setOptions(this.oldOptions); >+ } >+} >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=204100 >+// To verify that the declaration signature for a proposal in >+// static import is the generic signature >+public void testBug204100b() throws JavaModelException { >+ this.oldOptions = JavaCore.getOptions(); >+ try { >+ Hashtable options = new Hashtable(this.oldOptions); >+ options.put(JavaCore.CODEASSIST_SUGGEST_STATIC_IMPORTS, JavaCore.ENABLED); >+ JavaCore.setOptions(options); >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src3/test/pack/AClass.java", >+ "package test.pack;\n" + >+ "class ABC {\n" + >+ " int aField;\n" + >+ "}\n"+ >+ "public class AClass <T> {\n" + >+ " public static ABC abc;\n" + >+ "}\n"); >+ >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src3/test/Test.java", >+ "package test;\n" + >+ "import static test.pack.AClass.;\n" + >+ "public class Test {\n" + >+ " public void bar() {\n" + >+ " }\n" + >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ requestor.allowAllRequiredProposals(); >+ String str = this.workingCopies[1].getSource(); >+ String completeBehind = "test.pack.AClass."; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[1].codeComplete(cursorLocation, requestor, this.wcOwner); >+ assertResults( >+ "abc[FIELD_REF]{abc;, Ltest.pack.AClass<TT;>;, Ltest.pack.ABC;, abc, null, " + >+ (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+ } >+ finally { >+ JavaCore.setOptions(this.oldOptions); >+ } >+} > > }
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 204100
:
160811
|
160913