Is there a way to change/define the value a methods is returning using the eclipse debugger if it has not been assigned to an intermediate variable before?
E.g. I have some third party closed source code that calls java.lang.Class.classForName, which looks like this
public static Class<?> forName(String className)
throws ClassNotFoundException {
return forName0(className, true, ClassLoader.getCallerClassLoader());
}
The classloader that is obtained by ClassLoader.getCallerClassLoader() fails to load the class so I want to try whether Thread.currentThread().contextClassLoader is more lucky. So virtually, I want something like:
public static Class<?> forName(String className)
throws ClassNotFoundException {
return forName0(className, true, Thread.currentThread().contextClassLoader);
}
Is this possible somehow? Note that forName0 is a native method.