diff options
author | Paolo G. Giarrusso <p.giarrusso@gmail.com> | 2016-10-06 16:48:11 +0200 |
---|---|---|
committer | Paolo G. Giarrusso <p.giarrusso@gmail.com> | 2016-10-07 16:03:33 +0200 |
commit | efd60bbd2f9c02d34e296f2932665b8ebe733f61 (patch) | |
tree | 02d04e3a4f949b2e445e7da529310a1a9848af09 | |
parent | b8203c8968d9934b91e468790c84a5d9bf76d806 (diff) | |
download | dotty-efd60bbd2f9c02d34e296f2932665b8ebe733f61.tar.gz dotty-efd60bbd2f9c02d34e296f2932665b8ebe733f61.tar.bz2 dotty-efd60bbd2f9c02d34e296f2932665b8ebe733f61.zip |
Fix compilation warnings
-rw-r--r-- | interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java | 2 | ||||
-rw-r--r-- | test/test/ContextEscapeDetector.java | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java b/interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java index 0e16d3ea4..6c72a5125 100644 --- a/interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java +++ b/interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java @@ -1,7 +1,5 @@ package dotty.tools.dotc.interfaces; -import java.io.File; - /** A source file. * * User code should not implement this interface, but it may have to diff --git a/test/test/ContextEscapeDetector.java b/test/test/ContextEscapeDetector.java index c7768fd57..78d293a5d 100644 --- a/test/test/ContextEscapeDetector.java +++ b/test/test/ContextEscapeDetector.java @@ -1,6 +1,5 @@ package test; -import org.junit.runner.Description; import org.junit.runner.Result; import org.junit.runner.notification.RunListener; import org.junit.Assert; @@ -43,6 +42,7 @@ public class ContextEscapeDetector extends RunListener { return count; } + @SuppressWarnings("unused") private static volatile Object o = null; private static synchronized void forceGCHeuristic0() { @@ -59,7 +59,7 @@ public class ContextEscapeDetector extends RunListener { private static synchronized void forceGCHeuristic1() { Object obj = new Object(); - WeakReference ref = new WeakReference<Object>(obj); + WeakReference<Object> ref = new WeakReference<>(obj); obj = null; while (ref.get() != null) { System.gc(); @@ -69,7 +69,7 @@ public class ContextEscapeDetector extends RunListener { private static synchronized void forceGCHeuristic2() { try { Object[] arr = new Object[1024]; // upto 8 GB - WeakReference ref = new WeakReference<Object>(arr); + WeakReference<Object> ref = new WeakReference<>(arr); o = arr; // make sure array isn't optimized away Runtime runtime = Runtime.getRuntime(); |