# Friday, 04 November 2011
« Java Method Overriding Is FUBAR Part 2 o... | Main | Java Method Overriding Is FUBAR Part 4 o... »
Java Method Overriding Is FUBAR Part 3 of ∞

For another example of weird JDK 7 behavior, start with the code from part 2 and make B.foo final.

When you run that you get:

C.foo
B.foo

So now C.foo suddenly doesn't override B.foo. This also violates the spec, because when a method that would have been overridden is marked final the verifier should fail to load the class. This shows that the verifier and vtable layout code have different ideas about method overriding semantics.

Friday, 04 November 2011 07:33:47 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]