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 86183 Details for
Bug 211881
[assist] Code assist fails inside an if statement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug211881_002.txt (text/plain), 5.72 KB, created by
David Audel
on 2008-01-04 07:27:49 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2008-01-04 07:27:49 EST
Size:
5.72 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java,v >retrieving revision 1.184 >diff -u -r1.184 CompletionParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 4 Jan 2008 11:15:57 -0000 1.184 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 4 Jan 2008 12:27:18 -0000 >@@ -3075,6 +3075,7 @@ > pushOnElementStack(K_BETWEEN_CATCH_AND_RIGHT_PAREN); > break; > case TokenNameLPAREN: >+ this.bracketDepth++; > if (this.invocationType == NO_RECEIVER || this.invocationType == NAME_RECEIVER || this.invocationType == SUPER_RECEIVER) { > this.qualifier = this.expressionPtr; // remenber the last expression so that arguments are correctly computed > } >@@ -3200,6 +3201,7 @@ > this.bracketDepth--; > break; > case TokenNameRPAREN: >+ this.bracketDepth--; > switch(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER)) { > case K_BETWEEN_CATCH_AND_RIGHT_PAREN : > popElement(K_BETWEEN_CATCH_AND_RIGHT_PAREN); >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java,v >retrieving revision 1.30 >diff -u -r1.30 CompletionParserTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java 6 Mar 2007 04:42:13 -0000 1.30 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java 4 Jan 2008 12:27:21 -0000 >@@ -1782,7 +1782,7 @@ > " public FA() {\n" + > " }\n" + > " public float foo() {\n" + >- " return <CompleteOnName:f>;\n" + >+ " <CompleteOnName:f>;\n" + > " }\n" + > "}\n"; > >Index: src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java,v >retrieving revision 1.17 >diff -u -r1.17 FieldAccessCompletionTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java 25 Oct 2007 11:06:13 -0000 1.17 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java 4 Jan 2008 12:27:21 -0000 >@@ -494,7 +494,7 @@ > " Bar() {\n" + > " }\n" + > " Bar foo() {\n" + >- " return <CompleteOnMemberAccess:fred().x>;\n" + >+ " <CompleteOnMemberAccess:fred().x>;\n" + > " }\n" + > "}\n", > // expectedCompletionIdentifier: >#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.171 >diff -u -r1.171 CompletionTests.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 5 Dec 2007 10:03:22 -0000 1.171 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 4 Jan 2008 12:27:27 -0000 >@@ -1435,6 +1435,58 @@ > } > } > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=211881 >+public void testCompletionAfterIf1() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/test/Test.java", >+ "package test;\n" + >+ "public class Test {\n" + >+ " void foo(){\n" + >+ " if ((unknown).equals(null)) ;\n" + >+ " int superType = 0;\n" + >+ " superTyp\n" + >+ " }\n" + >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "superTyp"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "superType[LOCAL_VARIABLE_REF]{superType, null, I, superType, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=213031 >+public void testCompletionAfterIf2() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/test/Test.java", >+ "package test;\n" + >+ "public class Test {\n" + >+ " void foo(Object parent){\n" + >+ " /**/eq\n" + >+ " new Object() {\n" + >+ " void bar() {\n" + >+ " if (((Object) parent).equals(parent)) {\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "/**/eq"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "equals[METHOD_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} > public void testCompletionAfterCase1() throws JavaModelException { > this.workingCopies = new ICompilationUnit[1]; > this.workingCopies[0] = getWorkingCopy(
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 211881
: 86183