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 13824 Details for
Bug 68927
'non-static access to static member' problem not reported for super field access
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Apply on HEAD
patch_jdt_core_tests_for_68927.txt (text/plain), 8.67 KB, created by
Olivier Thomann
on 2004-08-09 11:43:16 EDT
(
hide
)
Description:
Apply on HEAD
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2004-08-09 11:43:16 EDT
Size:
8.67 KB
patch
obsolete
>Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java >=================================================================== >RCS file: /data/cvs/eclipse/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java,v >retrieving revision 1.237 >diff -u -r1.237 NegativeTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 6 Aug 2004 17:21:08 -0000 1.237 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 9 Aug 2004 15:30:39 -0000 >@@ -8170,74 +8170,91 @@ > "}", > > }, >- "----------\n" + >- "1. ERROR in p\\r2\\A.java (at line 6)\n" + >- " static void foo() {p.r2.helper.B.x = 100;}\n" + >- " ^^^^^^^^^^^^^^^\n" + >- "The field p.r2.helper.B.x is not visible\n" + >- "----------\n" + >- "----------\n" + >- "1. ERROR in p\\r2\\CMain.java (at line 20)\n" + >- " p1.p2.i = 3;\n" + >- " ^^^^^^^\n" + >- "The type P2 is not visible\n" + >- "----------\n" + >- "2. ERROR in p\\r2\\CMain.java (at line 21)\n" + >- " System.out.println(p1.p2.i);\n" + >- " ^^^^^^^\n" + >- "The type P2 is not visible\n" + >- "----------\n" + >- "----------\n" + >- "1. ERROR in p\\r2\\Point.java (at line 10)\n" + >- " if (a.z > 0) a.delta(this);\n" + >- " ^^^\n" + >- "The field a.z is not visible\n" + >- "----------\n" + >- "----------\n" + >- "1. ERROR in p\\r2\\Point4d.java (at line 7)\n" + >- " z = p.z; }\n" + >- " ^^^\n" + >- "The field p.z is not visible\n" + >- "----------\n" + >- "----------\n" + >- "1. ERROR in p\\r2\\helper\\Point3d.java (at line 9)\n" + >- " p.x += this.x;\n" + >- " ^^^\n" + >- "The field p.x is not visible\n" + >- "----------\n" + >- "2. ERROR in p\\r2\\helper\\Point3d.java (at line 10)\n" + >- " p.y += this.y;\n" + >- " ^^^\n" + >- "The field p.y is not visible\n" + >- "----------\n" + >- "----------\n" + >- "1. WARNING in p\\r2\\helper\\B.java (at line 3)\n" + >- " protected static int x = 10;\n" + >- " ^\n" + >- "The field B.x is hiding a field from type A\n" + >- "----------\n" + >- "2. WARNING in p\\r2\\helper\\B.java (at line 4)\n" + >- " static void foo() {p.r2.A.x = 100;} \n" + >- " ^^^^^\n" + >- "The method B.foo() does not override the inherited method from A since it is private to a different package.\n" + >- "----------\n" + >- "----------\n" + >- "1. WARNING in p\\r2\\helper\\SomeTest.java (at line 6)\n" + >- " assertEquals(false);\n" + >- " ^^^^^^^^^^^^^^^^^^^\n" + >- "Access to enclosing method assertEquals(boolean) from the type Test is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + >- "----------\n" + >- "----------\n" + >- "1. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" + >- " int x = i; }; // bad since from inside inner\n" + >- " ^\n" + >- "The field new Object(){}.x is hiding a field from type A\n" + >- "----------\n" + >- "2. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" + >- " int x = i; }; // bad since from inside inner\n" + >- " ^\n" + >- "Read access to enclosing field A.i is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + >- "----------\n" >+ "----------\n" + >+ "1. ERROR in p\\r2\\A.java (at line 6)\n" + >+ " static void foo() {p.r2.helper.B.x = 100;}\n" + >+ " ^^^^^^^^^^^^^^^\n" + >+ "The field p.r2.helper.B.x is not visible\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in p\\r2\\CMain.java (at line 20)\n" + >+ " p1.p2.i = 3;\n" + >+ " ^^^^^^^\n" + >+ "The type P2 is not visible\n" + >+ "----------\n" + >+ "2. ERROR in p\\r2\\CMain.java (at line 21)\n" + >+ " System.out.println(p1.p2.i);\n" + >+ " ^^^^^^^\n" + >+ "The type P2 is not visible\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in p\\r2\\Point.java (at line 10)\n" + >+ " if (a.z > 0) a.delta(this);\n" + >+ " ^^^\n" + >+ "The field a.z is not visible\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in p\\r2\\Point4d.java (at line 7)\n" + >+ " z = p.z; }\n" + >+ " ^^^\n" + >+ "The field p.z is not visible\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. WARNING in p\\r2\\SubSubA.java (at line 3)\n" + >+ " int j = super.i;\n" + >+ " ^^^^^^^\n" + >+ "The static field A.i should be accessed in a static way\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in p\\r2\\helper\\Point3d.java (at line 9)\n" + >+ " p.x += this.x;\n" + >+ " ^^^\n" + >+ "The field p.x is not visible\n" + >+ "----------\n" + >+ "2. ERROR in p\\r2\\helper\\Point3d.java (at line 10)\n" + >+ " p.y += this.y;\n" + >+ " ^^^\n" + >+ "The field p.y is not visible\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. WARNING in p\\r2\\helper\\B.java (at line 3)\n" + >+ " protected static int x = 10;\n" + >+ " ^\n" + >+ "The field B.x is hiding a field from type A\n" + >+ "----------\n" + >+ "2. WARNING in p\\r2\\helper\\B.java (at line 4)\n" + >+ " static void foo() {p.r2.A.x = 100;} \n" + >+ " ^^^^^\n" + >+ "The method B.foo() does not override the inherited method from A since it is private to a different package.\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. WARNING in p\\r2\\helper\\SomeTest.java (at line 6)\n" + >+ " assertEquals(false);\n" + >+ " ^^^^^^^^^^^^^^^^^^^\n" + >+ "Access to enclosing method assertEquals(boolean) from the type Test is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. WARNING in p\\r2\\helper\\SubA.java (at line 3)\n" + >+ " int j = super.i;\n" + >+ " ^^^^^^^\n" + >+ "The static field A.i should be accessed in a static way\n" + >+ "----------\n" + >+ "2. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" + >+ " int x = i; }; // bad since from inside inner\n" + >+ " ^\n" + >+ "The field new Object(){}.x is hiding a field from type A\n" + >+ "----------\n" + >+ "3. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" + >+ " int x = i; }; // bad since from inside inner\n" + >+ " ^\n" + >+ "Read access to enclosing field A.i is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. WARNING in p\\r2\\helper2\\SubSubA2.java (at line 3)\n" + >+ " int j = super.i;\n" + >+ " ^^^^^^^\n" + >+ "The static field A.i should be accessed in a static way\n" + >+ "----------\n" > ); > } > public void test222() { >@@ -10309,27 +10326,32 @@ > " ^^^^^^^^^^^^^^^^\n" + > "The static field X.staticField should be accessed in a static way\n" + > "----------\n" + >- "10. WARNING in p\\X.java (at line 36)\n" + >+ "10. WARNING in p\\X.java (at line 35)\n" + >+ " i = super.staticField; \n" + >+ " ^^^^^^^^^^^^^^^^^\n" + >+ "The static field X0.staticField should be accessed in a static way\n" + >+ "----------\n" + >+ "11. WARNING in p\\X.java (at line 36)\n" + > " i = new X().staticField; \n" + > " ^^^^^^^^^^^\n" + > "The static field X.staticField should be accessed in a static way\n" + > "----------\n" + >- "11. WARNING in p\\X.java (at line 37)\n" + >+ "12. WARNING in p\\X.java (at line 37)\n" + > " i = x.staticField; \n" + > " ^^^^^^^^^^^^^\n" + > "The static field X.staticField should be accessed in a static way\n" + > "----------\n" + >- "12. WARNING in p\\X.java (at line 38)\n" + >+ "13. WARNING in p\\X.java (at line 38)\n" + > " i = x.other.staticField; \n" + > " ^^^^^^^^^^^^^^^^^^^\n" + > "The static field X.staticField should be accessed in a static way\n" + > "----------\n" + >- "13. ERROR in p\\X.java (at line 42)\n" + >+ "14. ERROR in p\\X.java (at line 42)\n" + > " method(); \n" + > " ^^^^^^\n" + > "Cannot make a static reference to the non-static method method() from the type X\n" + > "----------\n" + >- "14. ERROR in p\\X.java (at line 45)\n" + >+ "15. ERROR in p\\X.java (at line 45)\n" + > " i = field; \n" + > " ^^^^^\n" + > "Cannot make a static reference to the non-static field field\n" + >@@ -13385,6 +13407,7 @@ > public void test359() { > Map customOptions = getCompilerOptions(); > customOptions.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE); > this.runNegativeTest( > new String[] { > "X.java",
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 68927
:
13823
| 13824