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

regression: org.codehaus.groovy.runtime.metaclass.MissingPropertyExceptionNoStack: No such property: x for class: X

    XMLWordPrintableJSON

Details

    Description

      In 2.3.8 this works:

      private static final Logger log = LoggerFactory.getLogger(LumenPersistenceImportApp)
      
      @Override
      void run(String... args) throws Exception {
          new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))
                  .withReader { Reader buf ->
              new CSVReader(buf, '\t' as char, '"' as char, '\\' as char).with { csv ->
                  log.debug('{} -[:{}]-> {}    # {}', subjectUri, relName, objectUri, factId)
      ...
      

      In 2.4.0 this throws runtime exception:

      Caused by: org.codehaus.groovy.runtime.metaclass.MissingPropertyExceptionNoStack: No such property: log for class: au.com.bytecode.opencsv.CSVReader
      

      It seems Groovy is now looking for the wrong "log" although it's available as a private static final field.

      Workaround: Change private to protected

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            ceefour Hendy Irawan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: