If I have a reference to a class and invoke a method on it, and the class or the method is final, my understanding is that the compiler or the JVM would replace the dynamic disp
The Java Virtual Machine as of today does not care for the "final" keyword anymore (only for class assertions). Everything is considered final, unless a class is loaded which overrides the specified function, or provides another implementation of it in case of an interface.
This results in multiple compilations of code if classes are loaded dynamically at runtime after the JIT compiler has already compiled something which it thought of as being final, but the gains seem to be wotrth the hassle.
I don't have a link to the paper about it, but I read it some weeks ago (and maybe its just in Java 7 like this).