Skip to content

Commit

Permalink
Merge pull request #22403 from Karm/awt-ts-jdk-compatibility
Browse files Browse the repository at this point in the history
AWT - resource files lookup: Replaces MethodHandles.lookup()
  • Loading branch information
gsmet authored Dec 20, 2021
2 parents db92a7f + f07a9e7 commit bc0c1dd
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.quarkus.awt.runtime;

import java.io.InputStream;
import java.lang.invoke.MethodHandles;
import java.util.PropertyResourceBundle;

import com.oracle.svm.core.annotate.Substitute;
Expand All @@ -17,12 +16,10 @@ final class Target_com_sun_imageio_plugins_common_I18NImpl {

@Substitute
private static String getString(String className, String resource_name, String key) {
// The property file is now stored in the root of the tree
resource_name = "/" + resource_name;
PropertyResourceBundle bundle = null;
try {
// className ignored, there is only one such file in the imageio anyway
InputStream stream = MethodHandles.lookup().lookupClass().getResourceAsStream(resource_name);
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource_name);
bundle = new PropertyResourceBundle(stream);
} catch (Throwable e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit bc0c1dd

Please sign in to comment.