-
Enhancement
-
Resolution: Duplicate
-
P4
-
6u23
-
x86
-
linux
A DESCRIPTION OF THE REQUEST :
The Proxy.getProxyClass() method displays a confusing message when one of the parameter Class has been loaded from a different classLoader.
For example, let's say I have 2 webapps (A and B), with the same jar (test.jar) which contains the class com.example.Test.
If I call Proxy.getProxyClass(ClassLoaderOfA, Test), with "Test" loaded by B, I get an IllegalArgumentException with the message "Test is not visible by the classLoader". This is wrong : Test class is visible by the classLoader of A, because webapp A got the test.jar too.
There is a 3 cases scenario here :
1) The class is found, and loaded from the right classLoader --> Ok
2) The class is found, but loaded from a different classLoader --> Tell the user that the class comes from another classLoader
3) The class is not found --> Tell the user that the class is not visible by the classLoader
JUSTIFICATION :
Instead of saying that the class is not visible, it should be said that the given class comes from a different classLoader, and still throw an IllegalArgumentException.
The actual message is wrong for end user comprehension, and misleading.
The Proxy.getProxyClass() method displays a confusing message when one of the parameter Class has been loaded from a different classLoader.
For example, let's say I have 2 webapps (A and B), with the same jar (test.jar) which contains the class com.example.Test.
If I call Proxy.getProxyClass(ClassLoaderOfA, Test), with "Test" loaded by B, I get an IllegalArgumentException with the message "Test is not visible by the classLoader". This is wrong : Test class is visible by the classLoader of A, because webapp A got the test.jar too.
There is a 3 cases scenario here :
1) The class is found, and loaded from the right classLoader --> Ok
2) The class is found, but loaded from a different classLoader --> Tell the user that the class comes from another classLoader
3) The class is not found --> Tell the user that the class is not visible by the classLoader
JUSTIFICATION :
Instead of saying that the class is not visible, it should be said that the given class comes from a different classLoader, and still throw an IllegalArgumentException.
The actual message is wrong for end user comprehension, and misleading.
- duplicates
-
JDK-8302791 Add specific ClassLoader object to Proxy IllegalArgumentException message
-
- Resolved
-