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 72669 Details for
Bug 137452
Autocomplete adds "Void" instead of doing nothing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug137452_003.txt (text/plain), 3.81 KB, created by
David Audel
on 2007-06-28 06:12:16 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2007-06-28 06:12:16 EDT
Size:
3.81 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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.161 >diff -u -r1.161 CompletionTests.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 27 Jun 2007 15:30:00 -0000 1.161 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 28 Jun 2007 10:12:20 -0000 >@@ -12839,6 +12839,37 @@ > "", > requestor.getResults()); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=137452 >+public void testCompletionVariableName39() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/test/Test.java", >+ "package test;\n"+ >+ "public class AutoCompleteBug {\n"+ >+ " interface I {\n"+ >+ " void doIt();\n"+ >+ " }\n"+ >+ " class C1 implements I {\n"+ >+ " public void doIt() {\n"+ >+ " }\n"+ >+ " }\n"+ >+ " class C2 extends C1 {\n"+ >+ " /*here*/public void doIt() {\n"+ >+ " super.doIt();\n"+ >+ " }\n"+ >+ " }\n"+ >+ "}"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "/*here*/public void doIt"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "", >+ requestor.getResults()); >+} > public void testCompletionVariableName4() throws JavaModelException { > this.wc = getWorkingCopy( > "/Completion/src/CompletionVariableName4.java", >#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.335 >diff -u -r1.335 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 27 Jun 2007 15:17:25 -0000 1.335 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 28 Jun 2007 10:12:24 -0000 >@@ -7580,32 +7580,26 @@ > } > > private void findVariableNames(char[] name, TypeReference type , char[][] discouragedNames, char[][] forbiddenNames, int kind, int modifiers){ >- > if(type != null && >- type.resolvedType != null && >- type.resolvedType.problemId() == ProblemReasons.NoError){ >+ type.resolvedType != null) { > TypeBinding tb = type.resolvedType; >- findVariableName( >- name, >- tb.leafComponentType().qualifiedPackageName(), >- tb.leafComponentType().qualifiedSourceName(), >- tb.leafComponentType().sourceName(), >- tb, >- discouragedNames, >- forbiddenNames, >- type.dimensions(), >- kind, >- modifiers); >- }/* else { >- char[][] typeName = type.getTypeName(); >- findVariableName( >- name, >- NoChar, >- CharOperation.concatWith(typeName, '.'), >- typeName[typeName.length - 1], >- excludeNames, >- type.dimensions()); >- }*/ >+ >+ if (tb.problemId() == ProblemReasons.NoError && >+ tb != Scope.getBaseType(VOID)) { >+ findVariableName( >+ name, >+ tb.leafComponentType().qualifiedPackageName(), >+ tb.leafComponentType().qualifiedSourceName(), >+ tb.leafComponentType().sourceName(), >+ tb, >+ discouragedNames, >+ forbiddenNames, >+ type.dimensions(), >+ kind, >+ modifiers); >+ } >+ } >+ > } > > private ImportBinding[] getFavoriteReferenceBindings(Scope scope) {
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 137452
: 72669