mn.parameters could be null

This commit is contained in:
金戟 2020-10-31 22:29:22 +08:00
parent d816726f4f
commit da3eca3d49
2 changed files with 2 additions and 2 deletions

View File

@ -52,6 +52,7 @@ public class TestClassHandler extends BaseClassHandler {
private void handleAnnotation(ClassNode cn, MethodNode mn) {
List<String> visibleAnnotationNames = new ArrayList<String>();
if (mn.visibleAnnotations == null) {
// let's assume test case should has a annotation, e.g. @Test or whatever
return;
}
for (AnnotationNode n : mn.visibleAnnotations) {
@ -100,7 +101,7 @@ public class TestClassHandler extends BaseClassHandler {
private void injectInvokeRecorder(MethodNode mn) {
InsnList il = new InsnList();
List<Byte> types = ClassUtil.getParameterTypes(mn.desc);
int size = mn.parameters.size();
int size = types.size();
int parameterOffset = 1;
il.add(getIntInsn(size));
il.add(new TypeInsnNode(ANEWARRAY, ClassUtil.CLASS_OBJECT));

View File

@ -1,6 +1,5 @@
package com.alibaba.testable.core.accessor;
import com.alibaba.testable.core.util.InvokeRecordUtil;
import com.alibaba.testable.core.util.TypeUtil;
import java.lang.reflect.Field;