File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
package test ;
2
2
3
- import org .junit .runner .Description ;
4
3
import org .junit .runner .Result ;
5
4
import org .junit .runner .notification .RunListener ;
6
5
import org .junit .Assert ;
@@ -43,6 +42,7 @@ private static synchronized int contextsAlive() {
43
42
return count ;
44
43
}
45
44
45
+ @ SuppressWarnings ("unused" )
46
46
private static volatile Object o = null ;
47
47
48
48
private static synchronized void forceGCHeuristic0 () {
@@ -59,7 +59,7 @@ private static synchronized void forceGCHeuristic0() {
59
59
60
60
private static synchronized void forceGCHeuristic1 () {
61
61
Object obj = new Object ();
62
- WeakReference ref = new WeakReference <Object >(obj );
62
+ WeakReference < Object > ref = new WeakReference <>(obj );
63
63
obj = null ;
64
64
while (ref .get () != null ) {
65
65
System .gc ();
@@ -69,7 +69,7 @@ private static synchronized void forceGCHeuristic1() {
69
69
private static synchronized void forceGCHeuristic2 () {
70
70
try {
71
71
Object [] arr = new Object [1024 ]; // upto 8 GB
72
- WeakReference ref = new WeakReference <Object >(arr );
72
+ WeakReference < Object > ref = new WeakReference <>(arr );
73
73
o = arr ; // make sure array isn't optimized away
74
74
75
75
Runtime runtime = Runtime .getRuntime ();
You can’t perform that action at this time.
0 commit comments