This is the mail archive of the java-prs@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcj/298


The following reply was made to PR gcj/298; it has been noted by GNATS.

From: Tom Tromey <tromey@cygnus.com>
To: Alexandre Petit-Bianco <apbianco@cygnus.com>
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/298
Date: 31 Oct 2000 17:48:25 -0700

 Alex>  class List {
 Alex>          void foo () {}
 Alex>  }
 Alex>  class LinkedList extends List {
 Alex>      class Entry {
 Alex>          void x () { foo (); }
 Alex>          public void foo () {}
 Alex>      }
 Alex>  }
  
 Alex>  Jikes and Javac found that LinkedList$Entry.foo is more
 Alex>  specific than List.foo. I don't know what criterion they used.
 
 To me it makes sense that an inner class' method is more specific than
 one from the outer context.  I think `this.foo()' is more specific
 than `this$0.foo'.
 
 I looked here:
 
 http://java.sun.com/docs/books/jls/html/1.1Update.html
 
 and I saw this sentence:
 
     When resolving identifiers, the inner class's enclosing object (also
     called its enclosing instance) is searched for fields and methods
     after the class's own this.
 
 This implies the rule that Jikes follows.
 
 Am I missing something?
 
 Tom

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]