Skip to content

Commit 912ee43

Browse files
committed
Fix runtime resource resolution issue
1 parent d603811 commit 912ee43

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/esmf-native-support/src/main/java/org/eclipse/esmf/substitution/Target_sun_awt_FontConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import java.io.IOException;
1818
import java.io.InputStream;
1919

20+
import org.eclipse.esmf.nativefeatures.Native;
21+
2022
import com.oracle.svm.core.annotate.Alias;
2123
import com.oracle.svm.core.annotate.Substitute;
2224
import com.oracle.svm.core.annotate.TargetClass;
@@ -40,7 +42,7 @@
4042
public final class Target_sun_awt_FontConfiguration {
4143
@Substitute
4244
private void readFontConfigFile( final File f ) {
43-
try ( final InputStream inputStream = getClass().getResourceAsStream( "fontconfig.bfc" ) ) {
45+
try ( final InputStream inputStream = Native.class.getResourceAsStream( "/fontconfig.bfc" ) ) {
4446
loadBinary( inputStream );
4547
} catch ( final IOException exception ) {
4648
throw new RuntimeException( exception );

tools/samm-cli/src/main/java/org/eclipse/esmf/FileInputHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static boolean appliesToInput( final String input ) {
7676
try {
7777
return absoluteFile( new File( input ) ).exists();
7878
} catch ( final Exception exception ) {
79-
// This could file with e.g. a InvalidPathException or with platform-specific exceptions when the input is indeed not a valid file
79+
// This could fail with e.g. a InvalidPathException or with platform-specific exceptions when the input is indeed not a valid file
8080
return false;
8181
}
8282
}

0 commit comments

Comments
 (0)