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

Internal NPE when reusing variable name in different scopes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-4
    • 1.0-JSR-5
    • None
    • None

    Description

      The following code will generate an internal NPE when foo is referenced to a second time in another scope:

      import groovy.xml.MarkupBuilder;

      if (true) {
      foo = "bar";
      }

      PrintWriter screen = new PrintWriter(new OutputStreamWriter(System.out),
      true);

      def someBuilder = new MarkupBuilder(screen);

      someBuilder.pe() {
      foo = 1;
      }

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            ra Randy Abernethy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: