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 2023/05/30 20:48:00 UTC

[jira] [Resolved] (GROOVY-11075) The method pointer operator suppresses checked exceptions and results in a MethodMissingException

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

Eric Milles resolved GROOVY-11075.
----------------------------------
    Resolution: Fixed

https://github.com/apache/groovy/commit/a0aa62fd001e66863cec53f9a57668bed9094c0e

> The method pointer operator suppresses checked exceptions and results in a MethodMissingException
> -------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11075
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11075
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 4.0.12
>            Reporter: Joe Li
>            Assignee: Eric Milles
>            Priority: Major
>
> The method pointer operator suppresses checked exceptions and results in a MethodMissingException instead in groovy 4.0.12. This issue seems to first appear in groovy 3.0.16, which is the earliest version I am able to reproduce. Example code
> {code:java}
> class Foo {
>     static void bar(String str) {
>         throw new IOException()
>         println str
>     }
> }
> def baz = Foo.&bar
> baz('hi') {code}
> This results in a MethodMissingException despite the IO Exception being thrown. This seems to be the case for any checked exception.
>  
> {code:java}
> class Foo {
>     static void bar(String str) {
>         throw new IOException()
>         println str
>     }
> }
> Foo.bar("hi") {code}
> When calling the method directly I get an IO Exception as expected 



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