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 55129 Details for
Bug 164792
CodeAssist should treat #clone() special in 1.5 mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug164792_001.txt (text/plain), 6.01 KB, created by
David Audel
on 2006-12-06 09:23:52 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-12-06 09:23:52 EST
Size:
6.01 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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.77 >diff -u -r1.77 CompletionTests_1_5.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 20 Nov 2006 10:49:51 -0000 1.77 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 6 Dec 2006 14:20:10 -0000 >@@ -9337,6 +9337,62 @@ > "", > requestor.getResults()); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164792 >+public void test0298() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src3/test/Test.java", >+ "package test;\n" + >+ "public class Test {\n" + >+ " public void method(ZZZ[] z) {\n" + >+ " ZZZ[] z2 = z.clon\n" + >+ " }\n" + >+ "}"); >+ >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src3/test/ZZZ.java", >+ "package test;\n" + >+ "public class ZZZ {\n" + >+ "}"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "clon"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "clone[METHOD_REF]{clone(), [Ltest.ZZZ;, ()[Ltest.ZZZ;, clone, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164792 >+public void test0299() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src3/test/Test.java", >+ "package test;\n" + >+ "public class Test {\n" + >+ " public void method(ZZZ z) {\n" + >+ " ZZZ z2 = z.clon\n" + >+ " }\n" + >+ "}"); >+ >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src3/test/ZZZ.java", >+ "package test;\n" + >+ "public class ZZZ {\n" + >+ "}"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "clon"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "clone[METHOD_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, " + (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]; >#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.311 >diff -u -r1.311 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 24 Nov 2006 01:32:03 -0000 1.311 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 6 Dec 2006 14:20:13 -0000 >@@ -2987,11 +2987,16 @@ > CompletionProposal proposal = this.createProposal(CompletionProposal.METHOD_REF, this.actualCompletionPosition); > proposal.setDeclarationSignature(getSignature(receiverType)); > proposal.setSignature( >- createMethodSignature( >- CharOperation.NO_CHAR_CHAR, >- CharOperation.NO_CHAR_CHAR, >- CharOperation.concatWith(JAVA_LANG, '.'), >- OBJECT)); >+ this.compilerOptions.sourceLevel > ClassFileConstants.JDK1_4 && receiverType.isArrayType() ? >+ createMethodSignature( >+ CharOperation.NO_CHAR_CHAR, >+ CharOperation.NO_CHAR_CHAR, >+ getSignature(receiverType)) : >+ createMethodSignature( >+ CharOperation.NO_CHAR_CHAR, >+ CharOperation.NO_CHAR_CHAR, >+ CharOperation.concatWith(JAVA_LANG, '.'), >+ OBJECT)); > //proposal.setOriginalSignature(null); > //proposal.setDeclarationPackageName(null); > //proposal.setDeclarationTypeName(null); >@@ -7233,6 +7238,21 @@ > } > > public static char[] createMethodSignature(char[][] parameterPackageNames, char[][] parameterTypeNames, char[] returnPackagename, char[] returnTypeName) { >+ char[] returnTypeSignature = >+ returnTypeName == null || returnTypeName.length == 0 >+ ? Signature.createCharArrayTypeSignature(VOID, true) >+ : Signature.createCharArrayTypeSignature( >+ CharOperation.concat( >+ returnPackagename, >+ CharOperation.replaceOnCopy(returnTypeName, '.', '$'), '.'), true); >+ >+ return createMethodSignature( >+ parameterPackageNames, >+ parameterTypeNames, >+ returnTypeSignature); >+ } >+ >+ public static char[] createMethodSignature(char[][] parameterPackageNames, char[][] parameterTypeNames, char[] returnTypeSignature) { > char[][] parameterTypeSignature = new char[parameterTypeNames.length][]; > for (int i = 0; i < parameterTypeSignature.length; i++) { > parameterTypeSignature[i] = >@@ -7241,14 +7261,6 @@ > parameterPackageNames[i], > CharOperation.replaceOnCopy(parameterTypeNames[i], '.', '$'), '.'), true); > } >- >- char[] returnTypeSignature = >- returnTypeName == null || returnTypeName.length == 0 >- ? Signature.createCharArrayTypeSignature(VOID, true) >- : Signature.createCharArrayTypeSignature( >- CharOperation.concat( >- returnPackagename, >- CharOperation.replaceOnCopy(returnTypeName, '.', '$'), '.'), true); > > return Signature.createMethodSignature( > parameterTypeSignature,
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 164792
: 55129