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

Bug 316456

Summary: [1.5][compiler] Annotation values can access private class members
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, cstach-eclipse, stephan.herrmann
Version: 3.6Flags: Olivier_Thomann: review+
Target Milestone: 3.6.1   
Hardware: PC   
OS: Windows XP   
See Also: https://github.com/eclipse-jdt/eclipse.jdt.core/pull/340
Whiteboard:
Attachments:
Description Flags
Patch under consideration none

Description Olivier Thomann CLA 2010-06-10 09:02:15 EDT
From bug 185422, the following code should not compile:

@A(name = X.QUERY_NAME, query = X.QUERY)
public class X {

    public static final String QUERY_NAME = "client.query.name";
    private static final String QUERY = "from Client";
}

@interface A{
	String name();
	String query();
}

It fails to compile using javac 1.7 (b93) and javac 1.6_21. It compiles fine using Eclipse compiler 3.6RC4.
Comment 1 Olivier Thomann CLA 2010-06-10 09:02:39 EDT
Potential 3.6.1 candidate.
Comment 2 Srikanth Sankaran CLA 2010-06-17 09:32:15 EDT
Created attachment 172115 [details]
Patch under consideration
Comment 3 Olivier Thomann CLA 2010-06-17 10:02:59 EDT
Patch looks good. +1 for 3.6.1.
Comment 4 Srikanth Sankaran CLA 2010-06-21 22:43:28 EDT
Released in HEAD for 3.7 M1 and
         in 3.6 maintenance stream for 3.6.1
Comment 5 Ayushman Jain CLA 2010-08-03 07:34:53 EDT
Verified for 3.7M1 using build I20100802-1800.
Comment 6 Ayushman Jain CLA 2010-08-03 07:51:15 EDT
Marked verified by mistake. Resetting to RESOLVED.
Comment 7 Srikanth Sankaran CLA 2010-08-16 01:03:58 EDT
*** Bug 322741 has been marked as a duplicate of this bug. ***
Comment 8 Frederic Fusier CLA 2010-08-26 10:54:36 EDT
Verified for 3.6.1 using build M20100825-0800.
Comment 9 Stephan Herrmann CLA 2022-09-10 06:47:04 EDT
This bug injection is being reverted in https://github.com/eclipse-jdt/eclipse.jdt.core/pull/340