package: allow v45.3 classes

if we ever support a versions that can emit preview classes this will
need to check that too, but only 13+ does that so this is fine for now
This commit is contained in:
Max Weber
2021-11-08 06:47:54 -07:00
parent d5fbcacdad
commit d85d251d5f

View File

@@ -536,7 +536,8 @@ public class Plugin implements Closeable
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
{
if (version > Opcodes.V1_8 && !(fileName.startsWith("META-INF/versions") || fileName.endsWith("module-info.class")))
if ((version & 0xFFFF) > Opcodes.V1_8
&& !(fileName.startsWith("META-INF/versions") || fileName.endsWith("module-info.class")))
{
throw PluginBuildException.of(Plugin.this, "plugins must be Java 1.8 compatible")
.withFile(fileName);