reduce the number of force() calls on storages
authorEugene Zhuravlev <jeka@intellij.com>
Mon, 30 Jan 2012 20:23:27 +0000 (21:23 +0100)
committerEugene Zhuravlev <jeka@intellij.com>
Mon, 30 Jan 2012 20:54:56 +0000 (21:54 +0100)
jps/jps-builders/src/org/jetbrains/jps/incremental/CompileContext.java
jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java
jps/jps-builders/src/org/jetbrains/jps/server/ProjectDescriptor.java

index 8d5a286733aa4338b1fad4471f80204666a7cc69..fdaa66d55eb51516ba7e021d1982336a87884ab6 100644 (file)
@@ -210,6 +210,10 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
     return myDataManager;
   }
 
+  public TimestampStorage getTimestampStorage() {
+    return myTsStorage;
+  }
+
   public void processMessage(BuildMessage msg) {
     if (msg.getKind() == BuildMessage.Kind.ERROR) {
       myErrorsFound = true;
index 931bc55ca63613d6ad01e71de22f98d0e4efa464..7beeac50794ef0d8453fed83eea14b229e95cbf6 100644 (file)
@@ -102,6 +102,10 @@ public class IncProjectBuilder {
   }
 
   private static void flushContext(CompileContext context) {
+    if (context != null) {
+      context.getTimestampStorage().force();
+      context.getDataManager().flush(false);
+    }
     final ExternalJavacDescriptor descriptor = ExternalJavacDescriptor.KEY.get(context);
     if (descriptor != null) {
       try {
index 8cdce41f81b3cff46664486f70b3485a8f2c399d..11ee1a1a5aaafb631e56f9e5f8ae7e1d1ef2e307 100644 (file)
@@ -53,9 +53,5 @@ public final class ProjectDescriptor {
         }
       }
     }
-    else {
-      timestamps.getStorage().force();
-      dataManager.flush(false);
-    }
   }
 }