((VarSymbol)sym).setData(v); } else if (attrName == names.Code) { if (readAllOfClassFile || saveParameterNames)
((VarSymbol)sym).setData(v); } else if (attrName == names.Code) { if (readAllOfClassFile || saveParameterNames)
public void setLazyConstValue(final Env<AttrContext> env, final Log log, final Attr attr, final JCTree.JCExpression initializer) { setData(new Callable<Object>() { public Object call() { JavaFileObject source = log.useSource(env.toplevel.sourcefile); try { // In order to catch self-references, we set // the variable's declaration position to // maximal possible value, effectively marking // the variable as undefined. int pos = VarSymbol.this.pos; VarSymbol.this.pos = Position.MAXPOS; Type itype = attr.attribExpr(initializer, env, type); VarSymbol.this.pos = pos; if (itype.constValue() != null) return attr.coerce(itype, type).constValue(); else return null; } finally { log.useSource(source); } } }); }
public void setLazyConstValue(final Env<AttrContext> env, final Log log, final Attr attr, final JCTree.JCExpression initializer) { setData(new Callable<Object>() { public Object call() { JavaFileObject source = log.useSource(env.toplevel.sourcefile); try { // In order to catch self-references, we set // the variable's declaration position to // maximal possible value, effectively marking // the variable as undefined. int pos = VarSymbol.this.pos; VarSymbol.this.pos = Position.MAXPOS; Type itype = attr.attribExpr(initializer, env, type); VarSymbol.this.pos = pos; if (itype.constValue() != null) return attr.coerce(itype, type).constValue(); else return null; } finally { log.useSource(source); } } }); }
public void visitTry(JCTry tree) { // Attribute body attribStat(tree.body, env.dup(tree, env.info.dup())); // Attribute catch clauses for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) { JCCatch c = l.head; Env<AttrContext> catchEnv = env.dup(c, env.info.dup(env.info.scope.dup())); Type ctype = attribStat(c.param, catchEnv); if (c.param.type.tsym.kind == Kinds.VAR) { c.param.sym.setData(ElementKind.EXCEPTION_PARAMETER); } chk.checkType(c.param.vartype.pos(), chk.checkClassType(c.param.vartype.pos(), ctype), syms.throwableType); attribStat(c.body, catchEnv); catchEnv.info.scope.leave(); } // Attribute finalizer if (tree.finalizer != null) attribStat(tree.finalizer, env); result = null; }
public void visitTry(JCTry tree) { // Attribute body attribStat(tree.body, env.dup(tree, env.info.dup())); // Attribute catch clauses for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) { JCCatch c = l.head; Env<AttrContext> catchEnv = env.dup(c, env.info.dup(env.info.scope.dup())); Type ctype = attribStat(c.param, catchEnv); if (c.param.type.tsym.kind == Kinds.VAR) { c.param.sym.setData(ElementKind.EXCEPTION_PARAMETER); } chk.checkType(c.param.vartype.pos(), chk.checkClassType(c.param.vartype.pos(), ctype), syms.throwableType); attribStat(c.body, catchEnv); catchEnv.info.scope.leave(); } // Attribute finalizer if (tree.finalizer != null) attribStat(tree.finalizer, env); result = null; }
/** Enter a constant into symbol table. * @param name The constant's name. * @param type The constant's type. */ private VarSymbol enterConstant(String name, Type type) { VarSymbol c = new VarSymbol( PUBLIC | STATIC | FINAL, names.fromString(name), type, predefClass); c.setData(type.constValue()); predefClass.members().enter(c); return c; }
/** Enter a constant into symbol table. * @param name The constant's name. * @param type The constant's type. */ private VarSymbol enterConstant(String name, Type type) { VarSymbol c = new VarSymbol( PUBLIC | STATIC | FINAL, names.fromString(name), type, predefClass); c.setData(type.constValue()); predefClass.members().enter(c); return c; }
/** Enter a constant into symbol table. * @param name The constant's name. * @param type The constant's type. */ private VarSymbol enterConstant(String name, Type type) { VarSymbol c = new VarSymbol( PUBLIC | STATIC | FINAL, names.fromString(name), type, predefClass); c.setData(type.constValue()); predefClass.members().enter(c); return c; }
/** Enter a constant into symbol table. * @param name The constant's name. * @param type The constant's type. */ private VarSymbol enterConstant(String name, Type type) { VarSymbol c = new VarSymbol( PUBLIC | STATIC | FINAL, names.fromString(name), type, predefClass); c.setData(type.constValue()); predefClass.members().enter(c); return c; }
protected void read(Symbol sym, int attrLen) { Object v = readPool(nextChar()); // Ignore ConstantValue attribute if field not final. if ((sym.flags() & FINAL) != 0) ((VarSymbol) sym).setData(v); } },
public void setLazyConstValue(final Env<AttrContext> env, final Attr attr, final JCVariableDecl variable) { setData(new Callable<Object>() { public Object call() { return attr.attribLazyConstantValue(env, variable, type); } }); }
public void setLazyConstValue(final Env<AttrContext> env, final Attr attr, final JCVariableDecl variable) { setData(new Callable<Object>() { public Object call() { return attr.attribLazyConstantValue(env, variable, type); } }); }
protected void read(Symbol sym, int attrLen) { Object v = readPool(nextChar()); // Ignore ConstantValue attribute if field not final. if ((sym.flags() & FINAL) != 0) ((VarSymbol) sym).setData(v); } },