On 06/19/2014 01:39 AM, Wang Weijun wrote:
>570 public Void run() throws Exception {
>
>This can be declared to throw IOException, then you can change lines 586-591
to:
>
>throw pe.getException();
You mean javac will be smart enough to find out that pe's cause can only be
IOException? It does not compile here.
Sorry, you are right, you still need to cast it to IOException, but you
don't need to catch any other Exceptions. See the example/rationale in
the AccessController class description.
--Sean