changeset 4:84f3caa798b7

fix CODETOOLS-7900882 Another apparent deadlock of jcov-2.0 on Swing functional tests, contributed by: alexey.fedorchenko@oracle.com
author ersh
date Tue, 24 Jun 2014 11:37:59 +0400
parents 22d15cf94d61
children 69479337637d
files src/classes/com/sun/tdk/jcov/Agent.java
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/classes/com/sun/tdk/jcov/Agent.java	Tue Jun 24 14:14:28 2014 +0400
+++ b/src/classes/com/sun/tdk/jcov/Agent.java	Tue Jun 24 11:37:59 2014 +0400
@@ -496,6 +496,7 @@
         if (!grabberSaver) {
             // File saver should perform full merge here, not only insert new classes.
             JCovSaver saver = FileSaver.getFileSaver(root, filename, template, merge, true);
+            loadFileSaverClasses();
             Collect.setSaver(Collect.decorateSaver(new SynchronizedSaverDecorator(saver)));
         } else {
             AgentSocketSaver saver = new AgentSocketSaver(root, filename, host, port);
@@ -505,6 +506,12 @@
         PropertyFinder.addAutoShutdownSave();
     }
 
+    private void loadFileSaverClasses() throws IOException{
+        File file = new File(filename + "_load");
+        new FileOutputStream(file).close();
+        file.delete();
+    }
+
     /**
      * premain chain for classfiles V49+
      *
@@ -560,6 +567,7 @@
         if (!grabberSaver) {
             // File saver should perform full merge here, not only insert new classes.
             JCovSaver saver = FileSaver.getFileSaver(root, filename, template, merge, true);
+            loadFileSaverClasses();
             Collect.setSaver(Collect.decorateSaver(new SynchronizedSaverDecorator(saver)));
         } else {
             AgentSocketSaver saver = new AgentSocketSaver(root, filename, host, port);