AtlasOfLivingAustralia / downloads-plugin

Grails plugin to provide a common "downloads UI" for ALA Biocache application
Other
0 stars 7 forks source link

Plugin is incompatible with Java 17 #108

Open sbearcsiro opened 1 month ago

sbearcsiro commented 1 month ago

Running an application with the downloads-plugin under Java 17 seems to result in a name clash between the new Java Records feature and the Record identifier used in Config.groovy, the error presented as:

13:57:25.149 [Test worker] ERROR o.g.c.c.GroovyConfigPropertySourceLoader - Unable to load plugin.groovy: startup failed:
Script_fd40b2fb546d71a3497eb9f0bd1e8e92.groovy: 42: you tried to assign a value to the class 'java.lang.Record'
 @ line 42, column 9.
           Record = "recordLevelTerms"
           ^

1 error

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script_fd40b2fb546d71a3497eb9f0bd1e8e92.groovy: 42: you tried to assign a value to the class 'java.lang.Record'
 @ line 42, column 9.
           Record = "recordLevelTerms"
           ^

1 error

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
    at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:914)
adam-collins commented 1 month ago

This is part of the 5.1.0-SNAPSHOT now.

This does fix the reported issue that was replicated with ala-hub and Java 17, while also remaining compatible with Java 11.