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

    matrei

    04/09/2026, 6:41 AM
    groovy-lang.org seems to be down again
    p
    g
    • 3
    • 3
  • j

    Jefferoson Hilario

    04/20/2026, 8:03 PM
    can we have a method like this in groovy?
    Copy code
    Duration duration = measureTime {
       //code
    } 
    
    Long duration = measureTimeMilis {
       //code
    }
  • p

    paulk_asert

    04/20/2026, 8:48 PM
    Sure:
    Copy code
    long timeMillis(Closure c) {
        long start = System.currentTimeMillis()
        c.call()
        System.currentTimeMillis() - start
    }
    
    Long duration = timeMillis {
        println 'Hi'
        sleep 500
        println 'Bye'
    }
    
    println duration
    // Hi
    // Bye
    // 507
  • v

    Vampire

    04/20/2026, 8:58 PM
    System.currentTimeMillis()
    should never be used to measure a duration within one JVM though, as it depends on wall-clock, so is affected by time-synchronization, summer-time-change and so on. Always use
    System.nanotime()
    to measure durations within the same JVM.
    👍 5
  • j

    Jefferoson Hilario

    04/20/2026, 9:03 PM
    What I mean is, I use this method a lot in almost all my projects; I think it would be useful if it were included in the standard Groovy library. I'm sure it would help others.
  • p

    paulk_asert

    04/20/2026, 9:18 PM
    Okay, now I see what you meant. Sure, a utility based on nanoTime would be a possibility.
    ❤️ 1
  • j

    Jefferoson Hilario

    04/20/2026, 9:27 PM
    Thanks @paulk_asert
  • p

    paulk_asert

    04/21/2026, 6:08 AM
    I created this request: https://issues.apache.org/jira/browse/GROOVY-11947
  • p

    paulk_asert

    04/21/2026, 6:09 AM
    Feel free to comment or suggest improvements. We'd probably target Groovy 6 in the first instance and backport based on a risk assessment, e.g. would those methods likely exist currently in user code.
    j
    • 2
    • 2
  • j

    Juho Naalisvaara

    04/22/2026, 9:28 AM
    Hello, code that worked on groovy 5.0.4 is now throwing MethodTooLargeException from MethodWriter.java:2088, but AFAIS the method is not too large
    p
    • 2
    • 28
  • s

    Sujith

    04/22/2026, 9:22 PM
    Stumbled upon this recently: https://jactl.io/blog/2026/03/16/groovy-vs-jactl
  • s

    Sujith

    04/22/2026, 9:25 PM
    I understand Jactl is targeting a different problem. But are there any good ideas there we could use for Groovy 6?
  • d

    daniel_sun

    04/23/2026, 12:45 AM
    I like most of jactl features, especially pattern matching and destructuring. Groovy has not supported pattern matching and destructuring fully for now, but it's better support the feature to improve compatibility with Java.
  • d

    daniel_sun

    04/23/2026, 12:50 AM
    BTW, Groovy 6 has been trying to improve performance.
  • b

    bsdooby

    04/23/2026, 8:04 AM
    Speaking of Groovy 6; is there a roadmap of features, planned for this release?
  • p

    paulk_asert

    04/23/2026, 8:52 AM
    Sure is - it's in the website repo. I'm doing some tweaking and will ensure a published version is also available shortly. The current version is here: https://groovy-lang.org/releasenotes/groovy-6.0.html
    🙌 2
  • b

    bsdooby

    04/23/2026, 9:35 AM
    @paulk_asert Merci beaucoup!
  • p

    Paolo

    05/04/2026, 4:04 PM
    Hi team! I’ve identified a significant shift in Groovy 5 regarding “file truth” semantics (GROOVY-10949). In the new version, a
    File
    object evaluates to
    false
    if the file does not physically exist, whereas previously it only required the reference to be non-null. While this change impacts the Nextflow codebase, our primary concern is the broader ecosystem: • Critical External Impact: This change is a “silent breaker” for the thousands of third-party scripts and applications running on Nextflow. Users expecting legacy Groovy behavior will encounter unexpected logic failures that are notoriously difficult to debug in a pipeline context. • Internal Management: While we can refactor our own core codebase to accommodate the new semantics, we cannot realistically control or force a synchronized update across the entire community of external plugins and user-maintained pipelines. To mitigate this, I’ve submitted this PR to introduce a system option that allows reverting to the previous behavior. This ensures backward compatibility and provides a necessary safety net for the community as they transition. Hope you will consider this for merge!
    👏 1
  • p

    paulk_asert

    05/05/2026, 2:15 AM
    Sounds like a useful flag to have. I left some comments on the PR.
  • g

    glaforge

    05/31/2026, 8:08 PM
    @paulk_asert Groovy website struggles to load for me right now
  • p

    paulk_asert

    05/31/2026, 9:20 PM
    let me take a look
  • p

    paulk_asert

    05/31/2026, 9:22 PM
    should be okay now
  • g

    glaforge

    06/01/2026, 5:49 AM
    👍
  • j

    Jefferoson Hilario

    07/11/2026, 1:15 AM
    Hello everybody, I need your help, There is a compatibility issue between IntelliJ and Groovy 5. You can read about the issue here: youtrack.jetbrains.com/issue/IDEA-386167. Please vote so that the IntelliJ team will prioritize it.
    👍 1
  • s

    Sean Williams

    07/21/2026, 12:15 AM
    Hey folks - I'm trying to implement a client for a RESTful API based on
    <http://groovyx.net|groovyx.net>.http.RESTClient
    . Is there some guidance for matching some of the config patterns (combo closure+dictionary support, etc.) seen with
    get()
    ,
    post()
    ,
    request()
    , and so on?
  • s

    Sean Williams

    07/21/2026, 12:17 AM
    I could possibly derive from RESTClient and override the different methods, but that feels overkill/unwise - the thing I'm trying to solve w/ encapsulation is: • avoiding path-traversal (i.e. can't navigate the client outside of the API base URL) • nuance atop the REST layer (e.g. pagination)
  • p

    paulk_asert

    07/21/2026, 1:51 AM
    @Sean Williams Have you looked at the declarative http client in groovy 6?
  • s

    Sean Williams

    07/21/2026, 1:52 AM
    To my knowledge, we're not on Groovy 6 and upgrading isn't within our control (this is in Scriptrunner for Jira - they're the ones shipping groovy classes into the JRE)
  • o

    Octavia Togami

    07/22/2026, 2:44 AM
    Gradle would like to request a backport of the ASM 9.10.1 bump to Groovy 4, so we can support Java 27 in full: https://issues.apache.org/jira/browse/GROOVY-12167
    p
    • 2
    • 3
  • s

    Sujith

    08/14/2026, 7:44 PM
    If you are attending Beer City Code this year, please come to my talk Prototype to Production: Finding Flow on the JVM with Groovy and provide your support and feedback. https://www.beercitycode.com/