(resent without attachment)

Hi,

Found another issue. When you the run [1] on JDK 7u1 (java -cp test.zip 
pkg1.Base) you get:

A.foo
A.foo
A.foo
A.foo
B.foo
C.foo
C.foo
Exception in thread "main" java.lang.NullPointerException
        at pkg3.B.invoke(B.java:10)
        at pkg1.Base.main(Base.java:20)

Note that pkg3/B.class has class file version 50, the other classes are all 51.

Regards,
Jeroen

[1] http://www.frijters.net/test-20111019.zip


> -----Original Message-----
> From: [email protected] [mailto:jvm-
> [email protected]] On Behalf Of Jeroen Frijters
> Sent: Wednesday, October 19, 2011 13:55
> To: [email protected]
> Subject: RE: [jvm-l] Package protected and virtual/non-virtual dispatch
> 
> John Rose wrote:
> > Alex Buckley has been diligently tracking this and dozens of other
> > small defects in previous versions of the spec.  The results can be
> > seen in the Java SE 7 Edition of the JVM Specification.  This is in
> > JSR 336's Final Release (Annex 3) and at
> > http://download.oracle.com/javase/cmn/spec_index.html.  It has a
> > modest little section called "5.4.5 Method overriding", which
> > documents the behavior you are asking about.
> 
> Thanks for the link.
> 
> Maybe I'm misunderstanding what it says, but I'm thoroughly confused by
> HotSpot behavior:
> 
> package p1;
> class Z { public void foo() { } }
> 
> package p2;
> class A extends Z { void foo() { } }
> 
> package p3;
> class C extends A { void foo() { } }
> 
> Here A.foo clearly overrides Z.foo and according to my understand of
> 5.4.5 C.foo should not override A.foo.
> 
> Now the weird part, on HotSpot when C has class file version 51 C.foo
> does override A.foo, but for earlier class file versions it doesn't.
> 
> It looks to me as if the spec documents the pre-7 HotSpot behavior.
> 
> Regards,
> Jeroen
> 
> --
> You received this message because you are subscribed to the Google
> Groups "JVM Languages" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to jvm-
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/jvm-languages?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.

Reply via email to