You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Tommy Svensson (JIRA)" <ji...@apache.org> on 2015/07/05 17:15:04 UTC

[jira] [Commented] (GROOVY-7379) listeners.each { UDPListener -> ... fails with exception runtime on List when used in an inner class.

    [ https://issues.apache.org/jira/browse/GROOVY-7379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14614283#comment-14614283 ] 

Tommy Svensson commented on GROOVY-7379:
----------------------------------------

Sorry for not answering. I can conclude a few things:

- To make a long story short, when many people get write access to the same github repo and then clone that repo, any changes to any of those cloned repos generates a mail tornado. I ended up creating a filter to remove these. I also deleted a ton of mail that I've already gotten so the notification changes to this issue might have been in the large pile of mails I deleted. 

- I was apparently in a bad mode when I submitted this issue. I've actually been told that I put to high demands on my surroundings. Sorry.

- With version 2.4.3 of groovy things are now working very well. 

- I will never for as long as I live be able to comprehend JIRA! There are 4 copies of my entry with side by side view making a total of 8. I have no idea how this happened, how to reproduce that, or how to avoid it :-). 

You were of course correct to close this issue when I didn't respond.



> listeners.each { UDPListener -> ... fails with exception runtime on List<UDPListener> when used in an inner class.
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-7379
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7379
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler, groovy-runtime
>    Affects Versions: 2.3.6, 2.3.11
>         Environment: Mac OS X 10.10.2, JDK 1.7.0_71
>            Reporter: Tommy Svensson
>
> Exception in thread "Thread-1" java.lang.VerifyError: (class: se/natusoft/osgi/aps/tcpipsvc/UDPReceiver$_ReceiverThread_run_closure1, method: doCall signature: (Lse/natusoft/osgi/aps/api/net/tcpip/UDPListener;)Ljava/lang/Object;) Incompatible object argument for function call
> 	at se.natusoft.osgi.aps.tcpipsvc.UDPReceiver$ReceiverThread.run(UDPReceiver.groovy:219)
> Caused by the following code:
> {noformat}
>                this.listeners.each { UDPListener listener ->
>                     try {
>                         listener.udpDataReceived(config.name, dp)
>                     }
>                     catch (Exception e) {
>                         getSafeLogger().error("Listener call failed for '" + config.name + "'! (" + listener + ")", e)
>                     }
>                 }
> {noformat}
> The above code block fails with the above exception when the class the code block is part of is an inner class. When the whole inner class is moved up into its own top level class, this works fine, and there is no exception. I've noticed this behavior before, there are several Groovy features that simply fails when they are part of an inner class, but works fine in a top level class. 
> I guess that the lesson here is to avoid inner classes in Groovy for now at least. 
> I really love Groovy as a language, it sovles a lot of the problem with Java. Unfortunately the stability and quality of Java releases and Grovvy releases are on separate sides of the universe. Due to this I don't dare reccomend to a customer to use Groovy until it has more stable and backwards compatible releases. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)