test/java/rmi/transport/pinLastArguments/PinLastArguments.java

Print this page

        

@@ -76,11 +76,17 @@
         } finally {
             UnicastRemoteObject.unexportObject(impl, true);
         }
         impl = null;
 
+        while(true) {
         System.gc();
+            Thread.sleep(20);
+            if(ref.get() == null) {
+                break;
+            }
+        }
 
         if (ref.get() != null) {
             throw new Error("TEST FAILED: impl not garbage collected");
         }