From ad7dac66b3366c0301bd3741106b4b6b241a680e Mon Sep 17 00:00:00 2001 From: Daniel Widdis Date: Tue, 15 Feb 2022 09:53:50 -0800 Subject: [PATCH] [MCOMPILER-485] Call ClassWriter#visit before ClassWriter#visitSource Javadocs for org.objectweb.asm.ClassVisitor specify "The methods of this class must be called in the following order: visit [ visitSource ] ..." --- .../org/apache/maven/plugin/compiler/AbstractCompilerMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java index a0c284f1..915d39f5 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java @@ -1369,10 +1369,10 @@ private byte[] generatePackage( CompilerConfiguration compilerConfiguration, Str internalPackageName = internalPackageName.replace( File.separatorChar, '/' ); } ClassWriter cw = new ClassWriter( 0 ); - cw.visitSource( "package-info.java", null ); cw.visit( version, Opcodes.ACC_SYNTHETIC | Opcodes.ACC_ABSTRACT | Opcodes.ACC_INTERFACE, internalPackageName, null, "java/lang/Object", null ); + cw.visitSource( "package-info.java", null ); return cw.toByteArray(); }