diff --git a/pom.xml b/pom.xml index e98372e4..8f75acf5 100644 --- a/pom.xml +++ b/pom.xml @@ -97,11 +97,6 @@ joda-time 2.12.7 - - com.google.guava - guava - 32.0.1-jre - org.slf4j slf4j-api diff --git a/src/main/java/loci/common/Location.java b/src/main/java/loci/common/Location.java index 8cdef653..8ad2830a 100644 --- a/src/main/java/loci/common/Location.java +++ b/src/main/java/loci/common/Location.java @@ -47,13 +47,12 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.collect.MapMaker; - /** * Pseudo-extension of {@link java.io.File} that supports reading over HTTP * (among other things). @@ -92,7 +91,7 @@ protected class ListingsResult { } } private static final Map fileListings = - new MapMaker().makeMap(); // like Java's ConcurrentHashMap + new ConcurrentHashMap(); /** Pattern to match child URLs */ private static final Pattern URL_MATCHER = Pattern.compile( diff --git a/src/main/java/loci/common/RandomAccessOutputStream.java b/src/main/java/loci/common/RandomAccessOutputStream.java index ff072cbd..0e214afa 100644 --- a/src/main/java/loci/common/RandomAccessOutputStream.java +++ b/src/main/java/loci/common/RandomAccessOutputStream.java @@ -39,8 +39,6 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; -import com.google.common.math.LongMath; - /** * RandomAccessOutputStream provides methods for writing to files and * byte arrays. @@ -123,8 +121,7 @@ public void skipBytes(int skip) throws IOException { final long currentPosition = outputFile.getFilePointer(); final long newPosition; try { - /* in Java 8 can instead use addExact */ - newPosition = LongMath.checkedAdd(currentPosition, skip); + newPosition = Math.addExact(currentPosition, skip); } catch (ArithmeticException ae) { /* translate to expected checked exception */ throw new IOException("seek is out of range", ae);