@Override public void visitNewClass(JCTree.JCNewClass tree) { super.visitNewClass(tree); // check for constructor invocations where the type is a member of an enclosing class, // the enclosing instance is passed as an explicit argument Type type = ASTHelpers.getType(tree.clazz); if (type == null) { return; } if (memberOfEnclosing(owner, state, type.tsym)) { canPossiblyBeStatic = false; } }
/** * Grab references on the given new-class tree. */ @Override public void visitNewClass(JCNewClass newClass) { add(newClass.clazz.type.tsym); super.visitNewClass(newClass); }
@Override public void visitNewClass(JCNewClass tree) { if (tree.def == null) { // For an anonymous class instantiation the class // will be visited separately. super.visitNewClass(tree); } } }
public void visitNewClass(JCNewClass node) { node.constructor = null; super.visitNewClass(node); } public void visitAssignop(JCAssignOp node) {
public void visitNewClass(JCNewClass node) { node.constructor = null; super.visitNewClass(node); } public void visitAssignop(JCAssignOp node) {
public void visitNewClass(JCNewClass node) { node.constructor = null; super.visitNewClass(node); } public void visitAssignop(JCAssignOp node) {
public void visitNewClass(JCNewClass node) { node.constructor = null; super.visitNewClass(node); } public void visitAssignop(JCAssignOp node) {
@Override public void visitNewClass(JCNewClass tree) { if (tree.def == null) { // For an anonymous class instantiation the class // will be visited separately. super.visitNewClass(tree); } } }
/** If tree refers to a class instance creation expression * add all free variables of the freshly created class. */ public void visitNewClass(JCNewClass tree) { ClassSymbol c = (ClassSymbol)tree.constructor.owner; addFreeVars(c); super.visitNewClass(tree); }
@Override public void visitNewClass(JCNewClass that) { if (that.constructor == null) { that.constructor = new MethodSymbol(0, names.init, syms.unknownType, syms.noSymbol); } if (that.constructorType == null) { that.constructorType = syms.unknownType; } super.visitNewClass(that); }
/** If tree refers to a class instance creation expression * add all free variables of the freshly created class. */ public void visitNewClass(JCNewClass tree) { ClassSymbol c = (ClassSymbol)tree.constructor.owner; addFreeVars(c); super.visitNewClass(tree); }
@Override public void visitNewClass(JCNewClass that) { if (that.constructor == null) { that.constructor = new MethodSymbol(0, names.init, dummyMethodType(), syms.noSymbol); } if (that.constructorType == null) { that.constructorType = syms.unknownType; } super.visitNewClass(that); }
@Override public void visitNewClass(JCTree.JCNewClass tree) { super.visitNewClass(tree); // check for constructor invocations where the type is a member of an enclosing class, // the enclosing instance is passed as an explicit argument Type type = ASTHelpers.getType(tree.clazz); if (type == null) { return; } if (memberOfEnclosing(owner, state, type.tsym)) { canPossiblyBeStatic = false; } }
/** If tree refers to a class instance creation expression * add all free variables of the freshly created class. */ public void visitNewClass(JCNewClass tree) { ClassSymbol c = (ClassSymbol)tree.constructor.owner; addFreeVars(c); if (tree.encl == null && c.hasOuterInstance() && outerThisStack.head != null) visitSymbol(outerThisStack.head); super.visitNewClass(tree); }
/** If tree refers to a class instance creation expression * add all free variables of the freshly created class. */ public void visitNewClass(JCNewClass tree) { ClassSymbol c = (ClassSymbol)tree.constructor.owner; addFreeVars(c); if (tree.encl == null && c.hasOuterInstance() && outerThisStack.head != null) visitSymbol(outerThisStack.head); super.visitNewClass(tree); }
public void visitNewClass(JCNewClass tree) { if (tree.clazz.hasTag(ANNOTATED_TYPE)) { checkForDeclarationAnnotations(((JCAnnotatedType) tree.clazz).annotations, tree.clazz.type.tsym); } if (tree.def != null) { checkForDeclarationAnnotations(tree.def.mods.annotations, tree.clazz.type.tsym); } if (tree.clazz.type != null) { validateAnnotatedType(tree.clazz, tree.clazz.type); } super.visitNewClass(tree); } public void visitNewArray(JCNewArray tree) {
public void visitNewClass(JCNewClass tree) { if (tree.clazz != null && tree.clazz.type != null) { if (tree.clazz.hasTag(ANNOTATED_TYPE)) { checkForDeclarationAnnotations(((JCAnnotatedType) tree.clazz).annotations, tree.clazz.type.tsym); } if (tree.def != null) { checkForDeclarationAnnotations(tree.def.mods.annotations, tree.clazz.type.tsym); } validateAnnotatedType(tree.clazz, tree.clazz.type); } super.visitNewClass(tree); } public void visitNewArray(JCNewArray tree) {
@Override public void visitNewClass(JCNewClass tree) { super.visitNewClass(tree); Symbol c = tree.constructor != null ? tree.constructor.owner : null; if (c != null && c.hasOuterInstance()) { if (tree.encl == null && c.isLocal()) { checkThis(tree.pos(), c.type.getEnclosingType().tsym); } } }