Skip to content

Commit

Permalink
Some additional comments
Browse files Browse the repository at this point in the history
  • Loading branch information
abayer committed Aug 23, 2017
1 parent 522f56c commit d93226e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,10 @@ public JExpression visitMethodInvocation(MethodInvocationTree mt, Void __) {

if (ms instanceof MemberSelectTree) {
MemberSelectTree mst = (MemberSelectTree) ms;
// Make sure we translate any method calls to a transformed class too.
// If this is a call to a static method on another class, it may be an already-translated method,
// in which case, we need to use that translated method, not the original. So check if the expression
// is an identifier, that it's not the class we're in the process of translating, and if it's one
// of the other known translated classes.
if (mst.getExpression() instanceof JCIdent &&
!((JCIdent)mst.getExpression()).sym.toString().equals(fqcn) &&
otherTranslated.containsKey(((JCIdent)mst.getExpression()).sym.toString())) {
Expand Down Expand Up @@ -560,6 +563,9 @@ public JExpression visitAssignment(AssignmentTree at, Void __) {
.arg(visit(at.getExpression()));
}

/**
* This is needed to handle cases like {@code Object[].class}.
*/
@Override
public JExpression visitArrayType(ArrayTypeTree at, Void __) {
if (at.getType() instanceof IdentifierTree) {
Expand Down

0 comments on commit d93226e

Please sign in to comment.