Skip to content

Commit

Permalink
Resolves #103 - EnforcerBytecodeVersion throws NullPointerException
Browse files Browse the repository at this point in the history
  • Loading branch information
Barbatruuk authored and slachiewicz committed Jul 27, 2021
1 parent b428f75 commit e46fc1f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,13 @@ private String isBadArtifact( Artifact a )

if ( matcher.matches() )
{
int expectedMajor = JDK_TO_MAJOR_VERSION_NUMBER_MAPPING.get( matcher.group( 1 ) );
Integer expectedMajor = JDK_TO_MAJOR_VERSION_NUMBER_MAPPING.get( matcher.group( 1 ) );

if ( major != expectedMajor )
if (expectedMajor == null) {
getLog().warn( "Unknown bytecodeVersion for " + a + " : "
+ entry.getName() + ": got " + expectedMajor + " class-file-version" );
}
else if ( major != expectedMajor )
{
getLog().warn( "Invalid bytecodeVersion for " + a + " : "
+ entry.getName() + ": expected " + expectedMajor + ", but was " + major );
Expand Down

0 comments on commit e46fc1f

Please sign in to comment.