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 61839 Details for
Bug 178847
[search] Potential matches found when searching references to IJavaElement#getResource()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
178847_test.txt (text/plain), 4.45 KB, created by
Jerome Lanneluc
on 2007-03-23 11:40:00 EDT
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2007-03-23 11:40:00 EDT
Size:
4.45 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java,v >retrieving revision 1.103 >diff -u -r1.103 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 14 Mar 2007 08:18:39 -0000 1.103 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 23 Mar 2007 15:39:48 -0000 >@@ -15,6 +15,7 @@ > > import junit.framework.Test; > >+import org.eclipse.core.resources.IncrementalProjectBuilder; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.Path; >@@ -7858,4 +7859,57 @@ > // Should have same types with these 2 searches > assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString()); > } >+ >+/** >+ * @bug 178847 [search] Potential matches found when searching references to IJavaElement#getResource() >+ * @test Ensure that accurate matches are found >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=178847" >+ */ >+public void testBug178847() throws CoreException { >+ try { >+ createJavaProject("P1", new String[] {"src" }, "bin"); >+ createFolder("/P1/src/p"); >+ createFile( >+ "/P1/src/p/X.java", >+ "package p;\n" + >+ "public class X{\n" + >+ "}" >+ ); >+ createFile( >+ "/P1/src/p/Y.java", >+ "package p;\n" + >+ "public class Y extends X {\n" + >+ " public static void foo() {}\n" + >+ "}" >+ ); >+ getProject("P1").build(IncrementalProjectBuilder.FULL_BUILD, null); >+ deleteFile("/P1/bin/p/X.class"); >+ createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB", "/P1/bin"}, ""); >+ workingCopies = new ICompilationUnit[2]; >+ workingCopies[0] = getWorkingCopy("/P2/Test1.java", >+ "public class Test1 {\n" + >+ " void bar() {\n" + >+ " p.Y.foo();\n" + >+ " new p.X();\n" + // cause AbortCompilation here >+ " }\n" + >+ "}" >+ ); >+ workingCopies[1] = getWorkingCopy("/P2/Test2.java", >+ "public class Test2 {\n" + >+ " void foo() {}\n" + >+ " void bar() {\n" + >+ " foo();\n" + >+ " }\n" + >+ "}" >+ ); >+ IMethod method = workingCopies[1].getType("Test2").getMethod("foo", new String[0]); >+ search(method, REFERENCES, EXACT_RULE, SearchEngine.createWorkspaceScope(), resultCollector); >+ assertSearchResults( >+ "Test2.java void Test2.bar() [foo()] EXACT_MATCH" >+ ); >+ } finally { >+ deleteProjects(new String[] {"P1", "P2" }); >+ } >+} >+ > } >\ No newline at end of file >Index: src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java,v >retrieving revision 1.22 >diff -u -r1.22 AbstractJavaSearchTests.java >--- src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 17 Dec 2006 17:18:44 -0000 1.22 >+++ src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 23 Mar 2007 15:39:46 -0000 >@@ -31,7 +31,7 @@ > /** > * Abstract class for Java Search tests. > */ >-public class AbstractJavaSearchTests extends AbstractJavaModelTests implements IJavaSearchConstants { >+public class AbstractJavaSearchTests extends ModifyingResourceTests implements IJavaSearchConstants { > > public static List JAVA_SEARCH_SUITES = null; > protected static IJavaProject JAVA_PROJECT; >Index: src/org/eclipse/jdt/core/tests/model/ModifyingResourceTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModifyingResourceTests.java,v >retrieving revision 1.46 >diff -u -r1.46 ModifyingResourceTests.java >--- src/org/eclipse/jdt/core/tests/model/ModifyingResourceTests.java 19 Jan 2007 17:10:23 -0000 1.46 >+++ src/org/eclipse/jdt/core/tests/model/ModifyingResourceTests.java 23 Mar 2007 15:39:48 -0000 >@@ -25,6 +25,9 @@ > public ModifyingResourceTests(String name) { > super(name); > } >+public ModifyingResourceTests(String name, int tabs) { >+ super(name, tabs); >+} > protected void assertElementDescendants(String message, String expected, IJavaElement element) throws CoreException { > String actual = expandAll(element); > if (!expected.equals(actual)){
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 178847
:
61714
| 61839