Do not create local variables in an abstract class inside OptimizationMethodVisitor, MethodNode forbids this.
This commit is contained in:
@@ -68,7 +68,10 @@ public abstract class TransformationMethodVisitor extends MethodVisitor {
|
||||
|
||||
// In case of empty instructions list MethodNode.accept doesn't call visitLocalVariables of delegate
|
||||
// So we just do it here
|
||||
if (methodNode.instructions.size() == 0) {
|
||||
if (methodNode.instructions.size() == 0
|
||||
// MethodNode does not create a list of variables for abstract methods, so we would get NPE in accept() instead
|
||||
&& (!(delegate instanceof MethodNode) || (methodNode.access & Opcodes.ACC_ABSTRACT) == 0)
|
||||
) {
|
||||
List<LocalVariableNode> localVariables = methodNode.localVariables;
|
||||
// visits local variables
|
||||
int n = localVariables == null ? 0 : localVariables.size();
|
||||
|
||||
Reference in New Issue
Block a user