Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322741

Summary: Field visibility on class level annotation inconsistent with Sun JDK 1.6.0_20-b02
Product: [Eclipse Project] JDT Reporter: Christopher G. Stach II <cstach-eclipse>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann, srikanth_sankaran
Version: 3.6   
Target Milestone: 3.6.1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Christopher G. Stach II CLA 2010-08-16 00:26:46 EDT
Build Identifier: I20100608-0911

A class with a structure like this compiles fine under Eclipse:

@SomeAnnotation(value = {
    ExampleClass.FOO
})
public class ExampleClass {
    private static final String FOO = "foo";
}

When compiled with Sun's javac, an error similar to this is the result:

    [javac] ExampleClass.java:89: FOO has private access in ExampleClass
    [javac]     ExampleClass.FOO,

Of course, changing the field from private to protected visibility works for both.

Reproducible: Always
Comment 1 Srikanth Sankaran CLA 2010-08-16 01:03:58 EDT
The problem does not show up on HEAD.
This is a duplicate of bug 316456 as
can be confirmed by backing out the fix
for that bug and being able to reproduce
the problem.

*** This bug has been marked as a duplicate of bug 316456 ***
Comment 2 Frederic Fusier CLA 2010-08-26 10:58:26 EDT
Verified for 3.6.1 using build M20100825-0800.

I haven't reset the Whiteboard intentionally as I think it would be safe to
also verify this test case in HEAD stream (it's different than the test case of bug 316456 comment 0...)
Comment 3 Olivier Thomann CLA 2010-09-14 10:46:22 EDT
Verified for 3.7M2 using I20100914-0100