RFC: Netx - Fix service exceptions thrown by the proxy
omajid at redhat.com
Tue Jun 16 06:57:28 PDT 2009
Deepak Bhole wrote:
> * Omair Majid <omajid at redhat.com> [2009-06-15 16:39]:
>> Netx uses dynamic proxies to wrap all calls to the various JNLP services
>> and run them in privileged mode. If any method called throws an
>> exception, it is wrapped in a InvocationTargetException. And then in a
>> PrivilegedActionException. Now a client JNLP program doesnt know (and
>> shouldnt know!) that we are using proxies. So it gets a totally
>> unexpected exception and cant deal with the situation properly. 
>> describes the bug in much more detail.
>> The attached patch fixes the problem by throwing the exception that
>> caused the problem.
> Looks good. Can you change the getCause() in case of ITE to be
> getTargetException instead? From the last line on the link you posted:
> One commenter noted that InvocationTargetException.getTargetException()
> should be used instead of getCause(). The two methods are actually
> equivalent for InvocationTargetException, so using either works.
I was going to use getTargetException() but then I saw this note in the
java-docs : "The Throwable.getCause() method is now the preferred
means of obtaining this information". I have no preference either way;
what do you think makes more sense?
> After above change, good to commit.
Thanks for the review.
More information about the distro-pkg-dev