On 02/08/2011 5:07 PM, Patricia Shanahan wrote:
...
It seems to generally do the most useful thing it could, but I really
would like documentation that would let me predict the results without
running the experiments.
I wonder if Oracle isn't as committed to quality documentation (or,
perhaps, to Java at all) as Sun was. :(
I also wonder what happens with this:
public void method () throws SomeCheckedException,
SomeUnrelatedCheckedException {
try {
throwSomething();
} catch (SomeCheckedException | SomeUnrelatedCheckedException e) {
logger.log(e);
throw e;
}
}
Does this work? Or does method() need throws
LastCommonSupertypeOfThoseCheckedExceptions instead to avoid a compile
error?
I think this is covered by another extension. See
http://download.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html,
"Rethrowing Exceptions with More Inclusive Type Checking".