Skip to content

Commit b52332e

Browse files
committed
Location: move default methods into interface
1 parent cb14730 commit b52332e

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/main/java/org/scijava/io/AbstractLocation.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,11 @@
3131

3232
package org.scijava.io;
3333

34-
import java.net.URI;
35-
3634
/**
3735
* Abstract base class for {@link Location} implementations.
3836
*
3937
* @author Curtis Rueden
4038
*/
4139
public abstract class AbstractLocation implements Location {
42-
43-
// -- Location methods --
44-
45-
@Override
46-
public URI getURI() {
47-
return null;
48-
}
49-
40+
// NB: No implementation needed.
5041
}

src/main/java/org/scijava/io/Location.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public interface Location {
5353
* Gets the location expressed as a {@link URI}, or null if the location
5454
* cannot be expressed as such.
5555
*/
56-
URI getURI();
56+
default URI getURI() {
57+
return null;
58+
}
5759

5860
}

0 commit comments

Comments
 (0)