langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java
changeset 1260 a772ba9ba43d
parent 1037 c6b315a34dc6
child 1468 19d266637353
equal deleted inserted replaced
1259:61142e0aeb3f 1260:a772ba9ba43d
    62         if (instance == null)
    62         if (instance == null)
    63             instance = new Lower(context);
    63             instance = new Lower(context);
    64         return instance;
    64         return instance;
    65     }
    65     }
    66 
    66 
    67     private Name.Table names;
    67     private Names names;
    68     private Log log;
    68     private Log log;
    69     private Symtab syms;
    69     private Symtab syms;
    70     private Resolve rs;
    70     private Resolve rs;
    71     private Check chk;
    71     private Check chk;
    72     private Attr attr;
    72     private Attr attr;
    83     private Types types;
    83     private Types types;
    84     private boolean debugLower;
    84     private boolean debugLower;
    85 
    85 
    86     protected Lower(Context context) {
    86     protected Lower(Context context) {
    87         context.put(lowerKey, this);
    87         context.put(lowerKey, this);
    88         names = Name.Table.instance(context);
    88         names = Names.instance(context);
    89         log = Log.instance(context);
    89         log = Log.instance(context);
    90         syms = Symtab.instance(context);
    90         syms = Symtab.instance(context);
    91         rs = Resolve.instance(context);
    91         rs = Resolve.instance(context);
    92         chk = Check.instance(context);
    92         chk = Check.instance(context);
    93         attr = Attr.instance(context);
    93         attr = Attr.instance(context);
  1828             if ((id.sym.flags() & FINAL) != 0 && id.sym.owner.kind == MTH)
  1828             if ((id.sym.flags() & FINAL) != 0 && id.sym.owner.kind == MTH)
  1829                 return builder.build(rval);
  1829                 return builder.build(rval);
  1830         }
  1830         }
  1831         VarSymbol var =
  1831         VarSymbol var =
  1832             new VarSymbol(FINAL|SYNTHETIC,
  1832             new VarSymbol(FINAL|SYNTHETIC,
  1833                           Name.fromString(names,
  1833                           names.fromString(
  1834                                           target.syntheticNameChar()
  1834                                           target.syntheticNameChar()
  1835                                           + "" + rval.hashCode()),
  1835                                           + "" + rval.hashCode()),
  1836                                       type,
  1836                                       type,
  1837                                       currentMethodSym);
  1837                                       currentMethodSym);
  1838         rval = convert(rval,type);
  1838         rval = convert(rval,type);
  3336         JCMethodDecl compareToDecl = (JCMethodDecl) TreeInfo.declarationFor(compareToSym, cdef);
  3336         JCMethodDecl compareToDecl = (JCMethodDecl) TreeInfo.declarationFor(compareToSym, cdef);
  3337 
  3337 
  3338         ListBuffer<JCStatement> blockStatements = new ListBuffer<JCStatement>();
  3338         ListBuffer<JCStatement> blockStatements = new ListBuffer<JCStatement>();
  3339 
  3339 
  3340         JCModifiers mod1 = make.Modifiers(0L);
  3340         JCModifiers mod1 = make.Modifiers(0L);
  3341         Name oName = Name.fromString(names, "o");
  3341         Name oName = names.fromString("o");
  3342         JCVariableDecl par1 = make.Param(oName, cdef.type, compareToSym);
  3342         JCVariableDecl par1 = make.Param(oName, cdef.type, compareToSym);
  3343 
  3343 
  3344         JCIdent paramId1 = make.Ident(names.java_lang_Object);
  3344         JCIdent paramId1 = make.Ident(names.java_lang_Object);
  3345         paramId1.type = cdef.type;
  3345         paramId1.type = cdef.type;
  3346         paramId1.sym = par1.sym;
  3346         paramId1.sym = par1.sym;
  3350         JCIdent par1UsageId = make.Ident(par1.sym);
  3350         JCIdent par1UsageId = make.Ident(par1.sym);
  3351         JCIdent castTargetIdent = make.Ident(cdef.sym);
  3351         JCIdent castTargetIdent = make.Ident(cdef.sym);
  3352         JCTypeCast cast = make.TypeCast(castTargetIdent, par1UsageId);
  3352         JCTypeCast cast = make.TypeCast(castTargetIdent, par1UsageId);
  3353         cast.setType(castTargetIdent.type);
  3353         cast.setType(castTargetIdent.type);
  3354 
  3354 
  3355         Name otherName = Name.fromString(names, "other");
  3355         Name otherName = names.fromString("other");
  3356 
  3356 
  3357         VarSymbol otherVarSym = new VarSymbol(mod1.flags,
  3357         VarSymbol otherVarSym = new VarSymbol(mod1.flags,
  3358                                               otherName,
  3358                                               otherName,
  3359                                               cdef.type,
  3359                                               cdef.type,
  3360                                               compareToSym);
  3360                                               compareToSym);