Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6895

MarkupTemplateEngine may silently swallow errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.3
    • 2.3.4
    • Templating
    • None

    Description

      The following code in the BaseTemplate class may cause errors to be silently dropped:

      public Writer writeTo(final Writer out) throws IOException {
              try {
                  this.out = createWriter(out);
                  run();
                  return out;
              } finally {
                  this.out.flush();
                  this.out = null;
              }
          }
      

      To avoid the problem, a null check should be added to the finally block.

      Attachments

        Activity

          People

            melix Cédric Champeau
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: