Changeset 3007
- Timestamp:
- 07/12/05 02:14:24 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/jp1_07g-hotfix/gj/src/gjc/v6/jp/TransBody.java
r2712 r3007 398 398 // Find referenced enclosing type the accessed 399 399 // variable belongs to. See See: BUG/0063 400 boolean definedInOuterClass = false; 400 401 Type vowner = var.owner.type; 401 402 Type cclazz = c.clazz.type; 402 403 while (! cclazz.subType(vowner)) { 403 404 cclazz = cclazz.outer(); 405 definedInOuterClass = true; 404 406 } 405 407 … … 413 415 c.f.at(Position.NOPOS); 414 416 ref = c.f.Ident(Names._this); 415 } else if (tools.isFinal(var)) {416 // This is another great hack, because417 // final variables can not be initialized418 // with a fully qualified name, even with419 // javac. Is this a bug in javac and gj?420 c.f.at(Position.NOPOS);421 ref = c.f.Ident(Names._this);422 417 } else if (! tools.hasRef(cclazz.tsym)) { 423 418 // A instance variable of an anonymous … … 427 422 ref = null; 428 423 } else { 429 c.f.at(Position.NOPOS); 430 ref = c.f.Select(tools.getRef(cclazz.tsym), Names._this); 424 if (definedInOuterClass) { 425 c.f.at(Position.NOPOS); 426 ref = c.f.Select(tools.getRef(cclazz.tsym), Names._this); 427 } else { 428 c.f.at(Position.NOPOS); 429 ref = c.f.Ident(Names._this); 430 } 431 431 } 432 432 isStaticRef = false;
Note: See TracChangeset
for help on using the changeset viewer.
