re PR classpath/25389 (File(new URI("file:./")) -> java.lang.NullPointerException)
PR classpath/25389: * java/io/File.java (File): Throw IllegalArgumentException if URI is non-hierarchical. From-SVN: r108528
This commit is contained in:
parent
3165dcfa17
commit
3ce4312613
2 changed files with 11 additions and 1 deletions
|
@ -434,7 +434,11 @@ public class File implements Serializable, Comparable
|
|||
if (!uri.getScheme().equals("file"))
|
||||
throw new IllegalArgumentException("invalid uri protocol");
|
||||
|
||||
path = normalizePath(uri.getPath());
|
||||
String name = uri.getPath();
|
||||
if (name == null)
|
||||
throw new IllegalArgumentException("URI \"" + uri
|
||||
+ "\" is not hierarchical");
|
||||
path = normalizePath(name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue