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 :  
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  -  ###@###.###

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.

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

WORK AROUND Name: mc57594 Date: 02/17/97 ======================================================================

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