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

Add compiler warning for imported classes that can no be found on the classpath

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-JSR-5
    • 1.0-JSR-6
    • None

    Description

      It would be useful for the groovy compiler to generate a warning if an imported class can not be found on the classpath. In particular this would help diagnose the following problem:

      import java.util.Date
      import org.groovyco.IsoDateFormat
      
      class SomeClass {
          def doSomething() {
              // ...
              IsoDateFormat.format(new Date())
          }
      }
      

      If IsoDateFormat is not available on the classpath at compile time, the above class will compile fine, but it will fail at runtime with a "MissingPropertyException: IsoDateFormat".

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            pledbrook Peter Ledbrook
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: