On 03/07/2014 07:24, Marvin Humphrey wrote:
What happens if a newer com.example.stuff is loaded with a FooJr which implements Say_Hello()? Invocations on MyFinalFoo will invoke the wrong function: the old one in Foo rather than the new one in FooJr.
Good catch. I agree with your analysis.
I believe that we can only avoid vtable dispatch for methods which are known to be final because they are explicitly declared as final or because they are contained within a final class.
We could also call a method directly if a class is declared as final and the method is defined somewhere in the same parcel. It's probably not a great optimization in the general case but it would make sense for the Clownfish parcel.
Nick
