diff --git a/core/src/main/java/com/alibaba/testable/translator/EnableTestableInjectTranslator.java b/core/src/main/java/com/alibaba/testable/translator/EnableTestableInjectTranslator.java index ff33d12..657598f 100644 --- a/core/src/main/java/com/alibaba/testable/translator/EnableTestableInjectTranslator.java +++ b/core/src/main/java/com/alibaba/testable/translator/EnableTestableInjectTranslator.java @@ -62,6 +62,16 @@ public class EnableTestableInjectTranslator extends BaseTranslator { super.visitSelect(jcFieldAccess); } + /** + * member() + new Demo() -> n.e.f(this, "member") + n.e.w(Demo.class) + */ + @Override + public void visitBinary(JCBinary jcBinary) { + jcBinary.lhs = checkAndExchange(jcBinary.lhs); + jcBinary.rhs = checkAndExchange(jcBinary.rhs); + super.visitBinary(jcBinary); + } + /** * For member method invocation break point * call(new Demo()) -> call(n.e.w(Demo.class))