mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-01-09 20:00:21 +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
|
||||
public void visitVarDef(JCVariableDecl jcVariableDecl) {
|
||||
jcVariableDecl.init = checkAndExchange(jcVariableDecl.init);
|
||||
super.visitVarDef(jcVariableDecl);
|
||||
if (jcVariableDecl.vartype.getClass().equals(JCIdent.class) &&
|
||||
((JCIdent)jcVariableDecl.vartype).name.equals(sourceClassName)) {
|
||||
|
Loading…
Reference in New Issue
Block a user