mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-03-13 11:20:32 +08:00
handle non-static method without this reference
This commit is contained in:
parent
eec88f4bd9
commit
6d87653fa2
@ -123,7 +123,7 @@ public class MockClassHandler extends BaseClassWithContextHandler {
|
||||
}
|
||||
|
||||
private ImmutablePair<LabelNode, LabelNode> getStartAndEndLabel(MethodNode mn) {
|
||||
if (MethodUtil.isStatic(mn)) {
|
||||
if (MethodUtil.isStatic(mn) || mn.localVariables.isEmpty()) {
|
||||
LabelNode startLabel = null, endLabel = null;
|
||||
for (AbstractInsnNode n = mn.instructions.getFirst(); n != null; n = n.getNext()) {
|
||||
if (n instanceof LabelNode) {
|
||||
|
Loading…
Reference in New Issue
Block a user