Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-11514

HDC Task extends AutoCloseable for easy usages

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 13.0.0
    • None
    • None

    Description

      At the moment, HDC Task start/stop should be coded like this:

          Task task1;
          try {
              task1 = HDC.getCurrentTask().startSubtask("task1");
              // do something...
          } finally {
              task1.stop();
          }
      

      That could be simplified like this if Task extends AutoCloseable with a default method, #close(), which simply invokes #stop() method:

          try (Task task1 = HDC.getCurrentTask().startSubtask("task1")) {
              task1 = HDC.getCurrentTask().startSubtask("task1");
              // do something...
          }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wko Woonsan Ko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: