You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2026/02/25 20:30:00 UTC

[jira] [Resolved] (GROOVY-11860) apply @Final transform to constructor produces class format error

     [ https://issues.apache.org/jira/browse/GROOVY-11860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles resolved GROOVY-11860.
----------------------------------
    Fix Version/s: 5.0.5
       Resolution: Fixed

https://github.com/apache/groovy/commit/66ea89cdb4deb6664a26ea28978141c48fa60235

> apply @Final transform to constructor produces class format error
> -----------------------------------------------------------------
>
>                 Key: GROOVY-11860
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11860
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.5
>
>
> Consider the following:
> {code:groovy}
> class C {
>   @groovy.transform.Final
>   C() {
>   }
> }
> {code}
> After compilation, loading this class results in:
> {code}
> java.lang.ClassFormatError: Method <init> in class C has illegal modifiers: 0x11
> 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
> {code}
> The compiler should omit an error or ignore the invalid request for final on constructor.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)