I worked some more on the
ProperObjectSuperClassStrategy and decided that it probably shouldn’t do the renaming itself. I have a
ChangeCallTargetInstrumentationStrategy for that. So now I’m adding static methods and
<init> to the list of calls that need to be changed.
Now I’m running into a problem with the static initializer,
java.lang.IllegalAccessError: tried to access method java.lang.Object.<clinit>()V from class edu.rice.cs.cunit.ProperObject at edu.rice.cs.cunit.ProperObject.<clinit>(Unknown Source) Exception in thread "main"
Now I have to figure out what exception I need to make exactly… when does
<init> exactly get called?
As it turns out, it’s never called explicitly:
A class or interface has at most one class or interface initialization method and is initialized (§2.17.4) by invoking that method. The initialization method of a class or interface is static and takes no arguments. It has the special name
<init>. This name is supplied by a compiler. Because the name
<init>is not a valid identifier, it cannot be used directly in a program written in the Java programming language. Class and interface initialization methods are invoked implicitly by the Java virtual machine; they are never invoked directly from any Java virtual machine instruction, but are invoked only indirectly as part of the class initialization process.
That means I just have to exclude
<init> from being put in the decorator.