8254876: (fs) NullPointerException not thrown when first argument to Path.of or Paths.get is null

Reviewed-by: rriggs, alanb
This commit is contained in:
Brian Burkhalter 2020-11-03 19:39:28 +00:00
parent b46d73bee8
commit 450452bb8c
3 changed files with 17 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -211,6 +211,7 @@ class WindowsFileSystem
@Override
public final Path getPath(String first, String... more) {
Objects.requireNonNull(first);
String path;
if (more.length == 0) {
path = first;