File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
benchmark/src/java/org/apache/lucene/benchmark/byTask
core/src/test/org/apache/lucene/util Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 4646import org .apache .lucene .store .Directory ;
4747import org .apache .lucene .store .FSDirectory ;
4848import org .apache .lucene .util .IOUtils ;
49+ import org .apache .lucene .util .SuppressForbidden ;
4950
5051/**
5152 * Data maintained by a performance test run.
@@ -204,7 +205,7 @@ public void reinit(boolean eraseIndex) throws Exception {
204205 resetInputs ();
205206
206207 // release unused stuff
207- System . runFinalization ();
208+ runFinalization ();
208209 System .gc ();
209210
210211 // Re-init clock
@@ -482,4 +483,10 @@ public synchronized QueryMaker getQueryMaker(ReadTask readTask) {
482483 public Map <String , AnalyzerFactory > getAnalyzerFactories () {
483484 return analyzerFactories ;
484485 }
486+
487+ @ SuppressWarnings ("removal" )
488+ @ SuppressForbidden (reason = "requires to run finalization" )
489+ private static void runFinalization () {
490+ System .runFinalization ();
491+ }
485492}
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ public void testSimpleHashMap() {
119119 int size = map .size ();
120120 for (int i = 0 ; size > 0 && i < 10 ; i ++)
121121 try {
122- System . runFinalization ();
122+ runFinalization ();
123123 System .gc ();
124124 int newSize = map .size ();
125125 assertTrue ("previousSize(" + size + ")>=newSize(" + newSize + ")" , size >= newSize );
@@ -232,7 +232,7 @@ public void run() {
232232 int size = map .size ();
233233 for (int i = 0 ; size > 0 && i < 10 ; i ++)
234234 try {
235- System . runFinalization ();
235+ runFinalization ();
236236 System .gc ();
237237 int newSize = map .size ();
238238 assertTrue ("previousSize(" + size + ")>=newSize(" + newSize + ")" , size >= newSize );
@@ -252,4 +252,10 @@ public void run() {
252252 InterruptedException ie ) {
253253 }
254254 }
255+
256+ @ SuppressWarnings ("removal" )
257+ @ SuppressForbidden (reason = "requires to run finalization" )
258+ private static void runFinalization () {
259+ System .runFinalization ();
260+ }
255261}
You can’t perform that action at this time.
0 commit comments