Please review java.util.jar.pack.* exceptions
mike.duigou at oracle.com
Wed Nov 3 22:32:16 UTC 2010
- You may want to consider using getLocalizedMessage() rather than getMessage(). If there is a localized version of the IllegalStateException message then the result will be a stack dump that begins with the unlocalized version of the message followed by a "Caused by" section which will display the localized version.
On Nov 3 2010, at 15:12 , Kumar Srinivasan wrote:
> Thanks for all the reviews and suggestions!
> the new version is at:
> In this revision:
> 1. the input parameter is renamed to "in",
> btw. we call out throwing of NPEs at the package level documentation
> I copied the same verbiage to the interfaces sections as well.
> 2. moved the exception check into scanJar, per Alan's suggestion where it is
> isolated to catch IllegalStateException and wraps it up into an IOE.
>> Kumar Srinivasan wrote:
>>> These are simple changes to the java.util.jar.pack:
>>> * fixes JCK failures, specifically throwing unexpected exceptions
>>> * minor fixes to the ClassFormatException
>>> * added a new test to catch the JCK type failures up-front, which is
>>> bulk of the code changes.
>> Kumar - would it be better if scanJar just handled the closed JAR case by catching the IllegalStateException and re-throwing it as an IOException? I assume other runtime exceptions are other bugs that you won't have translated into I/O exceptions.
More information about the core-libs-dev