This content has been marked as final.
Show 1 reply
-
1. Re: error reloading a class
cat4hire Feb 11, 2008 2:49 AM (in response to cat4hire)Just to make it clearer:
* the interface I'm going to apply will remain the same during the whole program, and so I guess it can be loaded by a parent (even root) loader;
* the class to which the interface will be applied can change during the program execution, and so should be loaded by a custom classloader.
The actual hierarchy of the loaders is:
root (loads the interface to add)
| \
| \
| custom_add (loads the class with the interface)
custom_remove (loads the class without the added interface)
So my question is: why the addition can work and the removal not? I mean, after the class has been reloaded by custom_add, I can cast the class to the added interface, while after reloading it with custom_remove I _can still_ cast it to the interface.