if ((origin.flags() & ENUM) != 0 && names.finalize.equals(m.name)) if (m.overrides(syms.enumFinalFinalize, origin, types, false)) { log.error(tree.pos(), "enum.no.finalize"); return; DiagnosticPosition pos = tree.pos(); for (JCAnnotation a : tree.getModifiers().annotations) { if (a.annotationType.type.tsym == syms.overrideType.tsym) {
JCVariableDecl nameParam = make_at(tree.pos()). Param(names.fromString(target.syntheticNameChar() + "enum" + target.syntheticNameChar() + "name"),
if (sym != tree.sym && types.isSameType(types.erasure(sym.type), type) && !sym.type.isErroneous() && !type.isErroneous()) { log.error(tree.pos(), "name.clash.same.erasure", tree.sym, sym); //NOI18N return;
JCVariableDecl nameParam = make_at(tree.pos()). Param(names.fromString(target.syntheticNameChar() + "enum" + target.syntheticNameChar() + "name"),
public void visitMethodDef(JCMethodDecl tree) { Scope enclScope = enter.enterScope(env); MethodSymbol m = new MethodSymbol(0, tree.name, null, enclScope.owner); m.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, m, tree); tree.sym = m; Env<AttrContext> localEnv = methodEnv(tree, env); // Compute the method type m.type = signature(tree.typarams, tree.params, tree.restype, tree.thrown, localEnv); // Set m.params ListBuffer<VarSymbol> params = new ListBuffer<VarSymbol>(); JCVariableDecl lastParam = null; for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) { JCVariableDecl param = lastParam = l.head; assert param.sym != null; params.append(param.sym); } m.params = params.toList(); // mark the method varargs, if necessary if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0) m.flags_field |= Flags.VARARGS; localEnv.info.scope.leave(); if (chk.checkUnique(tree.pos(), m, enclScope)) { enclScope.enter(m); } annotateLater(tree.mods.annotations, localEnv, m); if (tree.defaultValue != null) annotateDefaultValueLater(tree.defaultValue, localEnv, m); }
public void visitMethodDef(JCMethodDecl tree) { JCTree previousMethod = currentMethod; try { currentMethod = tree; tree.restype = translate(tree.restype, null); tree.typarams = List.nil(); tree.params = translateVarDefs(tree.params); tree.recvparam = translate(tree.recvparam, null); tree.thrown = translate(tree.thrown, null); tree.body = translate(tree.body, tree.sym.erasure(types).getReturnType()); tree.type = erasure(tree.type); result = tree; } finally { currentMethod = previousMethod; } // Check that we do not introduce a name clash by erasing types. for (Scope.Entry e = tree.sym.owner.members().lookup(tree.name); e.sym != null; e = e.next()) { if (e.sym != tree.sym && types.isSameType(erasure(e.sym.type), tree.type)) { log.error(tree.pos(), "name.clash.same.erasure", tree.sym, e.sym); return; } } }
public void visitMethodDef(JCMethodDecl tree) { JCMethodDecl previousMethod = currentMethod; try { currentMethod = tree; tree.restype = translate(tree.restype, null); tree.typarams = List.nil(); tree.params = translateVarDefs(tree.params); tree.thrown = translate(tree.thrown, null); tree.body = translate(tree.body, tree.sym.erasure(types).getReturnType()); tree.type = erasure(tree.type); result = tree; } finally { currentMethod = previousMethod; } // Check that we do not introduce a name clash by erasing types. for (Scope.Entry e = tree.sym.owner.members().lookup(tree.name); e.sym != null; e = e.next()) { if (e.sym != tree.sym && types.isSameType(erasure(e.sym.type), tree.type)) { log.error(tree.pos(), "name.clash.same.erasure", tree.sym, e.sym); return; } } }
public void visitMethodDef(JCMethodDecl tree) { JCTree previousMethod = currentMethod; try { currentMethod = tree; tree.restype = translate(tree.restype, null); tree.typarams = List.nil(); tree.params = translateVarDefs(tree.params); tree.recvparam = translate(tree.recvparam, null); tree.thrown = translate(tree.thrown, null); tree.body = translate(tree.body, tree.sym.erasure(types).getReturnType()); tree.type = erasure(tree.type); result = tree; } finally { currentMethod = previousMethod; } // Check that we do not introduce a name clash by erasing types. for (Scope.Entry e = tree.sym.owner.members().lookup(tree.name); e.sym != null; e = e.next()) { if (e.sym != tree.sym && types.isSameType(erasure(e.sym.type), tree.type)) { log.error(tree.pos(), "name.clash.same.erasure", tree.sym, e.sym); return; } } }
public void visitMethodDef(JCMethodDecl tree) { JCMethodDecl previousMethod = currentMethod; try { currentMethod = tree; tree.restype = translate(tree.restype, null); tree.typarams = List.nil(); tree.params = translateVarDefs(tree.params); tree.thrown = translate(tree.thrown, null); tree.body = translate(tree.body, tree.sym.erasure(types).getReturnType()); tree.type = erasure(tree.type); result = tree; } finally { currentMethod = previousMethod; } // Check that we do not introduce a name clash by erasing types. for (Scope.Entry e = tree.sym.owner.members().lookup(tree.name); e.sym != null; e = e.next()) { if (e.sym != tree.sym && types.isSameType(erasure(e.sym.type), tree.type)) { log.error(tree.pos(), "name.clash.same.erasure", tree.sym, e.sym); return; } } }
public void visitMethodDef(JCMethodDecl tree) { Scope enclScope = enter.enterScope(env); MethodSymbol m = new MethodSymbol(0, tree.name, null, enclScope.owner); m.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, m, tree); tree.sym = m; Env<AttrContext> localEnv = methodEnv(tree, env); // Compute the method type m.type = signature(tree.typarams, tree.params, tree.restype, tree.thrown, localEnv); // Set m.params ListBuffer<VarSymbol> params = new ListBuffer<VarSymbol>(); JCVariableDecl lastParam = null; for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) { JCVariableDecl param = lastParam = l.head; assert param.sym != null; params.append(param.sym); } m.params = params.toList(); // mark the method varargs, if necessary if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0) m.flags_field |= Flags.VARARGS; localEnv.info.scope.leave(); if (chk.checkUnique(tree.pos(), m, enclScope)) { enclScope.enter(m); } annotateLater(tree.mods.annotations, localEnv, m); if (tree.defaultValue != null) annotateDefaultValueLater(tree.defaultValue, localEnv, m); }
/** Check for cycles in the graph of annotation elements. */ void checkNonCyclicElements(JCClassDecl tree) { if ((tree.sym.flags_field & ANNOTATION) == 0) return; Assert.check((tree.sym.flags_field & LOCKED) == 0); try { tree.sym.flags_field |= LOCKED; for (JCTree def : tree.defs) { if (!def.hasTag(METHODDEF)) continue; JCMethodDecl meth = (JCMethodDecl)def; checkAnnotationResType(meth.pos(), meth.restype.type); } } finally { tree.sym.flags_field &= ~LOCKED; tree.sym.flags_field |= ACYCLIC_ANN; } }
/** Check for cycles in the graph of annotation elements. */ void checkNonCyclicElements(JCClassDecl tree) { if ((tree.sym.flags_field & ANNOTATION) == 0) return; assert (tree.sym.flags_field & LOCKED) == 0; try { tree.sym.flags_field |= LOCKED; for (JCTree def : tree.defs) { if (def.tag != JCTree.METHODDEF) continue; JCMethodDecl meth = (JCMethodDecl)def; checkAnnotationResType(meth.pos(), meth.restype.type); } } finally { tree.sym.flags_field &= ~LOCKED; tree.sym.flags_field |= ACYCLIC_ANN; } }
/** Check for cycles in the graph of annotation elements. */ void checkNonCyclicElements(JCClassDecl tree) { if ((tree.sym.flags_field & ANNOTATION) == 0) return; Assert.check((tree.sym.flags_field & LOCKED) == 0); try { tree.sym.flags_field |= LOCKED; for (JCTree def : tree.defs) { if (!def.hasTag(METHODDEF)) continue; JCMethodDecl meth = (JCMethodDecl)def; checkAnnotationResType(meth.pos(), meth.restype.type); } } finally { tree.sym.flags_field &= ~LOCKED; tree.sym.flags_field |= ACYCLIC_ANN; } }
/** Check for cycles in the graph of annotation elements. */ void checkNonCyclicElements(JCClassDecl tree) { if ((tree.sym.flags_field & ANNOTATION) == 0) return; assert (tree.sym.flags_field & LOCKED) == 0; try { tree.sym.flags_field |= LOCKED; for (JCTree def : tree.defs) { if (def.getTag() != JCTree.METHODDEF) continue; JCMethodDecl meth = (JCMethodDecl)def; checkAnnotationResType(meth.pos(), meth.restype.type); } } finally { tree.sym.flags_field &= ~LOCKED; tree.sym.flags_field |= ACYCLIC_ANN; } }
@Override public void visitMethodDef(JCMethodDecl that) { chk.checkConflicts(that.pos(), that.sym, currentClass); super.visitMethodDef(that); }
public void visitMethodDef(JCMethodDecl tree) { // Create a new local environment that points pack at method // definition. Env<GenContext> localEnv = env.dup(tree); localEnv.enclMethod = tree; // The expected type of every return statement in this method // is the method's return type. this.pt = tree.sym.erasure(types).getReturnType(); checkDimension(tree.pos(), tree.sym.erasure(types)); genMethod(tree, localEnv, false); } //where
public void visitMethodDef(JCMethodDecl tree) { // Create a new local environment that points pack at method // definition. Env<GenContext> localEnv = env.dup(tree); localEnv.enclMethod = tree; // The expected type of every return statement in this method // is the method's return type. this.pt = tree.sym.erasure(types).getReturnType(); checkDimension(tree.pos(), tree.sym.erasure(types)); genMethod(tree, localEnv, false); } //where
public void visitMethodDef(JCMethodDecl tree) { // Create a new local environment that points pack at method // definition. Env<GenContext> localEnv = env.dup(tree); localEnv.enclMethod = tree; // The expected type of every return statement in this method // is the method's return type. this.pt = tree.sym.erasure(types).getReturnType(); checkDimension(tree.pos(), tree.sym.erasure(types)); genMethod(tree, localEnv, false); } //where
@Override public void visitMethodDef(JCMethodDecl that) { chk.checkConflicts(that.pos(), that.sym, currentClass); super.visitMethodDef(that); }
public void visitMethodDef(JCMethodDecl tree) { // Create a new local environment that points pack at method // definition. Env<GenContext> localEnv = env.dup(tree); localEnv.enclMethod = tree; // The expected type of every return statement in this method // is the method's return type. this.pt = tree.sym.erasure(types).getReturnType(); checkDimension(tree.pos(), tree.sym.erasure(types)); genMethod(tree, localEnv, false); } //where