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 173414 Details for
Bug 151500
[assist] Method parameter names are not displayed for inner classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
fix + updated tests
patch151500.txt (text/plain), 10.43 KB, created by
Ayushman Jain
on 2010-07-05 08:06:15 EDT
(
hide
)
Description:
fix + updated tests
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2010-07-05 08:06:15 EDT
Size:
10.43 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java,v >retrieving revision 1.15 >diff -u -r1.15 InternalCompletionProposal.java >--- codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java 28 Jun 2010 13:07:11 -0000 1.15 >+++ codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java 5 Jul 2010 12:03:46 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2009 IBM Corporation and others. >+ * Copyright (c) 2004, 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 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Andreas Magnusson <andreas.ch.magnusson@gmail.com>- contribution for bug 151500 > *******************************************************************************/ > package org.eclipse.jdt.internal.codeassist; > >@@ -194,7 +195,8 @@ > } > } else { > // TODO (david) shouldn't it be NameLookup.ACCEPT_ALL ? >- NameLookup.Answer answer = this.nameLookup.findType(new String(tName), >+ NameLookup.Answer answer = this.nameLookup.findType(new String(declaringTypeName), >+ new String(declaringTypePackageName), > false, > NameLookup.ACCEPT_CLASSES & NameLookup.ACCEPT_INTERFACES, > true/* consider secondary types */, >@@ -249,6 +251,7 @@ > char[][] argumentNames = info.getArgumentNames(); > if (argumentNames != null && argumentNames.length == length) { > parameters = argumentNames; >+ return parameters; > } > } catch(JavaModelException e){ > //parameters == null; >@@ -290,7 +293,8 @@ > } > } else { > // TODO (david) shouldn't it be NameLookup.ACCEPT_ALL ? >- NameLookup.Answer answer = this.nameLookup.findType(new String(tName), >+ NameLookup.Answer answer = this.nameLookup.findType(new String(declaringTypeName), >+ new String(declaringTypePackageName), > false, > NameLookup.ACCEPT_CLASSES & NameLookup.ACCEPT_INTERFACES, > true/* consider secondary types */, >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests2.java,v >retrieving revision 1.48 >diff -u -r1.48 CompletionTests2.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests2.java 9 Jul 2009 10:31:22 -0000 1.48 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests2.java 5 Jul 2010 12:03:59 -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 >@@ -18,6 +18,9 @@ > import java.util.Map; > import java.util.StringTokenizer; > >+import junit.framework.ComparisonFailure; >+import junit.framework.Test; >+ > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; >@@ -41,8 +44,6 @@ > import org.eclipse.jdt.internal.core.JavaModelManager; > import org.eclipse.jdt.internal.core.search.indexing.IndexManager; > >-import junit.framework.*; >- > public class CompletionTests2 extends ModifyingResourceTests implements RelevanceConstants { > > public static class CompletionContainerInitializer implements ContainerInitializer.ITestInitializer { >@@ -5284,4 +5285,181 @@ > deleteProject("P"); > } > } >+ >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=151500 >+public void testBug151500a() throws Exception { >+ try { >+ IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib151500.jar"}, "bin", "1.4"); >+ createJar( >+ new String[] { >+ "foo/Foo.java", >+ "package foo;\n" + >+ "public class Foo {\n"+ >+ " public Foo(int p1) {}\n"+ >+ " public Bar bar = new Bar(1,2);\n"+ >+ " public class Bar {\n" + >+ " int param1;\n" + >+ " int param2;\n" + >+ " public Bar (int a, int b) {\n" + >+ " param1 = a;\n" + >+ " param2 = b;\n" + >+ " }\n" + >+ " public void someMethod(String paramName) {}\n"+ >+ " }\n"+ >+ "}" >+ }, >+ p.getProject().getLocation().append("lib151500.jar").toOSString(), >+ new String[]{getExternalJCLPathString("1.3")}, >+ "1.3"); >+ >+ refresh(p); >+ >+ waitUntilIndexesReady(); >+ >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/P/src/test/Test.java", >+ "package test;\n"+ >+ "public class Test {\n" + >+ " void m() {\n" + >+ " foo.Foo f = new Foo(1);\n" + >+ " f.bar.s\n" + >+ " }\n" + >+ "}"); >+ >+ // do completion >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); >+ requestor.allowAllRequiredProposals(); >+ NullProgressMonitor monitor = new NullProgressMonitor(); >+ >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "f.bar.s"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); >+ >+ assertResults( >+ "someMethod[METHOD_REF]{someMethod(), Lfoo.Foo$Bar;, (Ljava.lang.String;)V, someMethod, (paramName), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_NON_STATIC)+ "}", >+ requestor.getResults()); >+ } finally { >+ deleteProject("P"); >+ } >+} >+ >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=151500 >+public void testBug151500b() throws Exception { >+ try { >+ IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib151500.jar"}, "bin", "1.4"); >+ createJar( >+ new String[] { >+ "foo/Foo.java", >+ "package foo;\n" + >+ "public class Foo {\n"+ >+ " public Foo(int p1) {}\n"+ >+ " public Bar bar = new Bar(1,2);\n"+ >+ " public class Bar {\n" + >+ " int param1;\n" + >+ " int param2;\n" + >+ " public Bar (int a, int b) {\n" + >+ " param1 = a;\n" + >+ " param2 = b;\n" + >+ " }\n" + >+ " public void someMethod(String paramName) {}\n"+ >+ " }\n"+ >+ "}" >+ }, >+ p.getProject().getLocation().append("lib151500.jar").toOSString(), >+ new String[]{getExternalJCLPathString("1.3")}, >+ "1.3"); >+ >+ refresh(p); >+ >+ waitUntilIndexesReady(); >+ >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/P/src/test/Test.java", >+ "package test;\n"+ >+ "public class Test {\n" + >+ " void m() {\n" + >+ " new foo.Foo(1).new B;\n" + >+ " }\n" + >+ "}"); >+ >+ // do completion >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); >+ requestor.allowAllRequiredProposals(); >+ NullProgressMonitor monitor = new NullProgressMonitor(); >+ >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "new foo.Foo(1).new B"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); >+ >+ assertResults( >+ "Bar[CONSTRUCTOR_INVOCATION]{(), Lfoo.Foo$Bar;, (II)V, Bar, (a, b), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}\n" + >+ " Foo.Bar[TYPE_REF]{Bar, foo, Lfoo.Foo$Bar;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}", >+ requestor.getResults()); >+ } finally { >+ deleteProject("P"); >+ } >+} >+ >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=151500 >+public void testBug151500c() throws Exception { >+ try { >+ IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib151500.jar"}, "bin", "1.4"); >+ createJar( >+ new String[] { >+ "foo/Foo.java", >+ "package foo;\n" + >+ "public class Foo {\n"+ >+ " public Foo(int p1) {}\n"+ >+ " public Bar bar = new Bar(1,2);\n"+ >+ " public class Bar {\n" + >+ " int param1;\n" + >+ " int param2;\n" + >+ " public Bar (int a, int b) {\n" + >+ " param1 = a;\n" + >+ " param2 = b;\n" + >+ " }\n" + >+ " public void someMethod(String paramName) {}\n"+ >+ " }\n"+ >+ "}" >+ }, >+ p.getProject().getLocation().append("lib151500.jar").toOSString(), >+ new String[]{getExternalJCLPathString("1.3")}, >+ "1.3"); >+ >+ refresh(p); >+ >+ waitUntilIndexesReady(); >+ >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/P/src/test/Test.java", >+ "package test;\n"+ >+ "public class Test {\n" + >+ " void m() {\n" + >+ " new foo.Foo.B;\n" + >+ " }\n" + >+ "}"); >+ >+ // do completion >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); >+ requestor.allowAllRequiredProposals(); >+ NullProgressMonitor monitor = new NullProgressMonitor(); >+ >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "new foo.Foo.B"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); >+ >+ assertResults( >+ "Bar[CONSTRUCTOR_INVOCATION]{(), Lfoo.Foo$Bar;, (II)V, Bar, (a, b), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >+ " Foo.Bar[TYPE_REF]{Bar, foo, Lfoo.Foo$Bar;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+ } finally { >+ deleteProject("P"); >+ } >+} > }
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
Flags:
amj87.iitr
:
review+
Actions:
View
|
Diff
Attachments on
bug 151500
:
46672
|
46673
|
171895
|
173389
| 173414