|
Groovy example source code file (Groovy1018_Bug.groovy)
The Groovy Groovy1018_Bug.groovy source codepackage groovy.bugs /** * Test to fix the Jira issues GROOVY-1018 and GROOVY-732. * Access to a static field member by a class name: * ClassName.fieldName or ClassName.@fieldName. * * @author Pilho Kim * @version $Revision: 2723 $ */ class Groovy1018_Bug extends GroovyTestCase { public static Object Class = "bar" // todo: GROOVY-1018 void testGetPublicStaticField() { def a = new Groovy1018_Bug() println( a.Class ) println( a.@Class ) println( Groovy1018_Bug.Class ) println( Groovy1018_Bug.@Class ) assert a.Class == "bar" && a.@Class == "bar" assert Groovy1018_Bug.Class == "bar" && Groovy1018_Bug.@Class == "bar" } // todo: GROOVY-732 void testSetPublicStaticField() { Groovy1018_Bug.Class = 'bar-' assert Groovy1018_Bug.Class == "bar-" && Groovy1018_Bug.@Class == "bar-" } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy Groovy1018_Bug.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
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.