jmx-dev <Beans Dev> 8038343: Eliminate use of reflection to access JavaBeans Introspector

sergey malenkov sergey.malenkov at oracle.com
Wed Mar 26 12:17:24 UTC 2014


The fix looks good to me.

Thanks,
SAM

On 25.03.2014 23:04, Alan Bateman wrote:
>
> Currently the introspection code in the JMX monitor API uses core 
> reflection to access the JavaBeans Introspector. This came about when 
> we had to eliminate this dependency - for example in the subset 
> Profiles of Java SE then compact3 defines the JMX API but doesn't have 
> java.beans.
>
> I'd like to clean this up further and replace the reflection hack with 
> a solution that uses the SharedSecrets mechanism. The reason is to 
> avoid needing to suppress the access check when we move to modules in 
> the future. The webrev with the proposed changes is here:
>
> http://cr.openjdk.java.net/~alanb/8038343/webrev/
>
> The changes are very simple and the only non-obvious thing is that the 
> JMX introspector needs to ensure that the beans Introspector is 
> initialized so this is the reason for the Class.forName. I've tried a 
> number of other approaches to this but this one seems to simplest.
>
> Thanks,
>
> Alan.



More information about the jmx-dev mailing list