Bug 316456 - [1.5][compiler] Annotation values can access private class members
Summary: [1.5][compiler] Annotation values can access private class members
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6.1   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 322741 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-10 09:02 EDT by Olivier Thomann CLA
Modified: 2022-09-10 06:47 EDT (History)
3 users (show)

See Also:
Olivier_Thomann: review+


Attachments
Patch under consideration (2.81 KB, patch)
2010-06-17 09:32 EDT, Srikanth Sankaran CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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