Skip to content

Commit 4ca1129

Browse files
committed
More easy warning fixes
1 parent b37d7f3 commit 4ca1129

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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)