[ https://issues.apache.org/jira/browse/GROOVY-5045?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-5045. ----------------------------- > SwingBuilder edt breaks with anonymous subclassing > -------------------------------------------------- > > Key: GROOVY-5045 > URL: https://issues.apache.org/jira/browse/GROOVY-5045 > Project: Groovy > Issue Type: Bug > Components: Swing > Affects Versions: 1.7.10 > Reporter: GubeSpam > Priority: Major > > When within SwingBuilder.edt, the instantiation of anonymous inner classes to > appears to be broken. > Example code: > {code} > import groovy.swing.SwingBuilder > import javax.swing.SwingWorker; > import javax.swing.JFrame > import java.awt.BorderLayout > class TestEDT { > public static void main( String[] args ) > { > def myLabel > def swing = new SwingBuilder() > swing.edt { > frame(pack:true, show:true, > defaultCloseOperation:JFrame.EXIT_ON_CLOSE){ > borderLayout() > myLabel = label("Hello", constraints:BorderLayout.CENTER) > } > def sw = new SwingWorker() { > protected Object doInBackground() throws Exception > { > return 10 > } > protected void done() > { > myLabel.text = get() > } > }.execute(); > } > } > } > {code} > This throws: > {code}Exception in thread "main" groovy.lang.GroovyRuntimeException: Could > not find matching constructor for: TestEDT$1(java.lang.Class, > groovy.lang.Reference) > at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1481) > at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1397) > at > org.codehaus.groovy.runtime.callsite.MetaClassConstructorSite.callConstructor(MetaClassConstructorSite.java:46) > at > org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:52) > at > org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190) > at > org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:202) > at TestEDT$_main_closure1.doCall(TestEDT.groovy:17) > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)