I have a class com.example.TestClass
which is in a JAR archive. Now, in my project (which uses the aforementioned JAR) I want to use a modified version of the class.
What I have tried so far was to create the very same class and package in my project's src
directory, because I was hoping that it would be used during class loading, but unfortunately, that didn't work.
I have read about Javaassist, but I only want to restort to it unless absolutely necessary.
Do you have any suggestions?