[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cp-patches] FYI: Tiny Throwable StaticData optimization
From: |
Jeroen Frijters |
Subject: |
RE: [cp-patches] FYI: Tiny Throwable StaticData optimization |
Date: |
Mon, 27 Sep 2004 08:01:57 +0200 |
Mark Wielaard wrote:
> When printing a Throwable we get the line separator from the
> StaticData inner class. By making the nl field of this inner class
> package local a byte code compiler doesn't have to generate a
> accessor method for this field.
Damn, I thought I knew every corner of the Java language. Why on earth
should an outer class be able to access private members of an inner
class?
<compilerTrivia mode="extremelyUseless">
The (now dead) Microsoft J++ compiler just changed private fields and
methods to package accessible instead of creating these (lame) accessor
methods (and it also added an attribute to record the real
accessibility). I used to think this was pretty clever, but I just
realized that for instance methods it isn't such a great idea, because
package methods are virtual while private methods aren't. So you can end
up accidentally overriding a private method.
</compilerTrivia>
Regards,
Jeroen