Uploaded image for project: 'Torque'
  1. Torque
  2. TORQUE-338

Fix the saving of checksums when runOnlyOnSourceChange is set to true

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0
    • 5.0
    • Generator
    • None
    • Patch

    Description

      The generator's Controller loops over a list of UnitDescriptors, each of which may have set the option to run only on a source change. Currently, the cached checksum file is overwritten by each successive call to processGenerationUnit(ControllerState, UnitConfiguration) resulting in only the last UnitDescriptor to be skipped on a subsequent run. The following patch to Checksums addresses this issue:

      Index: torque-generator/src/main/java/org/apache/torque/generator/control/Checksums.java
      ===================================================================
      --- torque-generator/src/main/java/org/apache/torque/generator/control/Checksums.java	(revision 1689921)
      +++ torque-generator/src/main/java/org/apache/torque/generator/control/Checksums.java	(working copy)
      @@ -128,6 +128,29 @@
               Set<String> keys = new HashSet<String>();
               keys.addAll(checksums.keySet());
               keys.addAll(modificationDates.keySet());
      +        
      +        Checksums existing = new Checksums();
      +        existing.readFromFile(toWriteTo);
      +        for (String key : existing.getChecksums().keySet())
      +        {
      +            if (keys.add(key))
      +            {
      +                checksums.put(key, existing.getChecksum(key));
      +                if (existing.getModificationDate(key) != null)
      +                {
      +                    modificationDates.put(key, existing.getModificationDate(key));
      +                }
      +            }
      +        }
      +        
      +        for (String key : existing.getModificationDates().keySet())
      +        {
      +            if (keys.add(key))
      +            {
      +                modificationDates.put(key, existing.getModificationDate(key));
      +            }
      +        }
      +        
               StringBuilder content = new StringBuilder();
               for (String key : keys)
               {
      

      Attachments

        Activity

          People

            tfischer Thomas Fox
            helgew Helge Weissig
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: