11.1.2 - not resolving groovy SwingBuilder when using invoke-dynamic JAR

I wanted to experiment with the new release of groovy 2.0, and in particular see the effects on performance with the invoke-dynamic ('indy') enabled version.  When I tried to move to this library, I found that my production project would no longer build correctly.  Specifically, it seemed to have problems resolving SwingBuilder from the groovy JAR.  When I switched the library to the non-indy version of the groovy JAR, functionality was once again restored.

To see if I could duplicate the problem, I created a new project (Java Module) in IntelliJ - I don't select any of the 'technologies' (i.e. Groovy) during the New Project Wizard steps.  Once the project was created, I went to the project libraries, and added groovy-all-2.0.0-indy.jar.

Then I added a new Groovy class.  The contents of which were:

//********* Test.groovy **********
import groovy.swing.SwingBuilder
import java.awt.BorderLayout
import java.awt.Dimension
import javax.swing.WindowConstants

class Test {
    static void main(String[] args) {
        def frame = new SwingBuilder().frame(title: 'Test', defaultCloseOperation: WindowConstants.DISPOSE_ON_CLOSE, size: new Dimension(640, 480), layout: new BorderLayout()) {
            panel {
                label("Hello", constraints: BorderLayout.CENTER)
        frame.visible = true
// end

IntelliJ does NOT resolve the groovy.swing.SwingBuilder import.
Is there something strange about this JAR file, or do I need to make any additional configuration changes to get this to work correctly?  The behavior is very unusual.

I have an oustanding thread on the groovy mailing list, discussing this same topic, but I wanted to ask here for the IDE perspective of this problem.


1 comment
Comment actions Permalink

It seems the bug does not exist in 12 EAP. Try it please http://eap.jetbrains.com/idea

I've created an issue for 11.1.2 http://youtrack.jetbrains.com/issue/IDEA-88632


Please sign in to leave a comment.