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 159212 Details for
Bug 302865
Issue with "import" a class and "import static" a method with the same name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Add regression test
patch_302865.txt (text/plain), 8.09 KB, created by
Olivier Thomann
on 2010-02-16 11:36:40 EST
(
hide
)
Description:
Add regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-02-16 11:36:40 EST
Size:
8.09 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java,v >retrieving revision 1.77 >diff -u -r1.77 StaticImportTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java 13 Jan 2010 16:35:57 -0000 1.77 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java 16 Feb 2010 16:36:10 -0000 >@@ -18,7 +18,7 @@ > // All specified tests which do not belong to the class are skipped... > static { > // TESTS_NAMES = new String[] { "test036" }; >-// TESTS_NUMBERS = new int[] { 46 }; >+// TESTS_NUMBERS = new int[] { 75 }; > // TESTS_RANGE = new int[] { 169, 180 }; > } > >@@ -489,43 +489,43 @@ > "}\n", > }, > "----------\n" + >- "1. ERROR in X.java (at line 6)\r\n" + >- " import static p.Y.Zz;\r\n" + >+ "1. ERROR in X.java (at line 6)\n" + >+ " import static p.Y.Zz;\n" + > " ^^^^^^\n" + > "The import p.Y.Zz cannot be resolved\n" + > "----------\n" + >- "2. ERROR in X.java (at line 7)\r\n" + >- " import static p.Z.Zz.WW.*;\r\n" + >+ "2. ERROR in X.java (at line 7)\n" + >+ " import static p.Z.Zz.WW.*;\n" + > " ^^^^^^^^^\n" + > "The import p.Z.Zz.WW cannot be resolved\n" + > "----------\n" + >- "3. ERROR in X.java (at line 8)\r\n" + >- " import p.Y.ZZ;\r\n" + >+ "3. ERROR in X.java (at line 8)\n" + >+ " import p.Y.ZZ;\n" + > " ^^^^^^\n" + > "The import p.Y.ZZ cannot be resolved\n" + > "----------\n" + >- "4. ERROR in X.java (at line 9)\r\n" + >- " import static p.Y.ZZ.*;\r\n" + >+ "4. ERROR in X.java (at line 9)\n" + >+ " import static p.Y.ZZ.*;\n" + > " ^^^^^^\n" + > "The import p.Y.ZZ cannot be resolved\n" + > "----------\n" + >- "5. ERROR in X.java (at line 10)\r\n" + >- " import static p.Y.ZZ.WW;\r\n" + >+ "5. ERROR in X.java (at line 10)\n" + >+ " import static p.Y.ZZ.WW;\n" + > " ^^^^^^\n" + > "The import p.Y.ZZ cannot be resolved\n" + > "----------\n" + >- "6. ERROR in X.java (at line 11)\r\n" + >- " import static p.Y.ZZ.WW.*;\r\n" + >+ "6. ERROR in X.java (at line 11)\n" + >+ " import static p.Y.ZZ.WW.*;\n" + > " ^^^^^^\n" + > "The import p.Y.ZZ cannot be resolved\n" + > "----------\n" + >- "7. ERROR in X.java (at line 12)\r\n" + >- " import static p.Y.ZZ.ZZZ;\r\n" + >+ "7. ERROR in X.java (at line 12)\n" + >+ " import static p.Y.ZZ.ZZZ;\n" + > " ^^^^^^\n" + > "The import p.Y.ZZ cannot be resolved\n" + > "----------\n" + >- "8. ERROR in X.java (at line 13)\r\n" + >- " import static p.Y.ZZ.WW.WWW;\r\n" + >+ "8. ERROR in X.java (at line 13)\n" + >+ " import static p.Y.ZZ.WW.WWW;\n" + > " ^^^^^^\n" + > "The import p.Y.ZZ cannot be resolved\n" + > "----------\n" >@@ -590,8 +590,8 @@ > "public class X {}\n" > }, > "----------\n" + >- "1. ERROR in X.java (at line 1)\r\n" + >- " import static java.lang.*;\r\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " import static java.lang.*;\n" + > " ^^^^^^^^^\n" + > "Only a type can be imported. java.lang resolves to a package\n" + > "----------\n" >@@ -887,8 +887,8 @@ > "public class C { public static void m() {} }\n" > }, > "----------\n" + >- "1. ERROR in p\\B.java (at line 5)\r\n" + >- " public class B { public static void main(String[] args) { m(); } }\r\n" + >+ "1. ERROR in p\\B.java (at line 5)\n" + >+ " public class B { public static void main(String[] args) { m(); } }\n" + > " ^\n" + > "The method m() is ambiguous for the type B\n" + > "----------\n" >@@ -1154,8 +1154,8 @@ > "}\n" > }, > "----------\n" + >- "1. ERROR in X2.java (at line 3)\r\n" + >- " public class X2 { void test() {foo();} }\r\n" + >+ "1. ERROR in X2.java (at line 3)\n" + >+ " public class X2 { void test() {foo();} }\n" + > " ^^^\n" + > "The method foo() is ambiguous for the type X2\n" + > "----------\n" >@@ -1313,8 +1313,8 @@ > "}\n" > }, > "----------\n" + >- "1. ERROR in C.java (at line 6)\r\n" + >- " void test() { foo(1); }\r\n" + >+ "1. ERROR in C.java (at line 6)\n" + >+ " void test() { foo(1); }\n" + > " ^^^\n" + > "The method foo(Object, String) in the type A.B is not applicable for the arguments (int)\n" + > "----------\n"); >@@ -1464,18 +1464,18 @@ > "class B { public static int foo_B() { return 2;} }", > }, > "----------\n" + >- "1. ERROR in X.java (at line 1)\r\n" + >- " import static p.A.foo_I;\r\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " import static p.A.foo_I;\n" + > " ^^^^^^^^^\n" + > "The import p.A.foo_I cannot be resolved\n" + > "----------\n" + >- "2. ERROR in X.java (at line 4)\r\n" + >- " static int i = p.A.foo_I();\r\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " static int i = p.A.foo_I();\n" + > " ^^^^^^^^^^^\n" + > "Cannot make a static reference to the non-static method foo_I() from the type I\n" + > "----------\n" + >- "3. ERROR in X.java (at line 6)\r\n" + >- " static int m = foo_I();\r\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " static int m = foo_I();\n" + > " ^^^^^\n" + > "The method foo_I() is undefined for the type X\n" + > "----------\n"); >@@ -1567,8 +1567,8 @@ > "}\n", > }, > "----------\n" + >- "1. ERROR in ImportTest.java (at line 4)\r\n" + >- " static void printArgs(Object... args) { toString2(args); }\r\n" + >+ "1. ERROR in ImportTest.java (at line 4)\n" + >+ " static void printArgs(Object... args) { toString2(args); }\n" + > " ^^^^^^^^^\n" + > "The method toString2() in the type SuperTest is not applicable for the arguments (Object[])\n" + > "----------\n" >@@ -1715,8 +1715,8 @@ > "public class Three extends Two { public static void test(String s) { arrayList(s); } }\n", > }, > "----------\n" + >- "1. ERROR in test\\Three.java (at line 3)\r\n" + >- " public class Three extends Two { public static void test(String s) { arrayList(s); } }\r\n" + >+ "1. ERROR in test\\Three.java (at line 3)\n" + >+ " public class Three extends Two { public static void test(String s) { arrayList(s); } }\n" + > " ^^^^^^^^^\n" + > "The method arrayList(int) in the type Two is not applicable for the arguments (String)\n" + > "----------\n" >@@ -2221,8 +2221,8 @@ > "}\n", > }, > "----------\n" + >- "1. ERROR in p\\X.java (at line 2)\r\n" + >- " import static q.A.a;\r\n" + >+ "1. ERROR in p\\X.java (at line 2)\n" + >+ " import static q.A.a;\n" + > " ^^^^^\n" + > "The import q.A.a cannot be resolved\n" + > "----------\n"); >@@ -2358,8 +2358,8 @@ > "}", > }, > "----------\n" + >- "1. ERROR in X.java (at line 1)\r\n" + >- " import static p.I.E.C;\r\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " import static p.I.E.C;\n" + > " ^^^^^^^\n" + > "The import p.I.E.C cannot be resolved\n" + > "----------\n"); >@@ -2533,5 +2533,32 @@ > }, > ""); > } >+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=302865 >+ public void test075() { >+ this.runConformTest( >+ new String[] { >+ "p/A.java", >+ "package p;\n" + >+ "import p2.B.C1;\n" + >+ "import static p2.B.C1;\n" + >+ "public abstract class A {\n" + >+ " protected void A1(Object task) {\n" + >+ " C1 c = C1(task);\n" + >+ " }\n" + >+ "}\n" + >+ "", >+ "p2/B.java", >+ "package p2;\n" + >+ "final public class B {\n" + >+ " private B() {}\n" + >+ " public static class C1 {\n" + >+ " }\n" + >+ " public static C1 C1(Object v0) {\n" + >+ " return new C1();\n" + >+ " }\n" + >+ "}" >+ }, >+ ""); >+ } > } >
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 302865
:
159212
|
162986
|
164727
|
164880
|
164916
|
164951