-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using flexmark in a native image causes an ArrayIndexOutOfBoundsException #577
Comments
Signed-off-by: palexdev <[email protected]>
Hi there! Are there any plans for compatibility with graalvm (native image)? |
I'm hitting a somewhat similar error in a binary built with GraalVM:
I tried #578 and I confirm it fixes my issue. Any chance we can get a release with that fix any time soon? |
Would be good to see this fixed. I was able to patch the change from #578 into my image using GraalVM's substitution feature so I didn't have to use a rebuilt flexmark jar: @TargetClass(value = BitFieldSet.class, innerClass = "UniverseLoader")
final class com_vladsch_flexmark_util_misc_BitFieldSet_UniverseLoader {
@Alias
static ConcurrentHashMap<Class, Enum[]> enumUniverseMap;
@Substitute
public static <E extends Enum<E>> Enum[] getUniverseSlow(Class<E> elementType) {
assert (elementType.isEnum());
Enum[] cachedUniverse = enumUniverseMap.get(elementType);
if (cachedUniverse != null) return cachedUniverse;
E[] constants = elementType.getEnumConstants();
int enums = constants.length;
if (enums > 0) {
cachedUniverse = new Enum[enums];
enums = 0;
for (E constant : constants) {
cachedUniverse[enums++] = constant;
}
} else {
cachedUniverse = new Enum<?>[0];
}
enumUniverseMap.put(elementType, cachedUniverse);
return cachedUniverse;
}
} |
I'm trying to build an app with JavaFX and markdown-javafx-renderer (which uses flexmark) using GraalVM. I can successfully build the image but at runtime the app crashes with the following exception:
To Reproduce
Here's the Reproducer project I'm using: Reproducer.zip
Steps to reproduce:
nativeBuild
Gradle tasknativeRun
Gradle taskThe text was updated successfully, but these errors were encountered: