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

When accessing a property on a null object inside of a closure, the line number is not always reported in the stack trace.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.6
    • 1.5.8
    • Compiler
    • None

    Description

      If we have a simple script such as follows:

      package example

      def t =

      { someVariable.property = 1 }

      t()

      When we run this, it will report a NPE and in the stack trace line 5 the call to t() will show up, but up the stack it will only show the file name on calls inside the closure with no line number. This is even worse when the call originates from java so that you could not even have a clue as to where in the groovy script the NPE took place.

      Attachments

        1. 3119_v15x.diff
          1 kB
          Roshan Dawrani

        Activity

          People

            blackdrag Jochen Theodorou
            elponderador Lewis Gass
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: