JDK-4032740 : (Reflection)Accessibilities of members should be ACCESS-LEVEL sensitive.
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 1.1,5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5,windows_xp
  • CPU: x86,sparc
  • Submitted: 1997-02-17
  • Updated: 2012-09-28
  • Resolved: 2010-08-26
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
Name: mc57594			Date: 02/17/97


Currently, only public members can be accessed through reflection-API,
but VM should concern scoping rule between accessor and target.
At least, subclasses should be able to access protected fields and methods
through reflection API.
company  -  PFU Ltd., Tokyo, Japan  , email  -  ###@###.###
======================================================================

Comments
EVALUATION Closing as a dup of the pair of bugs 4283544 (reflect) Field and Method do not correctly obey language accessibility rules 4071957 (reflect) Method.invoke access control does not understand inner class scoping which track the differences between language-level and reflection access checks.
26-08-2010

EVALUATION Part of this issue (accessing protected methods) has been addressed by a compiler enhancement, see bug 6342411.
14-02-2006

WORK AROUND Name: mc57594 Date: 02/17/97 ======================================================================
11-06-2004

EVALUATION That seems very plausible. There is a more general problem of accessing programs by tools. The reflection API spec will be re-examined shortly in view of its interaction with the JLS, JVMS, debugging etc. gilad.bracha@eng 1997-12-17
17-12-1997