Issue #2191 - JPMS Support.

Restored error message in case of wrong ASM version.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2018-10-03 19:24:05 +02:00
parent 5cac3376c6
commit 76a9be8a82
1 changed files with 4 additions and 3 deletions

View File

@ -84,11 +84,12 @@ public class AnnotationParser
*/
public static int asmVersion ()
{
String asmString = "ASM6";
int asmVersion = ASM_OPCODE_VERSION;
String version = ManifestUtils.getVersion(Opcodes.class).orElse(null);
if (version == null)
{
LOG.warn("Unknown ASM version, assuming {}", ASM_OPCODE_VERSION);
LOG.warn("Unknown ASM version, assuming {}", asmString);
}
else
{
@ -116,13 +117,13 @@ public class AnnotationParser
}
default:
{
LOG.warn("Unrecognized ASM version, assuming {}", ASM_OPCODE_VERSION);
LOG.warn("Unrecognized ASM version, assuming {}", asmString);
}
}
}
catch (NumberFormatException e)
{
LOG.warn("Unable to parse ASM version, assuming {}", ASM_OPCODE_VERSION);
LOG.warn("Unable to parse ASM version, assuming {}", asmString);
}
}
return asmVersion;