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 53912 Details for
Bug 99928
ContentAssist should propose methods of intersection types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug99928_002.txt (text/plain), 6.91 KB, created by
David Audel
on 2006-11-15 10:05:21 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-11-15 10:05:21 EST
Size:
6.91 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.308 >diff -u -r1.308 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 6 Nov 2006 16:48:04 -0000 1.308 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 15 Nov 2006 14:58:58 -0000 >@@ -5243,13 +5243,23 @@ > } > } > >- if (notInJavadoc && hasPotentialDefaultAbstractMethods && (currentType.isAbstract() || currentType.isTypeVariable())){ >+ if (notInJavadoc && >+ hasPotentialDefaultAbstractMethods && >+ (currentType.isAbstract() || currentType.isTypeVariable() || currentType.isIntersectionType())){ >+ >+ ReferenceBinding[] superInterfaces = currentType.superInterfaces(); >+ if (superInterfaces != null && currentType.isIntersectionType()) { >+ for (int i = 0; i < superInterfaces.length; i++) { >+ superInterfaces[i] = (ReferenceBinding)superInterfaces[i].capture(invocationScope, invocationSite.sourceEnd()); >+ } >+ } >+ > findInterfacesMethods( > selector, > typeArgTypes, > argTypes, > receiverType, >- currentType.superInterfaces(), >+ superInterfaces, > scope, > methodsFound, > onlyStaticMethods, >#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.75 >diff -u -r1.75 CompletionTests_1_5.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 19 Oct 2006 16:18:13 -0000 1.75 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 15 Nov 2006 14:59:07 -0000 >@@ -9180,7 +9180,7 @@ > "public class Test1<TTest1> {\n" + > "}"); > >- this.workingCopies[1] = getWorkingCopy( >+ this.workingCopies[2] = getWorkingCopy( > "/Completion/src3/test/Test2.java", > "package test;\n" + > "public class Test2 {\n" + >@@ -9196,6 +9196,118 @@ > "Test2[TYPE_REF]{Test2, test, Ltest.Test2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=99928 >+public void test0295() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[5]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src3/test/Test.java", >+ "package test;\n" + >+ "public class Test {\n" + >+ " void test(StringTest s, IntegerTest i) {\n" + >+ " combine(s, i).compareTo(null);\n" + >+ " }\n" + >+ " \n" + >+ " <T> T combine(T t1, T t2) {\n" + >+ " return null;\n" + >+ " }\n" + >+ "}"); >+ >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src3/test/StringTest.java", >+ "package test;\n" + >+ "public class StringTest implements ComparableTest<StringTest>, SerializableTest {\n" + >+ " public int compareTo(StringTest s) {\n" + >+ " return 0;\n" + >+ " }\n" + >+ "}"); >+ >+ this.workingCopies[2] = getWorkingCopy( >+ "/Completion/src3/test/IntegerTest.java", >+ "package test;\n" + >+ "public class IntegerTest implements ComparableTest<IntegerTest>, SerializableTest {\n" + >+ " public int compareTo(IntegerTest i) {\n" + >+ " return 0;\n" + >+ " }\n" + >+ "}"); >+ >+ this.workingCopies[3] = getWorkingCopy( >+ "/Completion/src3/test/ComparableTest.java", >+ "package test;\n" + >+ "public interface ComparableTest<T> {\n" + >+ " public int compareTo(T t) ;\n" + >+ "}"); >+ >+ this.workingCopies[4] = getWorkingCopy( >+ "/Completion/src3/test/SerializableTest.java", >+ "package test;\n" + >+ "public interface SerializableTest {\n" + >+ "}"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "compare"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "compareTo[METHOD_REF]{compareTo, Ltest.ComparableTest<!*>;, (!*)I, compareTo, (t), " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=99928 >+public void test0296() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[5]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src3/test/Test.java", >+ "package test;\n" + >+ "public class Test {\n" + >+ " public static void main(String[] args) {\n" + >+ " IntegerTest foo = null;\n" + >+ " StringTest bar = null;\n" + >+ " System.out.println((foo != null ? foo : bar).compare\n" + >+ " }\n" + >+ "}"); >+ >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src3/test/StringTest.java", >+ "package test;\n" + >+ "public class StringTest implements ComparableTest<StringTest>, SerializableTest {\n" + >+ " public int compareTo(StringTest s) {\n" + >+ " return 0;\n" + >+ " }\n" + >+ "}"); >+ >+ this.workingCopies[2] = getWorkingCopy( >+ "/Completion/src3/test/IntegerTest.java", >+ "package test;\n" + >+ "public class IntegerTest implements ComparableTest<IntegerTest>, SerializableTest {\n" + >+ " public int compareTo(IntegerTest i) {\n" + >+ " return 0;\n" + >+ " }\n" + >+ "}"); >+ >+ this.workingCopies[3] = getWorkingCopy( >+ "/Completion/src3/test/ComparableTest.java", >+ "package test;\n" + >+ "public interface ComparableTest<T> {\n" + >+ " public int compareTo(T t) ;\n" + >+ "}"); >+ >+ this.workingCopies[4] = getWorkingCopy( >+ "/Completion/src3/test/SerializableTest.java", >+ "package test;\n" + >+ "public interface SerializableTest {\n" + >+ "}"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "compare"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "compareTo[METHOD_REF]{compareTo(), Ltest.ComparableTest<!*>;, (!*)I, compareTo, (t), " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=153130 > public void testEC001() throws JavaModelException { > this.workingCopies = new ICompilationUnit[1];
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 99928
: 53912