RFR: 8299864: ZipFileStore#supportsFileAttributeView(String) doesn't throw NPE

Lance Andersen lancea at openjdk.org
Tue Jan 10 17:34:57 UTC 2023


On Tue, 10 Jan 2023 15:26:05 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This PR proposes to add null-checking for some parameter arguments in `ZipFileStore`.

Thanks for taking this on Per.

I think we also need to add a test for getAttribute() and getFileStoreAttributeView() as I do not see  it being tested in test/jdk/jdk/nio/zipfs/ZipFSTester.java or test/jdk/jdk/nio/zipfs/Basic.java

A few more minor comments below:

src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileStore.java line 43:

> 41:  * @author Xueming Shen, Rajendra Gutupalli, Jaya Hangal
> 42:  */
> 43: final class ZipFileStore extends FileStore {

This should be OK but might suggest adding a release note

test/jdk/jdk/nio/zipfs/ZipFSTester.java line 1086:

> 1084:     }
> 1085: 
> 1086:     static void test8299864(FileSystem fs)  {

Please add a comment explaining the test and change the method name as would prefer to have names that are a bit more descriptive than a bug number.

I realize some of the existing methods follow the same naming as you are proposing, but we are trying to avoid this and make the tests more descriptive going forward

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

PR: https://git.openjdk.org/jdk/pull/11926


More information about the core-libs-dev mailing list