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 152929 Details for
Bug 295894
[search] Search shows focus type implementation for nested types even though the scope is restricted to subtypes.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Tests showing the problem
v00.txt (text/plain), 5.00 KB, created by
Frederic Fusier
on 2009-11-24 04:43:47 EST
(
hide
)
Description:
Tests showing the problem
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2009-11-24 04:43:47 EST
Size:
5.00 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.181 >diff -u -r1.181 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 23 Nov 2009 15:41:54 -0000 1.181 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 24 Nov 2009 09:43:45 -0000 >@@ -11029,4 +11029,147 @@ > deleteProject("P"); > } > } >+ >+static { TESTS_PREFIX = "testBug295894"; } >+/** >+ * @bug 295894: SourceField.getConstant does not supply a value if type is fully qualified >+ * @test Ensure that source field constant is not null when fully qualified type String is used >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=295894" >+ */ >+public void testBug295894() throws Exception { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "public class Test {\n" + >+ " void test() {\n" + >+ " Test t = new Test();\n" + >+ " t.foo();\n" + >+ " }\n" + >+ " public void foo() {\n" + >+ " }\n" + >+ " public class Sub extends Test {\n" + >+ " public void foo() {}\n" + >+ " }\n" + >+ "}\n" + >+ "" >+ ); >+ search( >+ "foo", >+ METHOD, >+ DECLARATIONS, >+ SearchEngine.createHierarchyScope(this.workingCopies[0].findPrimaryType()), >+ this.resultCollector); >+ assertSearchResults( >+ "src/Test.java void Test.foo() [foo] EXACT_MATCH\n" + >+ "src/Test.java void Test$Sub.foo() [foo] EXACT_MATCH" >+ ); >+} >+public void testBug295894a() throws Exception { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "public class Test {\n" + >+ " void test() {\n" + >+ " Test t = new Test();\n" + >+ " t.foo();\n" + >+ " }\n" + >+ " public void foo() {\n" + >+ " }\n" + >+ " public class Sub extends Test {\n" + >+ " public void foo() {}\n" + >+ " }\n" + >+ "}\n" + >+ "" >+ ); >+ search( >+ "foo", >+ METHOD, >+ DECLARATIONS, >+ SearchEngine.createHierarchyScope(null, this.workingCopies[0].findPrimaryType(), true, true, null), >+ this.resultCollector); >+ // No results expected as only sub-types and no member types are set... >+ assertSearchResults( >+ "" >+ ); >+} >+public void testBug295894b() throws Exception { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "public class Test {\n" + >+ " void test() {\n" + >+ " Test t = new Test();\n" + >+ " t.foo();\n" + >+ " }\n" + >+ " public void foo() {\n" + >+ " }\n" + >+ " public class Sub extends Test {\n" + >+ " public void foo() {}\n" + >+ " }\n" + >+ "}\n" + >+ "" >+ ); >+ search( >+ "foo", >+ METHOD, >+ DECLARATIONS, >+ SearchEngine.createHierarchyScope(null, this.workingCopies[0].findPrimaryType(), false, false, null), >+ this.resultCollector); >+ // Same results as the default >+ assertSearchResults( >+ "src/Test.java void Test.foo() [foo] EXACT_MATCH\n" + >+ "src/Test.java void Test$Sub.foo() [foo] EXACT_MATCH" >+ ); >+} >+public void testBug295894c() throws Exception { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "public class Test {\n" + >+ " void test() {\n" + >+ " Test t = new Test();\n" + >+ " t.foo();\n" + >+ " }\n" + >+ " public void foo() {\n" + >+ " }\n" + >+ " public class Sub extends Test {\n" + >+ " public void foo() {}\n" + >+ " }\n" + >+ "}\n" + >+ "" >+ ); >+ search( >+ "foo", >+ METHOD, >+ DECLARATIONS, >+ SearchEngine.createHierarchyScope(null, this.workingCopies[0].findPrimaryType(), false, true, null), >+ this.resultCollector); >+ // Results in member types are filtered >+ assertSearchResults( >+ "src/Test.java void Test.foo() [foo] EXACT_MATCH" >+ ); >+} >+public void testBug295894d() throws Exception { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", >+ "public class Test {\n" + >+ " void test() {\n" + >+ " Test t = new Test();\n" + >+ " t.foo();\n" + >+ " }\n" + >+ " public void foo() {\n" + >+ " }\n" + >+ " public class Sub extends Test {\n" + >+ " public void foo() {}\n" + >+ " }\n" + >+ "}\n" + >+ "" >+ ); >+ search( >+ "foo", >+ METHOD, >+ DECLARATIONS, >+ SearchEngine.createHierarchyScope(null, this.workingCopies[0].findPrimaryType(), true, false, null), >+ this.resultCollector); >+ // Only results in sub-types are returned >+ assertSearchResults( >+ "src/Test.java void Test$Sub.foo() [foo] EXACT_MATCH" >+ ); >+} > } >\ No newline at end of file
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 295894
: 152929 |
152945
|
153058
|
153865
|
153938
|
155994
|
156008
|
156074
|
156084
|
156088
|
156091
|
156098