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

Errors in classes are sometimes hidden

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-JSR-5
    • None
    • None
    • Mac OS X 10.3.2, java 1.4.2
      Using CVS HEAD from 4/16/2004

    Description

      Sometimes when I have a problem in a class, that problem is hidden from me and I see other problems. This makes it very difficult to track down the original problem.

      For example:

      class HiddenProblem {
      static dosomething() {
      f = new File("/tmp")
      f.eachFile

      {println it}

      }
      }

      Now go into groovysh and enter:

      1> HiddenProblem.dosomething()
      2) go

      Cannot invoke method: dosomething on null object

      If I change the static to nonstatic, then do this:

      1> h = new HiddenProblem()
      2> h.dosomething()
      3> go

      No such class: HiddenProblem in constructor call for class: CommandLine1. At [1:5] CommandLine1.groovy

      The real bug is that the File class is unknown, but this error seems to be lost. When the object graph gets more complicated, like classes inheriting from other classes, then the real problem is a nightmare to find.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            johnstump John Stump
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: