jclouds/jclouds — pull request #1471 by demobox (2013-03-28 22:33:41+00:00)
Title: Not making methods of core Java classes accessible in Reflection2

Background here is that attempts to make any method loaded by [Reflection2](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/reflect/Reflection2.java) [accessible](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/reflect/Reflection2.java#L292) causes security violations on JVMs with a security policy, e.g. in GAE:
```
1) Error notifying TypeListener org.jclouds.lifecycle.config.LifeCycleModule$4@138f3d1 (bound at org.jclouds.lifecycle.config.LifeCycleModule.bindPostInjectionInvoke(LifeCycleModule.java:120)) of com.google.inject.Stage.
Reason: java.lang.SecurityException: java.lang.IllegalAccessException: Reflection is not allowed on protected final void java.lang.Enum.finalize()
Caused by: java.lang.SecurityException: java.lang.IllegalAccessException: Reflection is not allowed on protected final void java.lang.Enum.finalize()
at com.google.appengine.runtime.Request.process-d474e80a168299ea(Request.java)
at java.lang.reflect.Method.setAccessible(Method.java:135)
at org.jclouds.reflect.Reflection2$7.load(Reflection2.java:292)
at org.jclouds.reflect.Reflection2$7.load(Reflection2.java:284)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3599)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2379)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2342)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2257)
at com.google.common.cache.LocalCache.get(LocalCache.java:4000)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4004)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4874)
at org.jclouds.reflect.Reflection2.get(Reflection2.java:305)
```
Whether the criteria chosen to filter classes (package starts with `java.` or `javax.`) is the best choice is not clear, but it seems to be sufficient to get things working again on GAE, at least.