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 162955 Details for
Bug 202634
[codeassist] missing super proposal in specific source
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed fix v1.0 + regression tests
patchSuper.txt (text/plain), 5.96 KB, created by
Ayushman Jain
on 2010-03-25 02:37:53 EDT
(
hide
)
Description:
proposed fix v1.0 + regression tests
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2010-03-25 02:37:53 EDT
Size:
5.96 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.210 >diff -u -r1.210 CompletionParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 18 Feb 2010 06:50:57 -0000 1.210 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 25 Mar 2010 06:24:31 -0000 >@@ -132,10 +132,6 @@ > // a pointer in the expression stack to the qualifier of a invocation > int qualifier; > >- // last modifiers info >- int lastModifiers = ClassFileConstants.AccDefault; >- int lastModifiersStart = -1; >- > // used to find if there is unused modifiers when building completion inside a method or an initializer > boolean hasUnusedModifiers; > >Index: codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java,v >retrieving revision 1.90 >diff -u -r1.90 AssistParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java 22 Jun 2009 14:00:52 -0000 1.90 >+++ codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java 25 Mar 2010 06:24:33 -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 >@@ -33,7 +33,9 @@ > public abstract class AssistParser extends Parser { > public ASTNode assistNode; > public boolean isOrphanCompletionNode; >- >+ // last modifiers info >+ protected int lastModifiers = ClassFileConstants.AccDefault; >+ protected int lastModifiersStart = -1; > /* recovery */ > int[] blockStarts = new int[30]; > >@@ -1392,7 +1394,11 @@ > return; > > initialize(); >- >+ // set the lastModifiers to reflect the modifiers of the method whose >+ // block statements are being parsed >+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=202634 >+ this.lastModifiers = md.modifiers; >+ this.lastModifiersStart = md.modifiersSourceStart; > // simulate goForMethodBody except that we don't want to balance brackets because they are not going to be balanced > goForBlockStatementsopt(); > >#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.211 >diff -u -r1.211 CompletionTests.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 18 Feb 2010 06:51:07 -0000 1.211 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 25 Mar 2010 06:25:13 -0000 >@@ -20766,4 +20766,64 @@ > "returnZero[METHOD_REF_WITH_CASTED_RECEIVER]{((CompletionAfterInstanceOf)a).returnZero(), Ltest.CompletionAfterInstanceOf;, ()I, Ltest.CompletionAfterInstanceOf;, returnZero, null, replace["+start2+", "+end2+"], token["+start1+", "+end1+"], receiver["+start3+", "+end3+"], " + (relevance1) + "}", > requestor.getResults()); > } >+ >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=202634 >+public void testBug202634a() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/test/Test.java", >+ "package test;\n" + >+ "public class Test {\n" + >+ " public static void bar(){" + >+ " System.out.println(\"bar\");\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " sup\n" + >+ " }\n" + >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, true, true); >+ requestor.allowAllRequiredProposals(); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "sup"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int start1 = str.lastIndexOf("sup"); >+ int end1 = start1 + "sup".length(); >+ >+ assertResults( >+ "super[KEYWORD]{super, null, null, super, null, replace[" + start1 + ", " + end1 +"], token[" + start1 + ", " + end1 + "], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE+ R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} >+ >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=202634 >+public void testBug202634b() 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" + >+ " sup\n" + >+ " }\n" + >+ " public static void bar(){" + >+ " System.out.println(\"bar\");\n" + >+ " }\n" + >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, true, true); >+ requestor.allowAllRequiredProposals(); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "sup"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int start1 = str.lastIndexOf("sup"); >+ int end1 = start1 + "sup".length(); >+ >+ assertResults( >+ "super[KEYWORD]{super, null, null, super, null, replace[" + start1 + ", " + end1 +"], token[" + start1 + ", " + end1 + "], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE+ R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} > }
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 202634
:
162955
|
163270