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

cannot extend java.util.Properties unless getProperty() is overridden

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.5.4
    • 1.6-rc-1, 1.5.8, 1.7-beta-1
    • ast builder
    • None
    • Windows 2000, JDK 1.6, Groovy 1.5.4

    Description

      Running this in groovyconsole

      public class Configuration extends java.util.Properties 
      {  
          
      }  
      1
      

      yields the following error:

      Exception thrown: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, 
      Script9: -1: the return type is incompatible with java.lang.String getProperty(java.lang.String) in 
      java.util.Properties. Node: org.codehaus.groovy.ast.MethodNode. At [-1:-1]  @ line -1, column -1.
      

      But when the getProperty() method is overridden the code runs fine:

      public class Configuration extends java.util.Properties 
      {  
          String getProperty(String s) {
          }
      } 
      1
      

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            erikb Erik Bartels
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: