On Wed, 17 Nov 2021 18:43:46 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

> > There appears to be a similar test, 
> > open/test/jdk/java/util/zip/ZipFile/Comment.java, I think we probably want 
> > to fold your changes into the existing test and possibly convert to use 
> > TestNG.
> 
> I know that test, and I explicitly created a new one, since the old one 
> covers the positive cases of reading the different comments from the data by 
> the ZipFile including an empty comment. This one is different, it checks the 
> different use-cases all of which cause to save the empty comment into the 
> data.
> 
> > If you prefer to keep this test separate, the test should have expanded 
> > coverage to validate that a comment that is set can be successfully read 
> > back and the test should be renamed as it does more than just validate an 
> > Empty/null comment.
> 
> It is already checked by the ZipFile test cases.
> 
> > To be: writeBytes(comment, 0, 0, Math.min(comment.length, 0xffff));
> > Which is done when writing an entry comment out in writeCEN.
> 
> It has a different implementation because of different specifications, the 
> writeCEN codepath specified to cut long comments and save the first part, 
> this method specified an exception to be thrown if a comment is too long-> an 
> empty comment is saved.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6380

Reply via email to