https://groovy-lang.org/ logo
Join Slack
Powered by
# groovy
  • p

    paulk_asert

    06/04/2025, 1:50 PM
    https://github.com/apache/groovy/pull/2247
    ❤️ 1
  • b

    bsdooby

    06/13/2025, 6:59 AM
    In the newest Eclipse 2025-06, I get the following error in a Groovy script where a (Java native) Record type is declared:
  • b

    bsdooby

    06/13/2025, 7:00 AM
    Using Java 22; this worked before. What did change w.r.t. Java, Groovy?
  • p

    paulk_asert

    06/13/2025, 8:22 AM
    Do you explicitly subclass and it worked before? Or is this error complaining about something under the covers?
  • b

    bsdooby

    06/13/2025, 8:32 AM
    I did not subclass it; I just use(d) the following at toplevel
    record Vector2d(float x, float y) { }
  • b

    bsdooby

    06/13/2025, 8:32 AM
    This worked before
  • b

    bsdooby

    06/13/2025, 8:33 AM
    But I guess it is more on the Eclipse (IDE) side of things?
  • b

    bsdooby

    06/13/2025, 8:33 AM
    (as almost always 😞 )
  • p

    paulk_asert

    06/13/2025, 8:41 AM
    Maybe create an issue anyway and Eric might have further thoughts. I don't think he frequents slack much (if at all). And we can close if we definitely believe it's on the Eclipse side of things.
    b
    • 2
    • 3
  • p

    paulk_asert

    06/13/2025, 8:54 AM
    Or send to the dev mailing list
  • b

    bsdooby

    06/13/2025, 9:48 AM
    OK, thx Paul
  • j

    jonnybot

    06/16/2025, 9:50 PM
    I'm trying to debug an issue with the static type checker and closure method parameters. It seems like in Groovy 4.0.19, something changed that has broken type checking for statements like:
    Copy code
    cfValues['SpecialKey']*.name.collect {it.toUpperCase()}
    Some context:
    cfValues
    is a binding variable that I provide custom type information for via a
    ClassCodeExpressionTransformer
    . In this case, the static type checker seems to know that
    cfValues['SpecialKey']
    returns a value of the expected type which, in turn, has a
    name
    property that is a String. Statements like:
    Copy code
    cfValues['SpecialKey']*.name*.toUpperCase()
    compiles just fine. But from Groovy 4.0.19 onward, the static type checker only seems to think that the
    it
    Closure parameter is an
    Object
    , not a
    String
    . I've been poring over the diff and stepping through the debugger to figure out what changed, but I haven't been able to fathom it out. Does this ring a bell for anyone?
  • p

    paulk_asert

    06/16/2025, 10:12 PM
    Jonny, do you want to send your last query to the mailing list. I could try to dive into what might have changed but Eric might know off the top of his head. He doesn't visit slack much, if at all.
    👍 1
    thankyou 1
  • j

    jonnybot

    06/16/2025, 10:17 PM
    Sure, Paul! dev@groovy.apache.org?
    👍 1
  • m

    Mariano

    06/24/2025, 10:06 PM
    Hi! I'm having an issue with a NPE on a class using @CompileStatic, when using StringBuilder with null Integer/Long values. Tested with Gradle 8.13, using:
    implementation 'org.apache.groovy:groovy:4.0.27'
    Also happens with Groovy 3.x, which is where I hit the issue (it's a Grails app). Short example code:
    Copy code
    import groovy.transform.CompileStatic
    
    @CompileStatic
    class SomeClass {
    
        String desc
        Integer int1
        Long long1
    
        @Override
        String toString() {
            return new StringBuilder('SomeClass{')
                    .append('desc=').append(desc)
                    .append(', int1=').append(int1)
                    .append(', long1=').append(long1)
                    .append('}')
                    .toString()
        }
    
    }
    
    static void main(String[] args) {
        println new SomeClass(desc: 'desc', int1: 1, long1: 2).toString() // works
        println new SomeClass().toString() // causes NPE with @CompileStatic
    }
    Should I report this on JIRA? Though I don't have access to it and I'm short on time right now. Thanks!
  • b

    bobby0204

    06/26/2025, 10:57 AM
    Your issue involves a NullPointerException (NPE) in a Groovy class using @CompileStatic when appendingnull Integer or Long values to a StringBuilder in a Grails application. This occurs with Groovy 4.0.27 andearlier 3.x versions, tested with Gradle 8.13. Below, I’ll analyze the problem, provide a solution, and addresswhether you should report it, considering your time constraints and lack of JIRA access. I’ll also tie this to yourearlier context (reconnecting with a Grails.org friend) if relevant.
  • v

    Vampire

    06/27/2025, 1:01 PM
    Is it intended and expected, that with
    Copy code
    println(/\u21a/)  // 1
    println(/\u21aX/) // 2
    println(/\u21aF/) // 3
    println('\u21a')  // 4
    println('\u21aX') // 5
    println('\u21aF') // 6
    the result is 1 - a backslash followed by 4 characters 2 - a backslash followed by 5 characters 3 - the "Downwards Zigzag Arrow" character 4 - compile error complaining about the first single-quote as unexpected character 5 - compile error complaining about the first single-quote as unexpected character 6 - the "Downwards Zigzag Arrow" character ? For Java the Unicode escapes are evaluated and replaced before the actual source code parser kicks in and it complains about incomplete or wrong Unicode escapes, complaining about the second single-quote in code according to 2 / 4, and about the X in code according to 3 / 5, even if it is found in code comments. In Java you could for example also use
    void foo\u0058bar()
    to declare a method called
    fooXbar
    due to Unicode escapes being resolved and replaced before the parser kicks in, while in Groovy this does not work as it is handled as part of the parser. I mainly ask about 1 and 2 as I'm going to report an IntelliJ IDEA issue as the IDE complains about illegal escape sequence which is a false-positive in that case. And if 1 and 2 is intended, then I tend to question 3, as the backslash does not loose its meaning within the slash-y String in that case.
    p
    • 2
    • 6
  • d

    daniel_sun

    07/12/2025, 11:21 AM
    https://github.com/apache/groovy/actions/runs/16237102718/artifacts/3518543490
  • d

    daniel_sun

    07/12/2025, 11:22 AM
    @paulk_asert has updated Groovysh to JLine3 in the PR: https://github.com/apache/groovy/pull/2263
  • d

    daniel_sun

    07/12/2025, 11:23 AM
    It is amazing. I can not wait to share with you all.
  • s

    Sujith

    07/12/2025, 9:52 PM
    Random observation: I was using the
    groovyConsole
    to prepare code demos for a presentation to a local meetup. Quite a few times, the application would just freeze up and had to be forcefully shutdown. Seems like there is a memory leak?
  • s

    Sujith

    07/12/2025, 9:54 PM
    Fortunately I didn’t run into any issues during the actual event. It seemed to happen only when left running for a long period of time.
  • s

    Sujith

    07/12/2025, 9:56 PM
    Also the
    groovysh
    throws a bunch of deprecation warnings during start up. This was with Groovy 4 on JDK 17.
  • d

    daniel_sun

    07/13/2025, 5:44 AM
    Please submit a JIRA ticket with some script to reproduce the issue.
  • s

    Sujith

    07/23/2025, 4:33 PM
    Just curious if the JIRA issues have some kind of an indicator of being a “good first issue”.
    p
    • 2
    • 2
  • s

    Saravanan Subiramaniam

    08/09/2025, 4:43 PM
    Hi Team, I created GROOVY-11729 last week. Paul King has mentioned that he will free up some time next week to look into this. In the meantime, can someone please look into this and provide input? The impact of the issue is severe in our customer environments. So, appreciate if you could look into the issue.
  • v

    Vampire

    08/12/2025, 3:26 PM
    Maybe I'm just too tired. If I have
    Copy code
    Thread.start {
       new AutoCloseable() { void close() {} }.withCloseable {
          return
       }
       println("not to be displayed")
    }.join()
    How do I
    return
    from the
    start
    closure, not the
    withCloseable
    closure, so that the out line is not displayed?
    p
    • 2
    • 6
  • s

    Sujith

    08/18/2025, 11:14 PM
    The Groovy track in Apache CoC North America looks great. Anyone know if it will be recorded and made available later?
  • p

    paulk_asert

    08/19/2025, 12:29 AM
    We will be making all the slides available. We don't currently have plans to record video but we'll be on the lookout for a way to make that happen.
    thankyou 1
  • c

    Christoph Obexer

    08/20/2025, 8:52 AM
    Hey folks, it looks like http://groovy-lang.org/ is down for a few hours already and I'm not sure where to report that... maybe here is a good place? are you aware and is there some status page I could follow?
    ✅ 1
    m
    p
    • 3
    • 4