This is the mail archive of the java-patches@gcc.gnu.org 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]
Other format: [Raw text]

Re: PR libgcj/25265 second part: Throw NoSuchFieldError for missing fields


Andrew Haley wrote:
This is the second part of the patch, the part that defers throwing a
NoSuchFieldError until we try to use a missing field.

Unfortunately, this really requires us to insert some
compiler-generated code. On the plus side, this is only necessary
when accessing fields that beling to some other class, and in
Object-Oriented programming we really aren't supposed to do that sort
of thing. So it doesn't matter. ;-)

Accessing fields across public class boundaries frowned upon, but I don't think it is unusual in some other cases. eg: It seems reasonably common to access fields directly when:


- the field accesses are between nested classes
- the fields are in a superclass

Classpath, for example, has many examples of the first type in particular. Of course, I don't see any better way to fix this, but it would be interesting to see what effect (if any) this change has on Dacapo/SpecJVM scores.

Bryce


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