File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
src/main/java/org/scijava/io/location Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 3232
3333package org .scijava .io .location ;
3434
35+ import java .net .URI ;
3536import java .util .Objects ;
3637
3738/**
@@ -58,4 +59,13 @@ public boolean equals(final Object obj) {
5859 return Objects .equals (getURI (), other .getURI ());
5960 }
6061
62+ @ Override
63+ public String toString () {
64+ final String prefix = getClass ().getSimpleName () + ":" ;
65+ final URI uri = getURI ();
66+ if (uri != null ) return prefix + uri ;
67+ final String name = getName ();
68+ if (name != null ) return prefix + name ;
69+ return prefix + defaultName ();
70+ }
6171}
Original file line number Diff line number Diff line change 3737import java .net .URI ;
3838import java .util .Collections ;
3939import java .util .HashSet ;
40+ import java .util .Objects ;
4041import java .util .Set ;
4142
4243/**
@@ -52,6 +53,7 @@ public class FileLocation extends AbstractLocation implements
5253 private final File file ;
5354
5455 public FileLocation (final File file ) {
56+ Objects .requireNonNull (file );
5557 this .file = file ;
5658 }
5759
You can’t perform that action at this time.
0 commit comments