Skip to content

Commit

Permalink
[MCOMPILER-485] Call ClassWriter#visit before ClassWriter#visitSource
Browse files Browse the repository at this point in the history
Javadocs for org.objectweb.asm.ClassVisitor specify "The methods of this
class must be called in the following order: visit [ visitSource ] ..."
  • Loading branch information
dbwiddis committed Feb 15, 2022
1 parent ce63338 commit ad7dac6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit ad7dac6

Please sign in to comment.