Commit b8efef00 authored by Remi Forax's avatar Remi Forax
Browse files

when testing, do not load classes that are tagged as preview

parent 6896b689
Pipeline #2869 passed with stage
in 6 minutes and 51 seconds
...@@ -385,6 +385,7 @@ public abstract class AsmTest { ...@@ -385,6 +385,7 @@ public abstract class AsmTest {
} catch (IOException | IllegalArgumentException e) { } catch (IOException | IllegalArgumentException e) {
fail("Class can't be dumped, probably invalid", e); fail("Class can't be dumped, probably invalid", e);
} }
// don't try to load module-info.class
if (className.endsWith(MODULE_INFO)) { if (className.endsWith(MODULE_INFO)) {
if (getMajorJavaVersion() < 9) { if (getMajorJavaVersion() < 9) {
throw new UnsupportedClassVersionError(); throw new UnsupportedClassVersionError();
...@@ -392,7 +393,12 @@ public abstract class AsmTest { ...@@ -392,7 +393,12 @@ public abstract class AsmTest {
return true; return true;
} }
} else { } else {
return doLoadAndInstantiate(className, classContent); // don't try to load preview class (which requires a VM started with --enable-preview)
if (getMajorJavaVersion() >= 11 && classContent[4] == -1 && classContent[5] == -1) {
return true;
} else {
return doLoadAndInstantiate(className, classContent);
}
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment