-
-
Notifications
You must be signed in to change notification settings - Fork 5
CUpgrade
The CUpgrade
annotation can be used to upgrade a class to a new version.
This only sets the class version, it does not change the class itself.
This is useful when injecting into a class compiled with an older version of Java with the transformer being compiled with a newer version of Java.
One example for this is the StringConcatFactory
which was added in newer Java versions.
Java would complain when using it in a class compiled with an older version of Java.
The target version is automatically set to the version of the transformer.
This can be changed manually by setting the value
parameter to the target version.
If the version of the target class is higher than the target version, this will do nothing.
Using the transformer version:
@CUpgrade
@CTransformer(TestClass.class)
public class Transformer {
Using a custom version:
@CUpgrade(Opcodes.V17)
@CTransformer(TestClass.class)
public class Transformer {