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 172115 Details for
Bug 316456
[1.5][compiler] Annotation values can access private class members
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch under consideration
patch.txt (text/plain), 2.81 KB, created by
Srikanth Sankaran
on 2010-06-17 09:32:15 EDT
(
hide
)
Description:
Patch under consideration
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2010-06-17 09:32:15 EDT
Size:
2.81 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v >retrieving revision 1.368 >diff -u -r1.368 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 20 May 2010 14:12:01 -0000 1.368 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 17 Jun 2010 13:17:59 -0000 >@@ -986,8 +986,10 @@ > > currentType.initializeForStaticImports(); > FieldBinding field = currentType.getField(fieldName, needResolve); >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=316456 >+ boolean insideTypeAnnotations = this instanceof MethodScope && ((MethodScope) this).insideTypeAnnotation; > if (field != null) { >- if (invocationSite == null >+ if (invocationSite == null || insideTypeAnnotations > ? field.canBeSeenBy(getCurrentPackage()) > : field.canBeSeenBy(currentType, invocationSite, this)) > return field; >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java,v >retrieving revision 1.217 >diff -u -r1.217 AnnotationTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 18 May 2010 18:12:11 -0000 1.217 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 17 Jun 2010 13:18:49 -0000 >@@ -44,7 +44,7 @@ > // Static initializer to specify tests subset using TESTS_* static variables > // All specified tests which do not belong to the class are skipped... > static { >-// TESTS_NAMES = new String[] { "test127" }; >+// TESTS_NAMES = new String[] { "test293" }; > // TESTS_NUMBERS = new int[] { 290, 291 }; > // TESTS_RANGE = new int[] { 249, -1 }; > } >@@ -9688,4 +9688,26 @@ > options, > null); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=316456 >+public void test293() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "@A(name = X.QUERY_NAME, query = X.QUERY)\n" + >+ "public class X {\n" + >+ " public static final String QUERY_NAME = \"client.query.name\";\n" + >+ " private static final String QUERY = \"from Client\";\n" + >+ "}\n" + >+ "@interface A{\n" + >+ " String name();\n" + >+ " String query();\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " @A(name = X.QUERY_NAME, query = X.QUERY)\n" + >+ " ^^^^^\n" + >+ "The field X.QUERY is not visible\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 316456
: 172115