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