You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/05/04 17:46:44 UTC

[GitHub] [calcite] vlsi commented on a change in pull request #2409: [CALCITE-4593] DiffRepository tests should fail if new XML resources are not in alphabetical order

vlsi commented on a change in pull request #2409:
URL: https://github.com/apache/calcite/pull/2409#discussion_r625982966



##########
File path: core/src/test/java/org/apache/calcite/test/DiffRepository.java
##########
@@ -517,17 +571,23 @@ private Node ref(String testCaseName, List<Pair<String, Element>> map) {
   /**
    * Flushes the reference document to the file system.
    */
-  private void flushDoc() {
+  private synchronized void flushDoc() {
+    if (modCount == modCountAtLastWrite) {
+      // Document has not been modified since last write.
+      return;
+    }
     try {
       boolean b = logFile.getParentFile().mkdirs();
       Util.discard(b);
       try (Writer w = Util.printWriter(logFile)) {
         write(doc, w, indent);
       }
+      System.out.println("write; modCount=" + modCount);

Review comment:
       Please remove system.out before merging




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org