langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java
changeset 1045 56f6e84f7825
parent 939 38e24969c7e9
child 1257 873b053bf757
equal deleted inserted replaced
1044:7016e624ec3a 1045:56f6e84f7825
   921         {
   921         {
   922             setData(new Callable<Object>() {
   922             setData(new Callable<Object>() {
   923                 public Object call() {
   923                 public Object call() {
   924                     JavaFileObject source = log.useSource(env.toplevel.sourcefile);
   924                     JavaFileObject source = log.useSource(env.toplevel.sourcefile);
   925                     try {
   925                     try {
   926                         // In order to catch self-references, we set
       
   927                         // the variable's declaration position to
       
   928                         // maximal possible value, effectively marking
       
   929                         // the variable as undefined.
       
   930                         int pos = VarSymbol.this.pos;
       
   931                         VarSymbol.this.pos = Position.MAXPOS;
       
   932                         Type itype = attr.attribExpr(initializer, env, type);
   926                         Type itype = attr.attribExpr(initializer, env, type);
   933                         VarSymbol.this.pos = pos;
       
   934                         if (itype.constValue() != null)
   927                         if (itype.constValue() != null)
   935                             return attr.coerce(itype, type).constValue();
   928                             return attr.coerce(itype, type).constValue();
   936                         else
   929                         else
   937                             return null;
   930                             return null;
   938                     } finally {
   931                     } finally {