-
Enhancement
-
Resolution: Duplicate
-
P2
-
8
Class.getResource and ClassLoader.getResource are the APIs to obtain resource files associated with the class and/or classloader. An example in the JDK: ResourceBundle.getBundle finds the caller's class and uses the caller class loader to load a resource bundle. Libraries and frameworks such as Groovy, Log4j need similar capability and also need the ability to filter their implementation classes. Existing code has been using sun.reflect.Reflection.getCallerClass(int depth).
There is no current way for libraries to support loading resource files on behalf of its immediate caller without explicitly passing the calling Class (for example localization data in GUI applications). See discussion in [1].
[1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018353.html
There is no current way for libraries to support loading resource files on behalf of its immediate caller without explicitly passing the calling Class (for example localization data in GUI applications). See discussion in [1].
[1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018353.html
- duplicates
-
JDK-8140450 Implement JEP 259: Stack-Walking API
- Resolved
- relates to
-
JDK-8020785 caller-sensitive methods to skip dynamic generated frames and look up the true caller
- Closed
-
JDK-8043814 JEP 259: Stack-Walking API
- Closed
-
JDK-4851444 (reflect) equivalent of sun.reflect.Reflection.getCallerClass should be exposed
- Closed
-
JDK-8025799 Restore sun.reflect.Reflection.getCallerClass(int) until a replacement API is provided
- Closed