Skip to content

Commit 1aa798a

Browse files
committed
Fix compilation warnings
1 parent e21f934 commit 1aa798a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package dotty.tools.dotc.interfaces;
22

3-
import java.io.File;
4-
53
/** A source file.
64
*
75
* User code should not implement this interface, but it may have to

test/test/ContextEscapeDetector.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package test;
22

3-
import org.junit.runner.Description;
43
import org.junit.runner.Result;
54
import org.junit.runner.notification.RunListener;
65
import org.junit.Assert;
@@ -43,6 +42,7 @@ private static synchronized int contextsAlive() {
4342
return count;
4443
}
4544

45+
@SuppressWarnings("unused")
4646
private static volatile Object o = null;
4747

4848
private static synchronized void forceGCHeuristic0() {
@@ -59,7 +59,7 @@ private static synchronized void forceGCHeuristic0() {
5959

6060
private static synchronized void forceGCHeuristic1() {
6161
Object obj = new Object();
62-
WeakReference ref = new WeakReference<Object>(obj);
62+
WeakReference<Object> ref = new WeakReference<>(obj);
6363
obj = null;
6464
while (ref.get() != null) {
6565
System.gc();
@@ -69,7 +69,7 @@ private static synchronized void forceGCHeuristic1() {
6969
private static synchronized void forceGCHeuristic2() {
7070
try {
7171
Object[] arr = new Object[1024]; // upto 8 GB
72-
WeakReference ref = new WeakReference<Object>(arr);
72+
WeakReference<Object> ref = new WeakReference<>(arr);
7373
o = arr; // make sure array isn't optimized away
7474

7575
Runtime runtime = Runtime.getRuntime();

0 commit comments

Comments
 (0)