| career | drupal | java | mac | mysql | perl | scala | uml | unix  

Groovy example source code file (Groovy3776Bug.groovy)

This example Groovy source code file (Groovy3776Bug.groovy) is included in the "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Groovy tags/keywords

groovy3776bug, groovybugerror, groovybugerror, groovyclassloader, groovyclassloader, groovytestcase, invalidlistliteral, invalidlistliteral, multiplecompilationerrorsexception, multiplecompilationerrorsexception, reflection

The Groovy Groovy3776Bug.groovy source code

package groovy.bugs

import java.lang.reflect.*
import org.codehaus.groovy.control.MultipleCompilationErrorsException
import org.codehaus.groovy.GroovyBugError

class Groovy3776Bug extends GroovyTestCase {
    void testInvalidListWithMapEntryExpressions() {
        GroovyClassLoader cl = new GroovyClassLoader();
        def scriptStr = """
            class InvalidListLiteral {
                def x = [
                    [foo: 1, bar: 2]
                    [foo: 1, bar: 2]
        try {
            fail('Compilation should have failed with MultipleCompilationErrorsException')
        } catch(MultipleCompilationErrorsException mcee) {
            // ok if failed with this error.
        } catch(GroovyBugError gbe) {
            fail('Compilation should have failed with MultipleCompilationErrorsException but failed with GroovyBugError')

Other Groovy examples (source code examples)

Here is a short list of links related to this Groovy Groovy3776Bug.groovy source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.