mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-01-25 03:40:38 +08:00
support private method invocation in assign statement
This commit is contained in:
parent
851ae91406
commit
860fdcf072
@ -103,8 +103,12 @@ public class EnablePrivateAccessTranslator extends BaseTranslator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* var = d.privateMethod(args) → var = PrivateAccessor.invoke(d, "privateMethod", args)
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void visitVarDef(JCVariableDecl jcVariableDecl) {
|
public void visitVarDef(JCVariableDecl jcVariableDecl) {
|
||||||
|
jcVariableDecl.init = checkAndExchange(jcVariableDecl.init);
|
||||||
super.visitVarDef(jcVariableDecl);
|
super.visitVarDef(jcVariableDecl);
|
||||||
if (jcVariableDecl.vartype.getClass().equals(JCIdent.class) &&
|
if (jcVariableDecl.vartype.getClass().equals(JCIdent.class) &&
|
||||||
((JCIdent)jcVariableDecl.vartype).name.equals(sourceClassName)) {
|
((JCIdent)jcVariableDecl.vartype).name.equals(sourceClassName)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user