Recently I wrote a post about a catalyst method in Java – an issue where an existence of a method that is never actually invoked can affect the code execution. The trick was that the way compiler created bytecode for static method was ambiguous for this given code snippet and therefore JVM resolved it incorrectly.
The [...]
Puzzler: the catalyst method does not work
A catalyst method in Java
This post is inspired by an entry on twofoos.org blog.
Imagine that you have a code that invokes a method – lets call it ‘A’. Now is it possible that by adding another method (B) to the code I can make that invocation redirect to executing B instead of A? Sure! It’s simple stuff – [...]