File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
windows/classes/sun/nio/fs
test/jdk/java/nio/file/Path Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,7 @@ public Iterator<FileStore> iterator() {
257
257
258
258
@ Override
259
259
public final Path getPath (String first , String ... more ) {
260
+ Objects .requireNonNull (first );
260
261
String path ;
261
262
if (more .length == 0 ) {
262
263
path = first ;
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2008, 2015 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2008, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -211,6 +211,7 @@ public Set<String> supportedFileAttributeViews() {
211
211
212
212
@ Override
213
213
public final Path getPath (String first , String ... more ) {
214
+ Objects .requireNonNull (first );
214
215
String path ;
215
216
if (more .length == 0 ) {
216
217
path = first ;
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2008, 2016 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2008, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
22
22
*/
23
23
24
24
/* @test
25
- * @bug 4313887 6838333 6925932 7006126 8037945 8072495 8140449
25
+ * @bug 4313887 6838333 6925932 7006126 8037945 8072495 8140449 8254876
26
26
* @summary Unit test for java.nio.file.Path path operations
27
27
*/
28
28
@@ -2042,6 +2042,18 @@ static void doUnixTests() {
2042
2042
static void npes () {
2043
2043
header ("NullPointerException" );
2044
2044
2045
+ try {
2046
+ Path .of (null , "foo" );
2047
+ throw new RuntimeException ("NullPointerException not thrown" );
2048
+ } catch (NullPointerException npe ) {
2049
+ }
2050
+
2051
+ try {
2052
+ Path .of ("foo" , null );
2053
+ throw new RuntimeException ("NullPointerException not thrown" );
2054
+ } catch (NullPointerException npe ) {
2055
+ }
2056
+
2045
2057
Path path = FileSystems .getDefault ().getPath ("foo" );
2046
2058
2047
2059
try {
You can’t perform that action at this time.
0 commit comments