You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/04/27 09:50:53 UTC

[groovy] branch GROOVY_2_5_X updated (4945a52 -> 4230c1c)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a change to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from 4945a52  GROOVY-9073: added compiler option to enable preview features - fix typo (closes #906)
     new b298d52  minor refactor: remove javadoc warnings and tidy up
     new 77ee62f  minor refactor: remove javadoc warnings and tidy up (cont'd)
     new 7eb3072  minor refactor: fix CRLF endings
     new 9616f3c  minor refactor: remove javadoc warnings (cont'd)
     new b64ff97  minor refactor: remove javadoc warnings (cont'd 2)
     new 4230c1c  minor refactor: remove javadoc warnings (fix typo)

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 config/bnd/groovy-all.bnd                          |   38 +-
 config/bnd/groovy.bnd                              |   38 +-
 config/checkstyle/codeHeader.txt                   |   34 +-
 gradle/docs.gradle                                 |    5 +
 src/main/groovy/groovy/lang/Category.java          |    2 +-
 src/main/groovy/groovy/lang/Closure.java           |   46 +-
 src/main/groovy/groovy/lang/ExpandoMetaClass.java  |   42 +-
 src/main/groovy/groovy/lang/GrabConfig.java        |    8 +-
 src/main/groovy/groovy/lang/Range.java             |    2 +-
 src/main/groovy/groovy/transform/AutoFinal.java    |    4 +-
 .../groovy/groovy/transform/EqualsAndHashCode.java |   16 +-
 src/main/groovy/groovy/transform/Memoized.java     |    2 +-
 .../transform/builder/InitializerStrategy.java     |    4 +-
 .../groovy/transform/stc/MapEntryOrKeyValue.java   |    6 +-
 .../groovy/transform/stc/PickAnyArgumentHint.java  |    2 +-
 src/main/groovy/groovy/util/IndentPrinter.java     |    2 +-
 .../java/org/codehaus/groovy/antlr/EnumHelper.java |  136 +-
 .../groovy/ast/expr/ClosureExpression.java         |    4 +-
 .../groovy/ast/expr/MethodPointerExpression.java   |    4 +-
 .../groovy/ast/tools/WideningCategories.java       |    2 +-
 .../groovy/classgen/AnnotationVisitor.java         |  628 ++---
 .../codehaus/groovy/classgen/BytecodeSequence.java |  162 +-
 .../codehaus/groovy/classgen/ExtendedVerifier.java |  682 +++---
 .../groovy/classgen/InnerClassVisitorHelper.java   |  286 +--
 .../groovy/classgen/asm/BytecodeHelper.java        |   59 +-
 .../classgen/asm/MethodCallerMultiAdapter.java     |  164 +-
 .../codehaus/groovy/control/GenericsVisitor.java   |    2 +-
 .../groovy/control/SourceExtensionHandler.java     |  132 +-
 .../builder/InlinedASTCustomizerFactory.java       |    2 +-
 .../builder/SourceAwareCustomizerFactory.java      |    4 +-
 .../codehaus/groovy/reflection/ParameterTypes.java |  770 +++---
 .../codehaus/groovy/runtime/ComposedClosure.java   |   24 +-
 .../codehaus/groovy/runtime/ConversionHandler.java |  452 ++--
 .../codehaus/groovy/runtime/ConvertedClosure.java  |  108 +-
 .../codehaus/groovy/runtime/CurriedClosure.java    |    2 +-
 .../groovy/runtime/DefaultGroovyMethods.java       |  356 +--
 .../runtime/EncodingGroovyMethodsSupport.java      |  180 +-
 .../org/codehaus/groovy/runtime/GStringImpl.java   |  128 +-
 .../codehaus/groovy/runtime/IOGroovyMethods.java   |    4 +-
 .../groovy/runtime/NumberAwareComparator.java      |  112 +-
 .../groovy/runtime/ResourceGroovyMethods.java      |   16 +-
 .../groovy/runtime/StringGroovyMethods.java        |   44 +-
 .../arrays/CharacterArrayPutAtMetaMethod.java      |  172 +-
 .../dgmimpl/arrays/ObjectArrayPutAtMetaMethod.java |  194 +-
 .../runtime/metaclass/ConcurrentReaderHashMap.java | 2542 ++++++++++----------
 .../runtime/metaclass/MetaClassRegistryImpl.java   |    2 +-
 .../metaclass/MethodSelectionException.java        |  202 +-
 .../runtime/typehandling/GroovyCastException.java  |  174 +-
 .../groovy/runtime/typehandling/package.html       |   60 +-
 .../java/org/codehaus/groovy/tools/RootLoader.java |   15 +-
 .../org/codehaus/groovy/tools/StringHelper.java    |  172 +-
 .../groovy/transform/AbstractASTTransformUtil.java |  368 +--
 .../transform/AbstractASTTransformation.java       |  988 ++++----
 .../groovy/transform/FieldASTTransformation.java   |  584 ++---
 .../TupleConstructorASTTransformation.java         |  706 +++---
 .../transform/stc/StaticTypeCheckingSupport.java   |    2 +-
 .../codehaus/groovy/util/ComplexKeyHashMap.java    |  352 +--
 .../org/codehaus/groovy/util/SingleKeyHashMap.java |  322 +--
 .../org/codehaus/groovy/util/TripleKeyHashMap.java |  172 +-
 .../org/codehaus/groovy/vmplugin/VMPlugin.java     |  126 +-
 .../vmplugin/v5/PluginDefaultGroovyMethods.java    |  292 +--
 .../org/codehaus/groovy/vmplugin/v7/Java7.java     |  216 +-
 src/main/java/overview.html                        |   82 +-
 src/main/java/overviewj.html                       |   82 +-
 .../groovy/org.codehaus.groovy.source.Extensions   |   42 +-
 ...org.codehaus.groovy.transform.ASTTransformation |   40 +-
 .../services/org.codehaus.groovy.source.Extensions |   38 +-
 src/test/Outer3.groovy                             |   44 +-
 src/test/Outer4.groovy                             |   44 +-
 src/test/gls/CompilableTestSupport.groovy          |   80 +-
 src/test/gls/annotations/JavaAnnotation.java       |   54 +-
 src/test/gls/generics/GenericsTestBase.java        |  204 +-
 .../invocation/ConstructorDelegationTest.groovy    |  312 +--
 src/test/gls/invocation/MethodSelectionTest.groovy | 1014 ++++----
 src/test/gls/statements/DeclarationTest.groovy     |  100 +-
 src/test/gls/statements/ReturnTest.groovy          |  122 +-
 src/test/gls/syntax/AssertTest.groovy              |   58 +-
 .../gls/syntax/OldClosureSyntaxRemovalTest.groovy  |   88 +-
 .../gls/syntax/OldPropertySyntaxRemovalTest.groovy |   62 +-
 src/test/gls/syntax/OldSpreadTest.groovy           |   60 +-
 src/test/gls/syntax/ParsingTest.groovy             |  170 +-
 src/test/groovy/BinaryStreamsTest.groovy           |  334 +--
 src/test/groovy/ClosureJavaIntegrationTest.java    |  414 ++--
 src/test/groovy/ClosureMissingMethodTest.groovy    |  240 +-
 src/test/groovy/CompileOrderTest.groovy            |  164 +-
 src/test/groovy/FinallyTest.groovy                 |  300 +--
 .../groovy/GroovyCharSequenceMethodsTest.groovy    |  784 +++---
 src/test/groovy/JointGroovy.groovy                 |   60 +-
 src/test/groovy/JointJava.java                     |   54 +-
 src/test/groovy/KeywordsInPropertyNamesTest.groovy |  288 +--
 src/test/groovy/MethodInBadPositionTest.groovy     |   88 +-
 src/test/groovy/StaticMessageTest.groovy           |   76 +-
 src/test/groovy/ThisAndSuperTest.groovy            |  408 ++--
 src/test/groovy/annotations/MyClass.groovy         |   54 +-
 .../PackageAndImportAnnotationTest.groovy          |   80 +-
 src/test/groovy/annotations/package-info.groovy    |   38 +-
 src/test/groovy/bugs/G3839A1.java                  |   48 +-
 src/test/groovy/bugs/G3839A2.java                  |   50 +-
 src/test/groovy/bugs/G3839A3.java                  |   48 +-
 src/test/groovy/bugs/G3839A4.java                  |   50 +-
 src/test/groovy/bugs/G3839Transform1.java          |   70 +-
 src/test/groovy/bugs/G3839Transform2.java          |   70 +-
 src/test/groovy/bugs/G3839Transform3.java          |   70 +-
 src/test/groovy/bugs/G4410Producer1.java           |   48 +-
 src/test/groovy/bugs/G4410Producer2.java           |   50 +-
 src/test/groovy/bugs/Groovy1407_Bug.groovy         |   86 +-
 src/test/groovy/bugs/Groovy1465Bug.groovy          |  112 +-
 src/test/groovy/bugs/Groovy1593.groovy             |   64 +-
 src/test/groovy/bugs/Groovy1617_Bug.groovy         |   72 +-
 src/test/groovy/bugs/Groovy1706_Bug.groovy         |   82 +-
 src/test/groovy/bugs/Groovy2271Bug.groovy          |   94 +-
 src/test/groovy/bugs/Groovy2339Bug.groovy          |   68 +-
 src/test/groovy/bugs/Groovy2801Bug.groovy          |   60 +-
 src/test/groovy/bugs/Groovy2849Bug.groovy          |   84 +-
 src/test/groovy/bugs/Groovy2951Bug.groovy          |  106 +-
 src/test/groovy/bugs/Groovy3069Bug.groovy          |  124 +-
 src/test/groovy/bugs/Groovy3135Bug.groovy          |  150 +-
 src/test/groovy/bugs/Groovy3139Bug.groovy          |  112 +-
 src/test/groovy/bugs/Groovy3156And2621Bug.groovy   |  110 +-
 src/test/groovy/bugs/Groovy3205Bug.groovy          |   70 +-
 src/test/groovy/bugs/Groovy3238Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy3305Bug.groovy          |  106 +-
 src/test/groovy/bugs/Groovy3311Bug.groovy          |   66 +-
 src/test/groovy/bugs/Groovy3335Bug.groovy          |   54 +-
 src/test/groovy/bugs/Groovy3339Bug.groovy          |  110 +-
 src/test/groovy/bugs/Groovy3383Bug.groovy          |   62 +-
 src/test/groovy/bugs/Groovy3389Bug.groovy          |   70 +-
 src/test/groovy/bugs/Groovy3403Bug.groovy          |  118 +-
 src/test/groovy/bugs/Groovy3405Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy3410Bug.groovy          |  164 +-
 src/test/groovy/bugs/Groovy3462Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy3465Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy3465Helper.groovy       |   56 +-
 src/test/groovy/bugs/Groovy3498Bug.groovy          |   56 +-
 src/test/groovy/bugs/Groovy3511Bug.groovy          |  110 +-
 src/test/groovy/bugs/Groovy3560Bug.groovy          |   52 +-
 src/test/groovy/bugs/Groovy3560Helper.java         |   66 +-
 src/test/groovy/bugs/Groovy3574Bug.groovy          |  122 +-
 src/test/groovy/bugs/Groovy3590Bug.groovy          |   52 +-
 src/test/groovy/bugs/Groovy3596Bug.groovy          |   60 +-
 src/test/groovy/bugs/Groovy3645Bug.groovy          |   68 +-
 src/test/groovy/bugs/Groovy3658Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy3679Bug.groovy          |   96 +-
 src/test/groovy/bugs/Groovy3716Bug.groovy          |   58 +-
 src/test/groovy/bugs/Groovy3718Bug.groovy          |   62 +-
 src/test/groovy/bugs/Groovy3719Bug.groovy          |   62 +-
 src/test/groovy/bugs/Groovy3719Bug_script.groovy   |   38 +-
 src/test/groovy/bugs/Groovy3720Bug.groovy          |  128 +-
 src/test/groovy/bugs/Groovy3721Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy3723Bug.groovy          |   90 +-
 src/test/groovy/bugs/Groovy3726Bug.groovy          |  126 +-
 src/test/groovy/bugs/Groovy3731Bug.groovy          |   86 +-
 src/test/groovy/bugs/Groovy3749Bug.groovy          |  182 +-
 src/test/groovy/bugs/Groovy3768Bug.groovy          |  100 +-
 src/test/groovy/bugs/Groovy3770Bug.groovy          |  112 +-
 src/test/groovy/bugs/Groovy3776Bug.groovy          |   92 +-
 src/test/groovy/bugs/Groovy3784Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy3789Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy3799Bug.groovy          |   62 +-
 src/test/groovy/bugs/Groovy3799Helper.java         |   94 +-
 src/test/groovy/bugs/Groovy3801Bug.groovy          |  106 +-
 src/test/groovy/bugs/Groovy3817Bug.groovy          |   88 +-
 src/test/groovy/bugs/Groovy3818Bug.groovy          |   96 +-
 src/test/groovy/bugs/Groovy3827Bug.groovy          |   76 +-
 src/test/groovy/bugs/Groovy3830Bug.groovy          |  144 +-
 src/test/groovy/bugs/Groovy3831Bug.groovy          |  106 +-
 src/test/groovy/bugs/Groovy3834Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy3839Bug.groovy          |  148 +-
 src/test/groovy/bugs/Groovy3852Bug.groovy          |  214 +-
 src/test/groovy/bugs/Groovy3857Bug.groovy          |   60 +-
 src/test/groovy/bugs/Groovy3863Bug.groovy          |   62 +-
 src/test/groovy/bugs/Groovy3868Bug.groovy          |   80 +-
 src/test/groovy/bugs/Groovy3873Bug.groovy          |   66 +-
 src/test/groovy/bugs/Groovy3876Bug.groovy          |   84 +-
 src/test/groovy/bugs/Groovy3894Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy3904Bug.groovy          |  168 +-
 src/test/groovy/bugs/Groovy3949Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy3989Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy4006Bug.groovy          |  298 +--
 src/test/groovy/bugs/Groovy4009Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy4025Bug.groovy          |   84 +-
 src/test/groovy/bugs/Groovy4029Bug.groovy          |   54 +-
 src/test/groovy/bugs/Groovy4035Bug.groovy          |   96 +-
 src/test/groovy/bugs/Groovy4038Bug.groovy          |   56 +-
 src/test/groovy/bugs/Groovy4043Bug.groovy          |   68 +-
 src/test/groovy/bugs/Groovy4046Bug.groovy          |   58 +-
 src/test/groovy/bugs/Groovy4069Bug.groovy          |  268 +--
 src/test/groovy/bugs/Groovy4075Bug.groovy          |   82 +-
 src/test/groovy/bugs/Groovy4078Bug.groovy          |   98 +-
 src/test/groovy/bugs/Groovy4080Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4081Bug.groovy          |   76 +-
 src/test/groovy/bugs/Groovy4098Bug.groovy          |  296 +--
 src/test/groovy/bugs/Groovy4098Child.groovy        |   74 +-
 src/test/groovy/bugs/Groovy4098Parent.groovy       |   50 +-
 src/test/groovy/bugs/Groovy4104A.java              |   60 +-
 src/test/groovy/bugs/Groovy4104B.java              |   40 +-
 src/test/groovy/bugs/Groovy4104Bug.groovy          |   66 +-
 src/test/groovy/bugs/Groovy4106Bug.groovy          |   54 +-
 src/test/groovy/bugs/Groovy4107Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4111Bug.groovy          |   80 +-
 src/test/groovy/bugs/Groovy4116Bug.groovy          |  130 +-
 src/test/groovy/bugs/Groovy4119Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4120Bug.groovy          |  112 +-
 src/test/groovy/bugs/Groovy4121Bug.groovy          |   94 +-
 src/test/groovy/bugs/Groovy4129Bug.groovy          |   66 +-
 src/test/groovy/bugs/Groovy4131Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy4133Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy4134Bug.groovy          |   54 +-
 src/test/groovy/bugs/Groovy4139Bug.groovy          |   66 +-
 src/test/groovy/bugs/Groovy4145.groovy             |   48 +-
 src/test/groovy/bugs/Groovy4151Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy4169Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4170Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy4188Bug.groovy          |   76 +-
 src/test/groovy/bugs/Groovy4190Bug.groovy          |  102 +-
 src/test/groovy/bugs/Groovy4191Bug.groovy          |   60 +-
 src/test/groovy/bugs/Groovy4193Bug.groovy          |   60 +-
 src/test/groovy/bugs/Groovy4202Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4206Bug.groovy          |   68 +-
 src/test/groovy/bugs/Groovy4235Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy4241Bug.groovy          |   80 +-
 src/test/groovy/bugs/Groovy4243Bug.groovy          |   96 +-
 src/test/groovy/bugs/Groovy4246Bug.groovy          |   94 +-
 src/test/groovy/bugs/Groovy4247Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy4252Bug.groovy          |  170 +-
 src/test/groovy/bugs/Groovy4257Bug.groovy          |   80 +-
 src/test/groovy/bugs/Groovy4264Bug.groovy          |  138 +-
 src/test/groovy/bugs/Groovy4272Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy4273Bug.groovy          |  130 +-
 src/test/groovy/bugs/Groovy4293Bug.groovy          |   80 +-
 src/test/groovy/bugs/Groovy4325Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4386_Bug.groovy         |  178 +-
 src/test/groovy/bugs/Groovy4393Bug.groovy          |   56 +-
 src/test/groovy/bugs/Groovy4393BugV1.foogroovy     |   40 +-
 src/test/groovy/bugs/Groovy4410Bug.groovy          |  124 +-
 src/test/groovy/bugs/Groovy4414Bug.groovy          |  138 +-
 src/test/groovy/bugs/Groovy4416Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy4435Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy4449Bug.groovy          |   88 +-
 src/test/groovy/bugs/Groovy4497Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy4516Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy4584Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4607Bug.groovy          |  104 +-
 src/test/groovy/bugs/Groovy4861Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy513_Bug.groovy          |   72 +-
 src/test/groovy/bugs/GroovyInnerEnumBug.groovy     |   94 +-
 .../groovy/grape/GrabErrorIsolationTest.groovy     |  112 +-
 src/test/groovy/grape/GrapeClassLoaderTest.groovy  |  568 ++---
 src/test/groovy/lang/CategoryAnnotationTest.groovy |  596 ++---
 src/test/groovy/lang/Groovy3406Test.groovy         |   52 +-
 .../groovy/lang/InnerClassResolvingTest.groovy     |  122 +-
 src/test/groovy/lang/StripMarginTest.groovy        |  186 +-
 .../groovy/mock/interceptor/HalfMockTest.groovy    |  284 +--
 .../groovy/mock/interceptor/IteratorCounter.java   |   52 +-
 .../groovy/mock/interceptor/MockForJavaTest.groovy |  108 +-
 .../mock/interceptor/MockNestedCallTest.groovy     |   90 +-
 .../groovy/mock/interceptor/StubForJavaTest.groovy |  100 +-
 src/test/groovy/util/ResourceBundleTest.groovy     |  154 +-
 src/test/groovy/util/i18n.properties               |   40 +-
 src/test/groovy/util/i18n_fr.properties            |   40 +-
 src/test/groovy/util/logging/LogTest.groovy        |  748 +++---
 .../codehaus/groovy/antlr/SourceParserTest.java    |  104 +-
 .../org/codehaus/groovy/ast/LineColumnCheck.txt    |  938 ++++----
 .../groovy/ast/expr/MapExpressionTest.groovy       |   88 +-
 .../groovy/classgen/ReflectorLoaderTest.groovy     |   64 +-
 .../groovy/control/CompilerConfigurationTest.java  |  460 ++--
 .../reflection/utils/PojoCallerTestClass.java      |   66 +-
 .../reflection/utils/ReflectionUtilsTest.groovy    |  192 +-
 .../groovy/runtime/MetaClassHelperTest.java        |   54 +-
 .../groovy/runtime/NestedCategoryTest.groovy       |  158 +-
 .../groovy/tools/LoaderConfigurationTest.groovy    |  276 +--
 .../codehaus/groovy/tools/StringHelperTest.groovy  |   70 +-
 .../org/codehaus/groovy/tools/UtilitiesTest.groovy |   84 +-
 .../AbstractGenericGroovySuperclass.groovy         |   68 +-
 .../rootloadersync/AbstractGroovySuperclass.groovy |   54 +-
 .../ConcreteGenericJavaSubclass.java               |   64 +-
 .../tools/rootloadersync/ConcreteJavaSubclass.java |   52 +-
 .../OtherConcreteGenericJavaSubclass.java          |   64 +-
 .../rootloadersync/OtherConcreteJavaSubclass.java  |   52 +-
 .../rootloadersync/SubclassingInGroovyTest.groovy  |   78 +-
 .../rootloadersync/SubclassingInJavaTest.java      |   82 +-
 .../groovy/transform/CanonicalTransformTest.groovy | 1184 ++++-----
 .../groovy/transform/FieldTransformTest.groovy     |  572 ++---
 .../groovy/transform/GlobalTransformTest.groovy    |   70 +-
 .../transform/IndexedPropertyTransformTest.groovy  |  148 +-
 .../groovy/transform/LazyTransformTest.groovy      |  446 ++--
 ...org.codehaus.groovy.transform.ASTTransformation |   34 +-
 .../groovy/transform/NewifyTransformTest.groovy    |  474 ++--
 .../transform/SingletonASTTransformationTest.java  |   94 +-
 .../codehaus/groovy/transform/TestTransform.groovy |   96 +-
 .../jmx/builder/JmxAttributeInfoManager.groovy     |  180 +-
 .../groovy/jmx/builder/JmxBeanExportFactory.groovy |  106 +-
 .../groovy/jmx/builder/JmxBeanFactory.groovy       |  326 +--
 .../groovy/jmx/builder/JmxBeanInfoManager.groovy   |  190 +-
 .../groovy/groovy/jmx/builder/JmxBuilder.groovy    |  208 +-
 .../groovy/jmx/builder/JmxBuilderTools.groovy      |  636 ++---
 .../jmx/builder/JmxClientConnectorFactory.groovy   |  146 +-
 .../groovy/jmx/builder/JmxEmitterFactory.groovy    |  222 +-
 .../groovy/jmx/builder/JmxListenerFactory.groovy   |  158 +-
 .../groovy/jmx/builder/JmxMetaMapBuilder.groovy    | 1294 +++++-----
 .../jmx/builder/JmxOperationInfoManager.groovy     |  436 ++--
 .../jmx/builder/JmxServerConnectorFactory.groovy   |  276 +--
 .../groovy/jmx/builder/JmxTimerFactory.groovy      |  396 +--
 .../groovy/groovy/jmx/builder/package-info.groovy  |   44 +-
 .../groovy/jmx/builder/JmxBuilderException.java    |  116 +-
 .../groovy/jmx/builder/JmxBuilderModelMBean.java   |  443 ++--
 .../java/groovy/jmx/builder/JmxEventEmitter.java   |  212 +-
 .../groovy/jmx/builder/JmxEventEmitterMBean.java   |   98 +-
 .../java/groovy/jmx/builder/JmxEventListener.java  |  160 +-
 .../jmx/builder/JmxAttributeInfoManagerTest.groovy |  126 +-
 .../jmx/builder/JmxBeanExportFactoryTest.groovy    | 1124 ++++-----
 .../groovy/jmx/builder/JmxBeanFactoryTest.groovy   |  184 +-
 .../jmx/builder/JmxBeanInfoManagerTest.groovy      |  148 +-
 .../groovy/jmx/builder/JmxBuilderToolsTest.groovy  |  260 +-
 .../builder/JmxClientConnectorFactoryTest.groovy   |  142 +-
 .../jmx/builder/JmxEmitterFactoryTest.groovy       |  198 +-
 .../jmx/builder/JmxListenerFactoryTest.groovy      |  122 +-
 .../jmx/builder/JmxMetaMapBuilderTest.groovy       | 1020 ++++----
 .../jmx/builder/JmxOperationInfoManagerTest.groovy |  376 +--
 .../builder/JmxServerConnectorFactoryTest.groovy   |  120 +-
 .../groovy/jmx/builder/JmxTimerFactoryTest.groovy  |  306 +--
 .../jmx/builder/MockManagedGroovyObject.groovy     |   74 +-
 .../groovy/jmx/builder/JmxConnectorHelper.java     |  132 +-
 .../java/groovy/jmx/builder/MockJmxListener.java   |   98 +-
 .../java/groovy/jmx/builder/MockManagedObject.java |  162 +-
 .../java/groovy/jmx/builder/MockSimpleObject.java  |   80 +-
 .../groovy/jmx/builder/MockSimpleObjectMBean.java  |   58 +-
 .../src/main/java/groovy/json/JsonBuilder.java     |    4 +-
 .../src/main/java/groovy/json/JsonGenerator.java   |    2 +-
 .../java/groovy/json/StreamingJsonBuilder.java     |   36 +-
 .../codehaus/groovy/runtime/NioGroovyMethods.java  |   16 +-
 .../main/java/groovy/servlet/GroovyServlet.java    |   20 +-
 .../src/main/java/groovy/sql/DataSet.java          |    4 +
 .../java/groovy/sql/ResultSetMetaDataWrapper.java  |    2 +-
 .../groovy-sql/src/main/java/groovy/sql/Sql.java   |   86 +-
 .../groovy/text/StreamingTemplateEngine.java       |   30 +-
 .../groovy/text/TemplateExecutionException.java    |  112 +-
 .../main/groovy/groovy/text/XmlTemplateEngine.java |    4 +-
 .../groovy/text/StreamingTemplateEngineTest.groovy |  924 +++----
 .../groovy/util/JavadocAssertionTestBuilder.groovy |    5 +-
 .../main/groovy/groovy/util/StringTestUtil.groovy  |   64 +-
 .../groovy/util/slurpersupport/GPathResult.java    |    4 +-
 .../src/main/java/groovy/xml/MarkupBuilder.java    |   14 +-
 343 files changed, 26385 insertions(+), 26354 deletions(-)


[groovy] 03/06: minor refactor: fix CRLF endings

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 7eb3072a539fb3c67a57e2be48163b9c37ddecdb
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Apr 27 13:41:33 2019 +1000

    minor refactor: fix CRLF endings
---
 config/bnd/groovy-all.bnd                          |   38 +-
 config/bnd/groovy.bnd                              |   38 +-
 config/checkstyle/codeHeader.txt                   |   34 +-
 .../java/org/codehaus/groovy/antlr/EnumHelper.java |  136 +-
 .../groovy/classgen/AnnotationVisitor.java         |  628 ++---
 .../codehaus/groovy/classgen/BytecodeSequence.java |  162 +-
 .../codehaus/groovy/classgen/ExtendedVerifier.java |  682 +++---
 .../groovy/classgen/InnerClassVisitorHelper.java   |  286 +--
 .../groovy/control/SourceExtensionHandler.java     |  132 +-
 .../codehaus/groovy/reflection/ParameterTypes.java |  770 +++---
 .../codehaus/groovy/runtime/ConversionHandler.java |  452 ++--
 .../codehaus/groovy/runtime/ConvertedClosure.java  |  108 +-
 .../runtime/EncodingGroovyMethodsSupport.java      |  180 +-
 .../org/codehaus/groovy/runtime/GStringImpl.java   |  128 +-
 .../groovy/runtime/NumberAwareComparator.java      |  112 +-
 .../arrays/CharacterArrayPutAtMetaMethod.java      |  172 +-
 .../dgmimpl/arrays/ObjectArrayPutAtMetaMethod.java |  194 +-
 .../runtime/metaclass/ConcurrentReaderHashMap.java | 2542 ++++++++++----------
 .../metaclass/MethodSelectionException.java        |  202 +-
 .../runtime/typehandling/GroovyCastException.java  |  174 +-
 .../groovy/runtime/typehandling/package.html       |   60 +-
 .../org/codehaus/groovy/tools/StringHelper.java    |  172 +-
 .../groovy/transform/AbstractASTTransformUtil.java |  368 +--
 .../transform/AbstractASTTransformation.java       |  988 ++++----
 .../groovy/transform/FieldASTTransformation.java   |  584 ++---
 .../TupleConstructorASTTransformation.java         |  706 +++---
 .../codehaus/groovy/util/ComplexKeyHashMap.java    |  352 +--
 .../org/codehaus/groovy/util/SingleKeyHashMap.java |  322 +--
 .../org/codehaus/groovy/util/TripleKeyHashMap.java |  172 +-
 .../org/codehaus/groovy/vmplugin/VMPlugin.java     |  126 +-
 .../vmplugin/v5/PluginDefaultGroovyMethods.java    |  292 +--
 .../org/codehaus/groovy/vmplugin/v7/Java7.java     |  216 +-
 src/main/java/overview.html                        |   82 +-
 src/main/java/overviewj.html                       |   82 +-
 .../groovy/org.codehaus.groovy.source.Extensions   |   42 +-
 ...org.codehaus.groovy.transform.ASTTransformation |   40 +-
 .../services/org.codehaus.groovy.source.Extensions |   38 +-
 src/test/Outer3.groovy                             |   44 +-
 src/test/Outer4.groovy                             |   44 +-
 src/test/gls/CompilableTestSupport.groovy          |   80 +-
 src/test/gls/annotations/JavaAnnotation.java       |   54 +-
 src/test/gls/generics/GenericsTestBase.java        |  204 +-
 .../invocation/ConstructorDelegationTest.groovy    |  312 +--
 src/test/gls/invocation/MethodSelectionTest.groovy | 1014 ++++----
 src/test/gls/statements/DeclarationTest.groovy     |  100 +-
 src/test/gls/statements/ReturnTest.groovy          |  122 +-
 src/test/gls/syntax/AssertTest.groovy              |   58 +-
 .../gls/syntax/OldClosureSyntaxRemovalTest.groovy  |   88 +-
 .../gls/syntax/OldPropertySyntaxRemovalTest.groovy |   62 +-
 src/test/gls/syntax/OldSpreadTest.groovy           |   60 +-
 src/test/gls/syntax/ParsingTest.groovy             |  170 +-
 src/test/groovy/BinaryStreamsTest.groovy           |  334 +--
 src/test/groovy/ClosureJavaIntegrationTest.java    |  414 ++--
 src/test/groovy/ClosureMissingMethodTest.groovy    |  240 +-
 src/test/groovy/CompileOrderTest.groovy            |  164 +-
 src/test/groovy/FinallyTest.groovy                 |  300 +--
 .../groovy/GroovyCharSequenceMethodsTest.groovy    |  784 +++---
 src/test/groovy/JointGroovy.groovy                 |   60 +-
 src/test/groovy/JointJava.java                     |   54 +-
 src/test/groovy/KeywordsInPropertyNamesTest.groovy |  288 +--
 src/test/groovy/MethodInBadPositionTest.groovy     |   88 +-
 src/test/groovy/StaticMessageTest.groovy           |   76 +-
 src/test/groovy/ThisAndSuperTest.groovy            |  408 ++--
 src/test/groovy/annotations/MyClass.groovy         |   54 +-
 .../PackageAndImportAnnotationTest.groovy          |   80 +-
 src/test/groovy/annotations/package-info.groovy    |   38 +-
 src/test/groovy/bugs/G3839A1.java                  |   48 +-
 src/test/groovy/bugs/G3839A2.java                  |   50 +-
 src/test/groovy/bugs/G3839A3.java                  |   48 +-
 src/test/groovy/bugs/G3839A4.java                  |   50 +-
 src/test/groovy/bugs/G3839Transform1.java          |   70 +-
 src/test/groovy/bugs/G3839Transform2.java          |   70 +-
 src/test/groovy/bugs/G3839Transform3.java          |   70 +-
 src/test/groovy/bugs/G4410Producer1.java           |   48 +-
 src/test/groovy/bugs/G4410Producer2.java           |   50 +-
 src/test/groovy/bugs/Groovy1407_Bug.groovy         |   86 +-
 src/test/groovy/bugs/Groovy1465Bug.groovy          |  112 +-
 src/test/groovy/bugs/Groovy1593.groovy             |   64 +-
 src/test/groovy/bugs/Groovy1617_Bug.groovy         |   72 +-
 src/test/groovy/bugs/Groovy1706_Bug.groovy         |   82 +-
 src/test/groovy/bugs/Groovy2271Bug.groovy          |   94 +-
 src/test/groovy/bugs/Groovy2339Bug.groovy          |   68 +-
 src/test/groovy/bugs/Groovy2801Bug.groovy          |   60 +-
 src/test/groovy/bugs/Groovy2849Bug.groovy          |   84 +-
 src/test/groovy/bugs/Groovy2951Bug.groovy          |  106 +-
 src/test/groovy/bugs/Groovy3069Bug.groovy          |  124 +-
 src/test/groovy/bugs/Groovy3135Bug.groovy          |  150 +-
 src/test/groovy/bugs/Groovy3139Bug.groovy          |  112 +-
 src/test/groovy/bugs/Groovy3156And2621Bug.groovy   |  110 +-
 src/test/groovy/bugs/Groovy3205Bug.groovy          |   70 +-
 src/test/groovy/bugs/Groovy3238Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy3305Bug.groovy          |  106 +-
 src/test/groovy/bugs/Groovy3311Bug.groovy          |   66 +-
 src/test/groovy/bugs/Groovy3335Bug.groovy          |   54 +-
 src/test/groovy/bugs/Groovy3339Bug.groovy          |  110 +-
 src/test/groovy/bugs/Groovy3383Bug.groovy          |   62 +-
 src/test/groovy/bugs/Groovy3389Bug.groovy          |   70 +-
 src/test/groovy/bugs/Groovy3403Bug.groovy          |  118 +-
 src/test/groovy/bugs/Groovy3405Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy3410Bug.groovy          |  164 +-
 src/test/groovy/bugs/Groovy3462Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy3465Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy3465Helper.groovy       |   56 +-
 src/test/groovy/bugs/Groovy3498Bug.groovy          |   56 +-
 src/test/groovy/bugs/Groovy3511Bug.groovy          |  110 +-
 src/test/groovy/bugs/Groovy3560Bug.groovy          |   52 +-
 src/test/groovy/bugs/Groovy3560Helper.java         |   66 +-
 src/test/groovy/bugs/Groovy3574Bug.groovy          |  122 +-
 src/test/groovy/bugs/Groovy3590Bug.groovy          |   52 +-
 src/test/groovy/bugs/Groovy3596Bug.groovy          |   60 +-
 src/test/groovy/bugs/Groovy3645Bug.groovy          |   68 +-
 src/test/groovy/bugs/Groovy3658Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy3679Bug.groovy          |   96 +-
 src/test/groovy/bugs/Groovy3716Bug.groovy          |   58 +-
 src/test/groovy/bugs/Groovy3718Bug.groovy          |   62 +-
 src/test/groovy/bugs/Groovy3719Bug.groovy          |   62 +-
 src/test/groovy/bugs/Groovy3719Bug_script.groovy   |   38 +-
 src/test/groovy/bugs/Groovy3720Bug.groovy          |  128 +-
 src/test/groovy/bugs/Groovy3721Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy3723Bug.groovy          |   90 +-
 src/test/groovy/bugs/Groovy3726Bug.groovy          |  126 +-
 src/test/groovy/bugs/Groovy3731Bug.groovy          |   86 +-
 src/test/groovy/bugs/Groovy3749Bug.groovy          |  182 +-
 src/test/groovy/bugs/Groovy3768Bug.groovy          |  100 +-
 src/test/groovy/bugs/Groovy3770Bug.groovy          |  112 +-
 src/test/groovy/bugs/Groovy3776Bug.groovy          |   92 +-
 src/test/groovy/bugs/Groovy3784Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy3789Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy3799Bug.groovy          |   62 +-
 src/test/groovy/bugs/Groovy3799Helper.java         |   94 +-
 src/test/groovy/bugs/Groovy3801Bug.groovy          |  106 +-
 src/test/groovy/bugs/Groovy3817Bug.groovy          |   88 +-
 src/test/groovy/bugs/Groovy3818Bug.groovy          |   96 +-
 src/test/groovy/bugs/Groovy3827Bug.groovy          |   76 +-
 src/test/groovy/bugs/Groovy3830Bug.groovy          |  144 +-
 src/test/groovy/bugs/Groovy3831Bug.groovy          |  106 +-
 src/test/groovy/bugs/Groovy3834Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy3839Bug.groovy          |  148 +-
 src/test/groovy/bugs/Groovy3852Bug.groovy          |  214 +-
 src/test/groovy/bugs/Groovy3857Bug.groovy          |   60 +-
 src/test/groovy/bugs/Groovy3863Bug.groovy          |   62 +-
 src/test/groovy/bugs/Groovy3868Bug.groovy          |   80 +-
 src/test/groovy/bugs/Groovy3873Bug.groovy          |   66 +-
 src/test/groovy/bugs/Groovy3876Bug.groovy          |   84 +-
 src/test/groovy/bugs/Groovy3894Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy3904Bug.groovy          |  168 +-
 src/test/groovy/bugs/Groovy3949Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy3989Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy4006Bug.groovy          |  298 +--
 src/test/groovy/bugs/Groovy4009Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy4025Bug.groovy          |   84 +-
 src/test/groovy/bugs/Groovy4029Bug.groovy          |   54 +-
 src/test/groovy/bugs/Groovy4035Bug.groovy          |   96 +-
 src/test/groovy/bugs/Groovy4038Bug.groovy          |   56 +-
 src/test/groovy/bugs/Groovy4043Bug.groovy          |   68 +-
 src/test/groovy/bugs/Groovy4046Bug.groovy          |   58 +-
 src/test/groovy/bugs/Groovy4069Bug.groovy          |  268 +--
 src/test/groovy/bugs/Groovy4075Bug.groovy          |   82 +-
 src/test/groovy/bugs/Groovy4078Bug.groovy          |   98 +-
 src/test/groovy/bugs/Groovy4080Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4081Bug.groovy          |   76 +-
 src/test/groovy/bugs/Groovy4098Bug.groovy          |  296 +--
 src/test/groovy/bugs/Groovy4098Child.groovy        |   74 +-
 src/test/groovy/bugs/Groovy4098Parent.groovy       |   50 +-
 src/test/groovy/bugs/Groovy4104A.java              |   60 +-
 src/test/groovy/bugs/Groovy4104B.java              |   40 +-
 src/test/groovy/bugs/Groovy4104Bug.groovy          |   66 +-
 src/test/groovy/bugs/Groovy4106Bug.groovy          |   54 +-
 src/test/groovy/bugs/Groovy4107Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4111Bug.groovy          |   80 +-
 src/test/groovy/bugs/Groovy4116Bug.groovy          |  130 +-
 src/test/groovy/bugs/Groovy4119Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4120Bug.groovy          |  112 +-
 src/test/groovy/bugs/Groovy4121Bug.groovy          |   94 +-
 src/test/groovy/bugs/Groovy4129Bug.groovy          |   66 +-
 src/test/groovy/bugs/Groovy4131Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy4133Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy4134Bug.groovy          |   54 +-
 src/test/groovy/bugs/Groovy4139Bug.groovy          |   66 +-
 src/test/groovy/bugs/Groovy4145.groovy             |   48 +-
 src/test/groovy/bugs/Groovy4151Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy4169Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4170Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy4188Bug.groovy          |   76 +-
 src/test/groovy/bugs/Groovy4190Bug.groovy          |  102 +-
 src/test/groovy/bugs/Groovy4191Bug.groovy          |   60 +-
 src/test/groovy/bugs/Groovy4193Bug.groovy          |   60 +-
 src/test/groovy/bugs/Groovy4202Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4206Bug.groovy          |   68 +-
 src/test/groovy/bugs/Groovy4235Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy4241Bug.groovy          |   80 +-
 src/test/groovy/bugs/Groovy4243Bug.groovy          |   96 +-
 src/test/groovy/bugs/Groovy4246Bug.groovy          |   94 +-
 src/test/groovy/bugs/Groovy4247Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy4252Bug.groovy          |  170 +-
 src/test/groovy/bugs/Groovy4257Bug.groovy          |   80 +-
 src/test/groovy/bugs/Groovy4264Bug.groovy          |  138 +-
 src/test/groovy/bugs/Groovy4272Bug.groovy          |   64 +-
 src/test/groovy/bugs/Groovy4273Bug.groovy          |  130 +-
 src/test/groovy/bugs/Groovy4293Bug.groovy          |   80 +-
 src/test/groovy/bugs/Groovy4325Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4386_Bug.groovy         |  178 +-
 src/test/groovy/bugs/Groovy4393Bug.groovy          |   56 +-
 src/test/groovy/bugs/Groovy4393BugV1.foogroovy     |   40 +-
 src/test/groovy/bugs/Groovy4410Bug.groovy          |  124 +-
 src/test/groovy/bugs/Groovy4414Bug.groovy          |  138 +-
 src/test/groovy/bugs/Groovy4416Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy4435Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy4449Bug.groovy          |   88 +-
 src/test/groovy/bugs/Groovy4497Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy4516Bug.groovy          |   78 +-
 src/test/groovy/bugs/Groovy4584Bug.groovy          |   72 +-
 src/test/groovy/bugs/Groovy4607Bug.groovy          |  104 +-
 src/test/groovy/bugs/Groovy4861Bug.groovy          |   74 +-
 src/test/groovy/bugs/Groovy513_Bug.groovy          |   72 +-
 src/test/groovy/bugs/GroovyInnerEnumBug.groovy     |   94 +-
 .../groovy/grape/GrabErrorIsolationTest.groovy     |  112 +-
 src/test/groovy/grape/GrapeClassLoaderTest.groovy  |  568 ++---
 src/test/groovy/lang/CategoryAnnotationTest.groovy |  596 ++---
 src/test/groovy/lang/Groovy3406Test.groovy         |   52 +-
 .../groovy/lang/InnerClassResolvingTest.groovy     |  122 +-
 src/test/groovy/lang/StripMarginTest.groovy        |  186 +-
 .../groovy/mock/interceptor/HalfMockTest.groovy    |  284 +--
 .../groovy/mock/interceptor/IteratorCounter.java   |   52 +-
 .../groovy/mock/interceptor/MockForJavaTest.groovy |  108 +-
 .../mock/interceptor/MockNestedCallTest.groovy     |   90 +-
 .../groovy/mock/interceptor/StubForJavaTest.groovy |  100 +-
 src/test/groovy/util/ResourceBundleTest.groovy     |  154 +-
 src/test/groovy/util/i18n.properties               |   40 +-
 src/test/groovy/util/i18n_fr.properties            |   40 +-
 src/test/groovy/util/logging/LogTest.groovy        |  748 +++---
 .../codehaus/groovy/antlr/SourceParserTest.java    |  104 +-
 .../org/codehaus/groovy/ast/LineColumnCheck.txt    |  938 ++++----
 .../groovy/ast/expr/MapExpressionTest.groovy       |   88 +-
 .../groovy/classgen/ReflectorLoaderTest.groovy     |   64 +-
 .../groovy/control/CompilerConfigurationTest.java  |  460 ++--
 .../reflection/utils/PojoCallerTestClass.java      |   66 +-
 .../reflection/utils/ReflectionUtilsTest.groovy    |  192 +-
 .../groovy/runtime/MetaClassHelperTest.java        |   54 +-
 .../groovy/runtime/NestedCategoryTest.groovy       |  158 +-
 .../groovy/tools/LoaderConfigurationTest.groovy    |  276 +--
 .../codehaus/groovy/tools/StringHelperTest.groovy  |   70 +-
 .../org/codehaus/groovy/tools/UtilitiesTest.groovy |   84 +-
 .../AbstractGenericGroovySuperclass.groovy         |   68 +-
 .../rootloadersync/AbstractGroovySuperclass.groovy |   54 +-
 .../ConcreteGenericJavaSubclass.java               |   64 +-
 .../tools/rootloadersync/ConcreteJavaSubclass.java |   52 +-
 .../OtherConcreteGenericJavaSubclass.java          |   64 +-
 .../rootloadersync/OtherConcreteJavaSubclass.java  |   52 +-
 .../rootloadersync/SubclassingInGroovyTest.groovy  |   78 +-
 .../rootloadersync/SubclassingInJavaTest.java      |   82 +-
 .../groovy/transform/CanonicalTransformTest.groovy | 1184 ++++-----
 .../groovy/transform/FieldTransformTest.groovy     |  572 ++---
 .../groovy/transform/GlobalTransformTest.groovy    |   70 +-
 .../transform/IndexedPropertyTransformTest.groovy  |  148 +-
 .../groovy/transform/LazyTransformTest.groovy      |  446 ++--
 ...org.codehaus.groovy.transform.ASTTransformation |   34 +-
 .../groovy/transform/NewifyTransformTest.groovy    |  474 ++--
 .../transform/SingletonASTTransformationTest.java  |   94 +-
 .../codehaus/groovy/transform/TestTransform.groovy |   96 +-
 .../jmx/builder/JmxAttributeInfoManager.groovy     |  180 +-
 .../groovy/jmx/builder/JmxBeanExportFactory.groovy |  106 +-
 .../groovy/jmx/builder/JmxBeanFactory.groovy       |  326 +--
 .../groovy/jmx/builder/JmxBeanInfoManager.groovy   |  190 +-
 .../groovy/groovy/jmx/builder/JmxBuilder.groovy    |  208 +-
 .../groovy/jmx/builder/JmxBuilderTools.groovy      |  636 ++---
 .../jmx/builder/JmxClientConnectorFactory.groovy   |  146 +-
 .../groovy/jmx/builder/JmxEmitterFactory.groovy    |  222 +-
 .../groovy/jmx/builder/JmxListenerFactory.groovy   |  158 +-
 .../groovy/jmx/builder/JmxMetaMapBuilder.groovy    | 1294 +++++-----
 .../jmx/builder/JmxOperationInfoManager.groovy     |  436 ++--
 .../jmx/builder/JmxServerConnectorFactory.groovy   |  276 +--
 .../groovy/jmx/builder/JmxTimerFactory.groovy      |  396 +--
 .../groovy/groovy/jmx/builder/package-info.groovy  |   44 +-
 .../groovy/jmx/builder/JmxBuilderException.java    |  116 +-
 .../groovy/jmx/builder/JmxBuilderModelMBean.java   |  442 ++--
 .../java/groovy/jmx/builder/JmxEventEmitter.java   |  212 +-
 .../groovy/jmx/builder/JmxEventEmitterMBean.java   |   98 +-
 .../java/groovy/jmx/builder/JmxEventListener.java  |  160 +-
 .../jmx/builder/JmxAttributeInfoManagerTest.groovy |  126 +-
 .../jmx/builder/JmxBeanExportFactoryTest.groovy    | 1124 ++++-----
 .../groovy/jmx/builder/JmxBeanFactoryTest.groovy   |  184 +-
 .../jmx/builder/JmxBeanInfoManagerTest.groovy      |  148 +-
 .../groovy/jmx/builder/JmxBuilderToolsTest.groovy  |  260 +-
 .../builder/JmxClientConnectorFactoryTest.groovy   |  142 +-
 .../jmx/builder/JmxEmitterFactoryTest.groovy       |  198 +-
 .../jmx/builder/JmxListenerFactoryTest.groovy      |  122 +-
 .../jmx/builder/JmxMetaMapBuilderTest.groovy       | 1020 ++++----
 .../jmx/builder/JmxOperationInfoManagerTest.groovy |  376 +--
 .../builder/JmxServerConnectorFactoryTest.groovy   |  120 +-
 .../groovy/jmx/builder/JmxTimerFactoryTest.groovy  |  306 +--
 .../jmx/builder/MockManagedGroovyObject.groovy     |   74 +-
 .../groovy/jmx/builder/JmxConnectorHelper.java     |  132 +-
 .../java/groovy/jmx/builder/MockJmxListener.java   |   98 +-
 .../java/groovy/jmx/builder/MockManagedObject.java |  162 +-
 .../java/groovy/jmx/builder/MockSimpleObject.java  |   80 +-
 .../groovy/jmx/builder/MockSimpleObjectMBean.java  |   58 +-
 .../groovy/text/TemplateExecutionException.java    |  112 +-
 .../groovy/text/StreamingTemplateEngineTest.groovy |  924 +++----
 299 files changed, 25800 insertions(+), 25800 deletions(-)

diff --git a/config/bnd/groovy-all.bnd b/config/bnd/groovy-all.bnd
index 3de9d83..cab706f 100644
--- a/config/bnd/groovy-all.bnd
+++ b/config/bnd/groovy-all.bnd
@@ -1,19 +1,19 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-version= @GROOVY_BUNDLE_VERSION@
--nouses= true
-Export-Package= *;version=${version}
-Import-Package= *;resolution:=optional
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+version= @GROOVY_BUNDLE_VERSION@
+-nouses= true
+Export-Package= *;version=${version}
+Import-Package= *;resolution:=optional
diff --git a/config/bnd/groovy.bnd b/config/bnd/groovy.bnd
index 2a5f8e3..f5df535 100644
--- a/config/bnd/groovy.bnd
+++ b/config/bnd/groovy.bnd
@@ -1,19 +1,19 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-version= @GROOVY_BUNDLE_VERSION@
--nouses= true
-Export-Package= *;version=${version}
-Import-Package= antlr, org.objectweb.asm, *;resolution:=optional
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+version= @GROOVY_BUNDLE_VERSION@
+-nouses= true
+Export-Package= *;version=${version}
+Import-Package= antlr, org.objectweb.asm, *;resolution:=optional
diff --git a/config/checkstyle/codeHeader.txt b/config/checkstyle/codeHeader.txt
index 3673647..ca35f1a 100644
--- a/config/checkstyle/codeHeader.txt
+++ b/config/checkstyle/codeHeader.txt
@@ -1,18 +1,18 @@
-^/\*$
-^ \* ? Licensed to the Apache Software Foundation \(ASF\) under one$
-^ \* ? or more contributor license agreements\.  See the NOTICE file$
-^ \* ? distributed with this work for additional information$
-^ \* ? regarding copyright ownership\.  The ASF licenses this file$
-^ \* ? to you under the Apache License, Version 2\.0 \(the$
-^ \* ? "License"\); you may not use this file except in compliance$
-^ \* ? with the License\.  You may obtain a copy of the License at$
-^ \*$
-^ \* ?   http://www\.apache\.org/licenses/LICENSE-2\.0$
-^ \*$
-^ \* ? Unless required by applicable law or agreed to in writing,$
-^ \* ? software distributed under the License is distributed on an$
-^ \* ? "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY$
-^ \* ? KIND, either express or implied\.  See the License for the$
-^ \* ? specific language governing permissions and limitations$
-^ \* ? under the License\.$
+^/\*$
+^ \* ? Licensed to the Apache Software Foundation \(ASF\) under one$
+^ \* ? or more contributor license agreements\.  See the NOTICE file$
+^ \* ? distributed with this work for additional information$
+^ \* ? regarding copyright ownership\.  The ASF licenses this file$
+^ \* ? to you under the Apache License, Version 2\.0 \(the$
+^ \* ? "License"\); you may not use this file except in compliance$
+^ \* ? with the License\.  You may obtain a copy of the License at$
+^ \*$
+^ \* ?   http://www\.apache\.org/licenses/LICENSE-2\.0$
+^ \*$
+^ \* ? Unless required by applicable law or agreed to in writing,$
+^ \* ? software distributed under the License is distributed on an$
+^ \* ? "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY$
+^ \* ? KIND, either express or implied\.  See the License for the$
+^ \* ? specific language governing permissions and limitations$
+^ \* ? under the License\.$
 ^ \*.*
\ No newline at end of file
diff --git a/src/main/java/org/codehaus/groovy/antlr/EnumHelper.java b/src/main/java/org/codehaus/groovy/antlr/EnumHelper.java
index 6f5fc3e..803bd0b 100644
--- a/src/main/java/org/codehaus/groovy/antlr/EnumHelper.java
+++ b/src/main/java/org/codehaus/groovy/antlr/EnumHelper.java
@@ -1,68 +1,68 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.antlr;
-
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.GenericsType;
-import org.codehaus.groovy.ast.InnerClassNode;
-import org.codehaus.groovy.ast.MixinNode;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.ListExpression;
-import org.objectweb.asm.Opcodes;
-
-public class EnumHelper {
-    private static final int FS = Opcodes.ACC_FINAL | Opcodes.ACC_STATIC;
-    private static final int PUBLIC_FS = Opcodes.ACC_PUBLIC | FS; 
-    
-    public static ClassNode makeEnumNode(String name, int modifiers, ClassNode[] interfaces, ClassNode outerClass) {
-        modifiers = modifiers | Opcodes.ACC_FINAL | Opcodes.ACC_ENUM;
-        ClassNode enumClass;
-        if (outerClass==null) {
-            enumClass = new ClassNode(name,modifiers,null,interfaces,MixinNode.EMPTY_ARRAY);
-        } else {
-            name = outerClass.getName() + "$" + name;
-            modifiers |= Opcodes.ACC_STATIC;
-            enumClass = new InnerClassNode(outerClass,name,modifiers,null,interfaces,MixinNode.EMPTY_ARRAY);
-        }
-        
-        // set super class and generics info
-        // "enum X" -> class X extends Enum<X>
-        GenericsType gt = new GenericsType(enumClass);
-        ClassNode superClass = ClassHelper.makeWithoutCaching("java.lang.Enum");
-        superClass.setGenericsTypes(new GenericsType[]{gt});
-        enumClass.setSuperClass(superClass);
-        superClass.setRedirect(ClassHelper.Enum_Type);
-        
-        return enumClass;
-    }
-
-    public static FieldNode addEnumConstant(ClassNode enumClass, String name, Expression init) {
-        int modifiers = PUBLIC_FS | Opcodes.ACC_ENUM;
-        if (init != null && !(init instanceof ListExpression)) {
-            ListExpression list = new ListExpression();
-            list.addExpression(init);
-            init = list;
-        }
-        FieldNode fn = new FieldNode(name, modifiers, enumClass.getPlainNodeReference(), enumClass, init);
-        enumClass.addField(fn);
-        return fn;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.antlr;
+
+import org.codehaus.groovy.ast.ClassHelper;
+import org.codehaus.groovy.ast.ClassNode;
+import org.codehaus.groovy.ast.FieldNode;
+import org.codehaus.groovy.ast.GenericsType;
+import org.codehaus.groovy.ast.InnerClassNode;
+import org.codehaus.groovy.ast.MixinNode;
+import org.codehaus.groovy.ast.expr.Expression;
+import org.codehaus.groovy.ast.expr.ListExpression;
+import org.objectweb.asm.Opcodes;
+
+public class EnumHelper {
+    private static final int FS = Opcodes.ACC_FINAL | Opcodes.ACC_STATIC;
+    private static final int PUBLIC_FS = Opcodes.ACC_PUBLIC | FS; 
+    
+    public static ClassNode makeEnumNode(String name, int modifiers, ClassNode[] interfaces, ClassNode outerClass) {
+        modifiers = modifiers | Opcodes.ACC_FINAL | Opcodes.ACC_ENUM;
+        ClassNode enumClass;
+        if (outerClass==null) {
+            enumClass = new ClassNode(name,modifiers,null,interfaces,MixinNode.EMPTY_ARRAY);
+        } else {
+            name = outerClass.getName() + "$" + name;
+            modifiers |= Opcodes.ACC_STATIC;
+            enumClass = new InnerClassNode(outerClass,name,modifiers,null,interfaces,MixinNode.EMPTY_ARRAY);
+        }
+        
+        // set super class and generics info
+        // "enum X" -> class X extends Enum<X>
+        GenericsType gt = new GenericsType(enumClass);
+        ClassNode superClass = ClassHelper.makeWithoutCaching("java.lang.Enum");
+        superClass.setGenericsTypes(new GenericsType[]{gt});
+        enumClass.setSuperClass(superClass);
+        superClass.setRedirect(ClassHelper.Enum_Type);
+        
+        return enumClass;
+    }
+
+    public static FieldNode addEnumConstant(ClassNode enumClass, String name, Expression init) {
+        int modifiers = PUBLIC_FS | Opcodes.ACC_ENUM;
+        if (init != null && !(init instanceof ListExpression)) {
+            ListExpression list = new ListExpression();
+            list.addExpression(init);
+            init = list;
+        }
+        FieldNode fn = new FieldNode(name, modifiers, enumClass.getPlainNodeReference(), enumClass, init);
+        enumClass.addField(fn);
+        return fn;
+    }
+}
diff --git a/src/main/java/org/codehaus/groovy/classgen/AnnotationVisitor.java b/src/main/java/org/codehaus/groovy/classgen/AnnotationVisitor.java
index 46c471e..42eb463 100644
--- a/src/main/java/org/codehaus/groovy/classgen/AnnotationVisitor.java
+++ b/src/main/java/org/codehaus/groovy/classgen/AnnotationVisitor.java
@@ -1,314 +1,314 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.classgen;
-
-import org.codehaus.groovy.ast.ASTNode;
-import org.codehaus.groovy.ast.AnnotationNode;
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.MethodNode;
-import org.codehaus.groovy.ast.expr.AnnotationConstantExpression;
-import org.codehaus.groovy.ast.expr.ClassExpression;
-import org.codehaus.groovy.ast.expr.ClosureExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.ListExpression;
-import org.codehaus.groovy.ast.expr.PropertyExpression;
-import org.codehaus.groovy.ast.expr.VariableExpression;
-import org.codehaus.groovy.ast.stmt.ReturnStatement;
-import org.codehaus.groovy.control.ErrorCollector;
-import org.codehaus.groovy.control.SourceUnit;
-import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
-import org.codehaus.groovy.syntax.SyntaxException;
-import org.codehaus.groovy.vmplugin.VMPluginFactory;
-
-import java.util.List;
-import java.util.Map;
-
-import static org.apache.groovy.ast.tools.ExpressionUtils.transformInlineConstants;
-
-/**
- * An Annotation visitor responsible for:
- * <ul>
- * <li>reading annotation metadata (@Retention, @Target, attribute types)</li>
- * <li>verify that an <code>AnnotationNode</code> conforms to annotation meta</li>
- * <li>enhancing an <code>AnnotationNode</code> AST to reflect real annotation meta</li>
- * </ul>
- */
-public class AnnotationVisitor {
-    private final SourceUnit source;
-    private final ErrorCollector errorCollector;
-    private AnnotationNode annotation;
-    private ClassNode reportClass;
-
-    public AnnotationVisitor(SourceUnit source, ErrorCollector errorCollector) {
-        this.source = source;
-        this.errorCollector = errorCollector;
-    }
-
-    public void setReportClass(ClassNode cn) {
-        reportClass = cn;
-    }
-
-    public AnnotationNode visit(AnnotationNode node) {
-        this.annotation = node;
-        this.reportClass = node.getClassNode();
-
-        if (!isValidAnnotationClass(node.getClassNode())) {
-            addError("class " + node.getClassNode().getName() + " is not an annotation");
-            return node;
-        }
-
-        // check if values have been passed for all annotation attributes that don't have defaults
-        if (!checkIfMandatoryAnnotationValuesPassed(node)) {
-            return node;
-        }
-
-        // if enum constants have been used, check if they are all valid
-        if (!checkIfValidEnumConstsAreUsed(node)) {
-            return node;
-        }
-        
-        Map<String, Expression> attributes = node.getMembers();
-        for (Map.Entry<String, Expression> entry : attributes.entrySet()) {
-            String attrName = entry.getKey();
-            ClassNode attrType = getAttributeType(node, attrName);
-            Expression attrExpr = transformInlineConstants(entry.getValue(), attrType);
-            entry.setValue(attrExpr);
-            visitExpression(attrName, attrExpr, attrType);
-        }
-        VMPluginFactory.getPlugin().configureAnnotation(node);
-        return this.annotation;
-    }
-    
-    private boolean checkIfValidEnumConstsAreUsed(AnnotationNode node) {
-        Map<String, Expression> attributes = node.getMembers();
-        for (Map.Entry<String, Expression> entry : attributes.entrySet()) {
-            if (!validateEnumConstant(entry.getValue()))
-                return false;
-        }
-        return true;
-    }
-    
-    private boolean validateEnumConstant(Expression exp) {
-        if (exp instanceof PropertyExpression) {
-            PropertyExpression pe = (PropertyExpression) exp;
-            String name = pe.getPropertyAsString();
-            if (pe.getObjectExpression() instanceof ClassExpression && name != null) {
-                ClassExpression ce = (ClassExpression) pe.getObjectExpression();
-                ClassNode type = ce.getType();
-                if (type.isEnum()) {
-                    boolean ok = false;
-                    try {
-                        FieldNode enumField = type.getDeclaredField(name);
-                        ok = enumField != null && enumField.getType().equals(type);
-                    } catch(Exception ex) {
-                        // ignore
-                    }
-                    if(!ok) {
-                        addError("No enum const " + type.getName() + "." + name, pe);
-                        return false;
-                    }
-                }
-            }
-        }
-        return true;
-    }
-
-    private boolean checkIfMandatoryAnnotationValuesPassed(AnnotationNode node) {
-        boolean ok = true;
-        Map attributes = node.getMembers();
-        ClassNode classNode = node.getClassNode();
-        for (MethodNode mn : classNode.getMethods()) {
-            String methodName = mn.getName();
-            // if the annotation attribute has a default, getCode() returns a ReturnStatement with the default value
-            if (mn.getCode() == null && !attributes.containsKey(methodName)) {
-                addError("No explicit/default value found for annotation attribute '" + methodName + "'", node);
-                ok = false;
-            }
-        }
-        return ok;
-    }
-
-    private ClassNode getAttributeType(AnnotationNode node, String attrName) {
-        ClassNode classNode = node.getClassNode();
-        List methods = classNode.getMethods(attrName);
-        // if size is >1, then the method was overwritten or something, we ignore that
-        // if it is an error, we have to test it at another place. But size==0 is
-        // an error, because it means that no such attribute exists.
-        if (methods.isEmpty()) {
-            addError("'" + attrName + "'is not part of the annotation " + classNode, node);
-            return ClassHelper.OBJECT_TYPE;
-        }
-        MethodNode method = (MethodNode) methods.get(0);
-        return method.getReturnType();
-    }
-
-    private static boolean isValidAnnotationClass(ClassNode node) {
-        return node.implementsInterface(ClassHelper.Annotation_TYPE);
-    }
-
-    protected void visitExpression(String attrName, Expression attrExp, ClassNode attrType) {
-        if (attrType.isArray()) {
-            // check needed as @Test(attr = {"elem"}) passes through the parser
-            if (attrExp instanceof ListExpression) {
-                ListExpression le = (ListExpression) attrExp;
-                visitListExpression(attrName, le, attrType.getComponentType());
-            } else if (attrExp instanceof ClosureExpression) {
-                addError("Annotation list attributes must use Groovy notation [el1, el2]", attrExp);
-            } else {
-                // treat like a singleton list as per Java
-                ListExpression listExp = new ListExpression();
-                listExp.addExpression(attrExp);
-                if (annotation != null) {
-                    annotation.setMember(attrName, listExp);
-                }
-                visitExpression(attrName, listExp, attrType);
-            }
-        } else if (ClassHelper.isPrimitiveType(attrType)) {
-            visitConstantExpression(attrName, getConstantExpression(attrExp, attrType), ClassHelper.getWrapper(attrType));
-        } else if (ClassHelper.STRING_TYPE.equals(attrType)) {
-            visitConstantExpression(attrName, getConstantExpression(attrExp, attrType), ClassHelper.STRING_TYPE);
-        } else if (ClassHelper.CLASS_Type.equals(attrType)) {
-            if (!(attrExp instanceof ClassExpression || attrExp instanceof ClosureExpression)) {
-                addError("Only classes and closures can be used for attribute '" + attrName + "'", attrExp);
-            }
-        } else if (attrType.isDerivedFrom(ClassHelper.Enum_Type)) {
-            if (attrExp instanceof PropertyExpression) {
-                visitEnumExpression(attrName, (PropertyExpression) attrExp, attrType);
-            } else {
-                addError("Expected enum value for attribute " + attrName, attrExp);
-            }
-        } else if (isValidAnnotationClass(attrType)) {
-            if (attrExp instanceof AnnotationConstantExpression) {
-                visitAnnotationExpression(attrName, (AnnotationConstantExpression) attrExp, attrType);
-            } else {
-                addError("Expected annotation of type '" + attrType.getName() + "' for attribute " + attrName, attrExp);
-            }
-        } else {
-            addError("Unexpected type " + attrType.getName(), attrExp);
-        }
-    }
-
-    public void checkReturnType(ClassNode attrType, ASTNode node) {
-        if (attrType.isArray()) {
-            checkReturnType(attrType.getComponentType(), node);
-        } else if (ClassHelper.isPrimitiveType(attrType)) {
-        } else if (ClassHelper.STRING_TYPE.equals(attrType)) {
-        } else if (ClassHelper.CLASS_Type.equals(attrType)) {
-        } else if (attrType.isDerivedFrom(ClassHelper.Enum_Type)) {
-        } else if (isValidAnnotationClass(attrType)) {
-        } else {
-            addError("Unexpected return type " + attrType.getName(), node);
-        }
-    }
-
-    private ConstantExpression getConstantExpression(Expression exp, ClassNode attrType) {
-        Expression result = exp;
-        if (!(result instanceof ConstantExpression)) {
-            result = transformInlineConstants(result, attrType);
-        }
-        if (result instanceof ConstantExpression) {
-            return (ConstantExpression) result;
-        }
-        String base = "Expected '" + exp.getText() + "' to be an inline constant of type " + attrType.getName();
-        if (exp instanceof PropertyExpression) {
-            addError(base + " not a property expression", exp);
-        } else if (exp instanceof VariableExpression && ((VariableExpression)exp).getAccessedVariable() instanceof FieldNode) {
-            addError(base + " not a field expression", exp);
-        } else {
-            addError(base, exp);
-        }
-        return ConstantExpression.EMPTY_EXPRESSION;
-    }
-
-    /**
-     * @param attrName   the name
-     * @param expression the expression
-     * @param attrType   the type
-     */
-    protected void visitAnnotationExpression(String attrName, AnnotationConstantExpression expression, ClassNode attrType) {
-        AnnotationNode annotationNode = (AnnotationNode) expression.getValue();
-        AnnotationVisitor visitor = new AnnotationVisitor(this.source, this.errorCollector);
-        // TODO track Deprecated usage and give a warning?
-        visitor.visit(annotationNode);
-    }
-
-    protected void visitListExpression(String attrName, ListExpression listExpr, ClassNode elementType) {
-        for (Expression expression : listExpr.getExpressions()) {
-            visitExpression(attrName, expression, elementType);
-        }
-    }
-
-    protected void visitConstantExpression(String attrName, ConstantExpression constExpr, ClassNode attrType) {
-        ClassNode constType = constExpr.getType();
-        ClassNode wrapperType = ClassHelper.getWrapper(constType);
-        if (!hasCompatibleType(attrType, wrapperType)) {
-            addError("Attribute '" + attrName + "' should have type '" + attrType.getName()
-                    + "'; but found type '" + constType.getName() + "'", constExpr);
-        }
-    }
-
-    private static boolean hasCompatibleType(ClassNode attrType, ClassNode wrapperType) {
-        return wrapperType.isDerivedFrom(ClassHelper.getWrapper(attrType));
-    }
-
-    protected void visitEnumExpression(String attrName, PropertyExpression propExpr, ClassNode attrType) {
-        if (!propExpr.getObjectExpression().getType().isDerivedFrom(attrType)) {
-            addError("Attribute '" + attrName + "' should have type '" + attrType.getName() + "' (Enum), but found "
-                    + propExpr.getObjectExpression().getType().getName(),
-                    propExpr);
-        }
-    }
-
-    protected void addError(String msg) {
-        addError(msg, this.annotation);
-    }
-
-    protected void addError(String msg, ASTNode expr) {
-        this.errorCollector.addErrorAndContinue(
-                new SyntaxErrorMessage(new SyntaxException(msg + " in @" + this.reportClass.getName() + '\n', expr.getLineNumber(), expr.getColumnNumber(), expr.getLastLineNumber(), expr.getLastColumnNumber()), this.source)
-        );
-    }
-
-    public void checkCircularReference(ClassNode searchClass, ClassNode attrType, Expression startExp) {
-        if (!isValidAnnotationClass(attrType)) return;
-        if (!(startExp instanceof AnnotationConstantExpression)) {
-            addError("Found '" + startExp.getText() + "' when expecting an Annotation Constant", startExp);
-            return;
-        }
-        AnnotationConstantExpression ace = (AnnotationConstantExpression) startExp;
-        AnnotationNode annotationNode = (AnnotationNode) ace.getValue();
-        if (annotationNode.getClassNode().equals(searchClass)) {
-            addError("Circular reference discovered in " + searchClass.getName(), startExp);
-            return;
-        }
-        ClassNode cn = annotationNode.getClassNode();
-        for (MethodNode method : cn.getMethods()) {
-            if (method.getReturnType().equals(searchClass)) {
-                addError("Circular reference discovered in " + cn.getName(), startExp);
-            }
-            ReturnStatement code = (ReturnStatement) method.getCode();
-            if (code == null) continue;
-            checkCircularReference(searchClass, method.getReturnType(), code.getExpression());
-        }
-    }
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.classgen;
+
+import org.codehaus.groovy.ast.ASTNode;
+import org.codehaus.groovy.ast.AnnotationNode;
+import org.codehaus.groovy.ast.ClassHelper;
+import org.codehaus.groovy.ast.ClassNode;
+import org.codehaus.groovy.ast.FieldNode;
+import org.codehaus.groovy.ast.MethodNode;
+import org.codehaus.groovy.ast.expr.AnnotationConstantExpression;
+import org.codehaus.groovy.ast.expr.ClassExpression;
+import org.codehaus.groovy.ast.expr.ClosureExpression;
+import org.codehaus.groovy.ast.expr.ConstantExpression;
+import org.codehaus.groovy.ast.expr.Expression;
+import org.codehaus.groovy.ast.expr.ListExpression;
+import org.codehaus.groovy.ast.expr.PropertyExpression;
+import org.codehaus.groovy.ast.expr.VariableExpression;
+import org.codehaus.groovy.ast.stmt.ReturnStatement;
+import org.codehaus.groovy.control.ErrorCollector;
+import org.codehaus.groovy.control.SourceUnit;
+import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
+import org.codehaus.groovy.syntax.SyntaxException;
+import org.codehaus.groovy.vmplugin.VMPluginFactory;
+
+import java.util.List;
+import java.util.Map;
+
+import static org.apache.groovy.ast.tools.ExpressionUtils.transformInlineConstants;
+
+/**
+ * An Annotation visitor responsible for:
+ * <ul>
+ * <li>reading annotation metadata (@Retention, @Target, attribute types)</li>
+ * <li>verify that an <code>AnnotationNode</code> conforms to annotation meta</li>
+ * <li>enhancing an <code>AnnotationNode</code> AST to reflect real annotation meta</li>
+ * </ul>
+ */
+public class AnnotationVisitor {
+    private final SourceUnit source;
+    private final ErrorCollector errorCollector;
+    private AnnotationNode annotation;
+    private ClassNode reportClass;
+
+    public AnnotationVisitor(SourceUnit source, ErrorCollector errorCollector) {
+        this.source = source;
+        this.errorCollector = errorCollector;
+    }
+
+    public void setReportClass(ClassNode cn) {
+        reportClass = cn;
+    }
+
+    public AnnotationNode visit(AnnotationNode node) {
+        this.annotation = node;
+        this.reportClass = node.getClassNode();
+
+        if (!isValidAnnotationClass(node.getClassNode())) {
+            addError("class " + node.getClassNode().getName() + " is not an annotation");
+            return node;
+        }
+
+        // check if values have been passed for all annotation attributes that don't have defaults
+        if (!checkIfMandatoryAnnotationValuesPassed(node)) {
+            return node;
+        }
+
+        // if enum constants have been used, check if they are all valid
+        if (!checkIfValidEnumConstsAreUsed(node)) {
+            return node;
+        }
+        
+        Map<String, Expression> attributes = node.getMembers();
+        for (Map.Entry<String, Expression> entry : attributes.entrySet()) {
+            String attrName = entry.getKey();
+            ClassNode attrType = getAttributeType(node, attrName);
+            Expression attrExpr = transformInlineConstants(entry.getValue(), attrType);
+            entry.setValue(attrExpr);
+            visitExpression(attrName, attrExpr, attrType);
+        }
+        VMPluginFactory.getPlugin().configureAnnotation(node);
+        return this.annotation;
+    }
+    
+    private boolean checkIfValidEnumConstsAreUsed(AnnotationNode node) {
+        Map<String, Expression> attributes = node.getMembers();
+        for (Map.Entry<String, Expression> entry : attributes.entrySet()) {
+            if (!validateEnumConstant(entry.getValue()))
+                return false;
+        }
+        return true;
+    }
+    
+    private boolean validateEnumConstant(Expression exp) {
+        if (exp instanceof PropertyExpression) {
+            PropertyExpression pe = (PropertyExpression) exp;
+            String name = pe.getPropertyAsString();
+            if (pe.getObjectExpression() instanceof ClassExpression && name != null) {
+                ClassExpression ce = (ClassExpression) pe.getObjectExpression();
+                ClassNode type = ce.getType();
+                if (type.isEnum()) {
+                    boolean ok = false;
+                    try {
+                        FieldNode enumField = type.getDeclaredField(name);
+                        ok = enumField != null && enumField.getType().equals(type);
+                    } catch(Exception ex) {
+                        // ignore
+                    }
+                    if(!ok) {
+                        addError("No enum const " + type.getName() + "." + name, pe);
+                        return false;
+                    }
+                }
+            }
+        }
+        return true;
+    }
+
+    private boolean checkIfMandatoryAnnotationValuesPassed(AnnotationNode node) {
+        boolean ok = true;
+        Map attributes = node.getMembers();
+        ClassNode classNode = node.getClassNode();
+        for (MethodNode mn : classNode.getMethods()) {
+            String methodName = mn.getName();
+            // if the annotation attribute has a default, getCode() returns a ReturnStatement with the default value
+            if (mn.getCode() == null && !attributes.containsKey(methodName)) {
+                addError("No explicit/default value found for annotation attribute '" + methodName + "'", node);
+                ok = false;
+            }
+        }
+        return ok;
+    }
+
+    private ClassNode getAttributeType(AnnotationNode node, String attrName) {
+        ClassNode classNode = node.getClassNode();
+        List methods = classNode.getMethods(attrName);
+        // if size is >1, then the method was overwritten or something, we ignore that
+        // if it is an error, we have to test it at another place. But size==0 is
+        // an error, because it means that no such attribute exists.
+        if (methods.isEmpty()) {
+            addError("'" + attrName + "'is not part of the annotation " + classNode, node);
+            return ClassHelper.OBJECT_TYPE;
+        }
+        MethodNode method = (MethodNode) methods.get(0);
+        return method.getReturnType();
+    }
+
+    private static boolean isValidAnnotationClass(ClassNode node) {
+        return node.implementsInterface(ClassHelper.Annotation_TYPE);
+    }
+
+    protected void visitExpression(String attrName, Expression attrExp, ClassNode attrType) {
+        if (attrType.isArray()) {
+            // check needed as @Test(attr = {"elem"}) passes through the parser
+            if (attrExp instanceof ListExpression) {
+                ListExpression le = (ListExpression) attrExp;
+                visitListExpression(attrName, le, attrType.getComponentType());
+            } else if (attrExp instanceof ClosureExpression) {
+                addError("Annotation list attributes must use Groovy notation [el1, el2]", attrExp);
+            } else {
+                // treat like a singleton list as per Java
+                ListExpression listExp = new ListExpression();
+                listExp.addExpression(attrExp);
+                if (annotation != null) {
+                    annotation.setMember(attrName, listExp);
+                }
+                visitExpression(attrName, listExp, attrType);
+            }
+        } else if (ClassHelper.isPrimitiveType(attrType)) {
+            visitConstantExpression(attrName, getConstantExpression(attrExp, attrType), ClassHelper.getWrapper(attrType));
+        } else if (ClassHelper.STRING_TYPE.equals(attrType)) {
+            visitConstantExpression(attrName, getConstantExpression(attrExp, attrType), ClassHelper.STRING_TYPE);
+        } else if (ClassHelper.CLASS_Type.equals(attrType)) {
+            if (!(attrExp instanceof ClassExpression || attrExp instanceof ClosureExpression)) {
+                addError("Only classes and closures can be used for attribute '" + attrName + "'", attrExp);
+            }
+        } else if (attrType.isDerivedFrom(ClassHelper.Enum_Type)) {
+            if (attrExp instanceof PropertyExpression) {
+                visitEnumExpression(attrName, (PropertyExpression) attrExp, attrType);
+            } else {
+                addError("Expected enum value for attribute " + attrName, attrExp);
+            }
+        } else if (isValidAnnotationClass(attrType)) {
+            if (attrExp instanceof AnnotationConstantExpression) {
+                visitAnnotationExpression(attrName, (AnnotationConstantExpression) attrExp, attrType);
+            } else {
+                addError("Expected annotation of type '" + attrType.getName() + "' for attribute " + attrName, attrExp);
+            }
+        } else {
+            addError("Unexpected type " + attrType.getName(), attrExp);
+        }
+    }
+
+    public void checkReturnType(ClassNode attrType, ASTNode node) {
+        if (attrType.isArray()) {
+            checkReturnType(attrType.getComponentType(), node);
+        } else if (ClassHelper.isPrimitiveType(attrType)) {
+        } else if (ClassHelper.STRING_TYPE.equals(attrType)) {
+        } else if (ClassHelper.CLASS_Type.equals(attrType)) {
+        } else if (attrType.isDerivedFrom(ClassHelper.Enum_Type)) {
+        } else if (isValidAnnotationClass(attrType)) {
+        } else {
+            addError("Unexpected return type " + attrType.getName(), node);
+        }
+    }
+
+    private ConstantExpression getConstantExpression(Expression exp, ClassNode attrType) {
+        Expression result = exp;
+        if (!(result instanceof ConstantExpression)) {
+            result = transformInlineConstants(result, attrType);
+        }
+        if (result instanceof ConstantExpression) {
+            return (ConstantExpression) result;
+        }
+        String base = "Expected '" + exp.getText() + "' to be an inline constant of type " + attrType.getName();
+        if (exp instanceof PropertyExpression) {
+            addError(base + " not a property expression", exp);
+        } else if (exp instanceof VariableExpression && ((VariableExpression)exp).getAccessedVariable() instanceof FieldNode) {
+            addError(base + " not a field expression", exp);
+        } else {
+            addError(base, exp);
+        }
+        return ConstantExpression.EMPTY_EXPRESSION;
+    }
+
+    /**
+     * @param attrName   the name
+     * @param expression the expression
+     * @param attrType   the type
+     */
+    protected void visitAnnotationExpression(String attrName, AnnotationConstantExpression expression, ClassNode attrType) {
+        AnnotationNode annotationNode = (AnnotationNode) expression.getValue();
+        AnnotationVisitor visitor = new AnnotationVisitor(this.source, this.errorCollector);
+        // TODO track Deprecated usage and give a warning?
+        visitor.visit(annotationNode);
+    }
+
+    protected void visitListExpression(String attrName, ListExpression listExpr, ClassNode elementType) {
+        for (Expression expression : listExpr.getExpressions()) {
+            visitExpression(attrName, expression, elementType);
+        }
+    }
+
+    protected void visitConstantExpression(String attrName, ConstantExpression constExpr, ClassNode attrType) {
+        ClassNode constType = constExpr.getType();
+        ClassNode wrapperType = ClassHelper.getWrapper(constType);
+        if (!hasCompatibleType(attrType, wrapperType)) {
+            addError("Attribute '" + attrName + "' should have type '" + attrType.getName()
+                    + "'; but found type '" + constType.getName() + "'", constExpr);
+        }
+    }
+
+    private static boolean hasCompatibleType(ClassNode attrType, ClassNode wrapperType) {
+        return wrapperType.isDerivedFrom(ClassHelper.getWrapper(attrType));
+    }
+
+    protected void visitEnumExpression(String attrName, PropertyExpression propExpr, ClassNode attrType) {
+        if (!propExpr.getObjectExpression().getType().isDerivedFrom(attrType)) {
+            addError("Attribute '" + attrName + "' should have type '" + attrType.getName() + "' (Enum), but found "
+                    + propExpr.getObjectExpression().getType().getName(),
+                    propExpr);
+        }
+    }
+
+    protected void addError(String msg) {
+        addError(msg, this.annotation);
+    }
+
+    protected void addError(String msg, ASTNode expr) {
+        this.errorCollector.addErrorAndContinue(
+                new SyntaxErrorMessage(new SyntaxException(msg + " in @" + this.reportClass.getName() + '\n', expr.getLineNumber(), expr.getColumnNumber(), expr.getLastLineNumber(), expr.getLastColumnNumber()), this.source)
+        );
+    }
+
+    public void checkCircularReference(ClassNode searchClass, ClassNode attrType, Expression startExp) {
+        if (!isValidAnnotationClass(attrType)) return;
+        if (!(startExp instanceof AnnotationConstantExpression)) {
+            addError("Found '" + startExp.getText() + "' when expecting an Annotation Constant", startExp);
+            return;
+        }
+        AnnotationConstantExpression ace = (AnnotationConstantExpression) startExp;
+        AnnotationNode annotationNode = (AnnotationNode) ace.getValue();
+        if (annotationNode.getClassNode().equals(searchClass)) {
+            addError("Circular reference discovered in " + searchClass.getName(), startExp);
+            return;
+        }
+        ClassNode cn = annotationNode.getClassNode();
+        for (MethodNode method : cn.getMethods()) {
+            if (method.getReturnType().equals(searchClass)) {
+                addError("Circular reference discovered in " + cn.getName(), startExp);
+            }
+            ReturnStatement code = (ReturnStatement) method.getCode();
+            if (code == null) continue;
+            checkCircularReference(searchClass, method.getReturnType(), code.getExpression());
+        }
+    }
+
+}
diff --git a/src/main/java/org/codehaus/groovy/classgen/BytecodeSequence.java b/src/main/java/org/codehaus/groovy/classgen/BytecodeSequence.java
index c5a6645..7da3c4d 100644
--- a/src/main/java/org/codehaus/groovy/classgen/BytecodeSequence.java
+++ b/src/main/java/org/codehaus/groovy/classgen/BytecodeSequence.java
@@ -1,81 +1,81 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.classgen;
-
-import org.codehaus.groovy.ast.ASTNode;
-import org.codehaus.groovy.ast.GroovyCodeVisitor;
-import org.codehaus.groovy.ast.stmt.Statement;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * This class represents a sequence of BytecodeInstructions
- * or ASTNodes. The evaluation is depending on the type of 
- * the visitor.
- * 
- * @see BytecodeInstruction
- * @see ASTNode
- */
-
-public class BytecodeSequence extends Statement {
-    private final List<BytecodeInstruction> instructions;
-
-    public BytecodeSequence(List instructions) {
-        this.instructions = instructions;
-    }
-    
-    public BytecodeSequence(BytecodeInstruction instruction) {
-        this.instructions = new ArrayList(1);
-        this.instructions.add(instruction);
-    }
-
-    /**
-     * Delegates to the visit method used for this class.
-     * If the visitor is a ClassGenerator, then 
-     * {@link ClassGenerator#visitBytecodeSequence(BytecodeSequence)}
-     * is called with this instance. If the visitor is no 
-     * ClassGenerator, then this method will call visit on
-     * each ASTNode element sorted by this class. If one
-     * element is a BytecodeInstruction, then it will be skipped
-     * as it is no ASTNode. 
-     * 
-     * @param visitor the visitor
-     * @see ClassGenerator
-     */
-    public void visit(GroovyCodeVisitor visitor) {
-        if (visitor instanceof ClassGenerator) {
-            ClassGenerator gen = (ClassGenerator) visitor;
-            gen.visitBytecodeSequence(this);
-            return;
-        }
-        for (Iterator iterator = instructions.iterator(); iterator.hasNext();) {
-            Object part = (Object) iterator.next();
-            if (part instanceof ASTNode) {
-                ((ASTNode)part).visit(visitor);
-            }
-        }
-    }
-
-    public List getInstructions() {
-        return instructions;
-    }
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.classgen;
+
+import org.codehaus.groovy.ast.ASTNode;
+import org.codehaus.groovy.ast.GroovyCodeVisitor;
+import org.codehaus.groovy.ast.stmt.Statement;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This class represents a sequence of BytecodeInstructions
+ * or ASTNodes. The evaluation is depending on the type of 
+ * the visitor.
+ * 
+ * @see BytecodeInstruction
+ * @see ASTNode
+ */
+
+public class BytecodeSequence extends Statement {
+    private final List<BytecodeInstruction> instructions;
+
+    public BytecodeSequence(List instructions) {
+        this.instructions = instructions;
+    }
+    
+    public BytecodeSequence(BytecodeInstruction instruction) {
+        this.instructions = new ArrayList(1);
+        this.instructions.add(instruction);
+    }
+
+    /**
+     * Delegates to the visit method used for this class.
+     * If the visitor is a ClassGenerator, then 
+     * {@link ClassGenerator#visitBytecodeSequence(BytecodeSequence)}
+     * is called with this instance. If the visitor is no 
+     * ClassGenerator, then this method will call visit on
+     * each ASTNode element sorted by this class. If one
+     * element is a BytecodeInstruction, then it will be skipped
+     * as it is no ASTNode. 
+     * 
+     * @param visitor the visitor
+     * @see ClassGenerator
+     */
+    public void visit(GroovyCodeVisitor visitor) {
+        if (visitor instanceof ClassGenerator) {
+            ClassGenerator gen = (ClassGenerator) visitor;
+            gen.visitBytecodeSequence(this);
+            return;
+        }
+        for (Iterator iterator = instructions.iterator(); iterator.hasNext();) {
+            Object part = (Object) iterator.next();
+            if (part instanceof ASTNode) {
+                ((ASTNode)part).visit(visitor);
+            }
+        }
+    }
+
+    public List getInstructions() {
+        return instructions;
+    }
+
+}
diff --git a/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java b/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
index 8b7ed89..96849ac 100644
--- a/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
+++ b/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
@@ -1,341 +1,341 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.classgen;
-
-import org.codehaus.groovy.ast.ASTNode;
-import org.codehaus.groovy.ast.AnnotatedNode;
-import org.codehaus.groovy.ast.AnnotationNode;
-import org.codehaus.groovy.ast.ClassCodeVisitorSupport;
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.ConstructorNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.GenericsType;
-import org.codehaus.groovy.ast.MethodNode;
-import org.codehaus.groovy.ast.PackageNode;
-import org.codehaus.groovy.ast.Parameter;
-import org.codehaus.groovy.ast.PropertyNode;
-import org.codehaus.groovy.ast.expr.AnnotationConstantExpression;
-import org.codehaus.groovy.ast.expr.ClassExpression;
-import org.codehaus.groovy.ast.expr.DeclarationExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.ListExpression;
-import org.codehaus.groovy.ast.stmt.ReturnStatement;
-import org.codehaus.groovy.ast.stmt.Statement;
-import org.codehaus.groovy.ast.tools.ParameterUtils;
-import org.codehaus.groovy.control.AnnotationConstantsVisitor;
-import org.codehaus.groovy.control.CompilerConfiguration;
-import org.codehaus.groovy.control.ErrorCollector;
-import org.codehaus.groovy.control.SourceUnit;
-import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
-import org.codehaus.groovy.syntax.SyntaxException;
-import org.objectweb.asm.Opcodes;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpec;
-import static org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse;
-import static org.codehaus.groovy.ast.tools.GenericsUtils.createGenericsSpec;
-
-/**
- * A specialized Groovy AST visitor meant to perform additional verifications upon the
- * current AST. Currently it does checks on annotated nodes and annotations itself.
- * <p>
- * Current limitations:
- * - annotations on local variables are not supported
- */
-public class ExtendedVerifier extends ClassCodeVisitorSupport {
-    public static final String JVM_ERROR_MESSAGE = "Please make sure you are running on a JVM >= 1.5";
-
-    private final SourceUnit source;
-    private ClassNode currentClass;
-
-    public ExtendedVerifier(SourceUnit sourceUnit) {
-        this.source = sourceUnit;
-    }
-
-    public void visitClass(ClassNode node) {
-        AnnotationConstantsVisitor acv = new AnnotationConstantsVisitor();
-        acv.visitClass(node, this.source);
-        this.currentClass = node;
-        if (node.isAnnotationDefinition()) {
-            visitAnnotations(node, AnnotationNode.ANNOTATION_TARGET);
-        } else {
-            visitAnnotations(node, AnnotationNode.TYPE_TARGET);
-        }
-        PackageNode packageNode = node.getPackage();
-        if (packageNode != null) {
-            visitAnnotations(packageNode, AnnotationNode.PACKAGE_TARGET);
-        }
-        node.visitContents(this);
-    }
-
-    public void visitField(FieldNode node) {
-        visitAnnotations(node, AnnotationNode.FIELD_TARGET);
-    }
-
-    @Override
-    public void visitDeclarationExpression(DeclarationExpression expression) {
-        visitAnnotations(expression, AnnotationNode.LOCAL_VARIABLE_TARGET);
-    }
-
-    public void visitConstructor(ConstructorNode node) {
-        visitConstructorOrMethod(node, AnnotationNode.CONSTRUCTOR_TARGET);
-    }
-
-    public void visitMethod(MethodNode node) {
-        visitConstructorOrMethod(node, AnnotationNode.METHOD_TARGET);
-    }
-
-    private void visitConstructorOrMethod(MethodNode node, int methodTarget) {
-        visitAnnotations(node, methodTarget);
-        for (int i = 0; i < node.getParameters().length; i++) {
-            Parameter parameter = node.getParameters()[i];
-            visitAnnotations(parameter, AnnotationNode.PARAMETER_TARGET);
-        }
-
-        if (this.currentClass.isAnnotationDefinition() && !node.isStaticConstructor()) {
-            ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration());
-            AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector);
-            visitor.setReportClass(currentClass);
-            visitor.checkReturnType(node.getReturnType(), node);
-            if (node.getParameters().length > 0) {
-                addError("Annotation members may not have parameters.", node.getParameters()[0]);
-            }
-            if (node.getExceptions().length > 0) {
-                addError("Annotation members may not have a throws clause.", node.getExceptions()[0]);
-            }
-            ReturnStatement code = (ReturnStatement) node.getCode();
-            if (code != null) {
-                visitor.visitExpression(node.getName(), code.getExpression(), node.getReturnType());
-                visitor.checkCircularReference(currentClass, node.getReturnType(), code.getExpression());
-            }
-            this.source.getErrorCollector().addCollectorContents(errorCollector);
-        }
-        Statement code = node.getCode();
-        if (code != null) {
-            code.visit(this);
-        }
-
-    }
-
-    public void visitProperty(PropertyNode node) {
-    }
-
-    protected void visitAnnotations(AnnotatedNode node, int target) {
-        if (node.getAnnotations().isEmpty()) {
-            return;
-        }
-        this.currentClass.setAnnotated(true);
-        if (!isAnnotationCompatible()) {
-            addError("Annotations are not supported in the current runtime. " + JVM_ERROR_MESSAGE, node);
-            return;
-        }
-        Map<String, List<AnnotationNode>> runtimeAnnotations = new LinkedHashMap<String, List<AnnotationNode>>();
-        for (AnnotationNode unvisited : node.getAnnotations()) {
-            AnnotationNode visited = visitAnnotation(unvisited);
-            String name = visited.getClassNode().getName();
-            if (visited.hasRuntimeRetention()) {
-                List<AnnotationNode> seen = runtimeAnnotations.get(name);
-                if (seen == null) {
-                    seen = new ArrayList<AnnotationNode>();
-                }
-                seen.add(visited);
-                runtimeAnnotations.put(name, seen);
-            }
-            boolean isTargetAnnotation = name.equals("java.lang.annotation.Target");
-
-            // Check if the annotation target is correct, unless it's the target annotating an annotation definition
-            // defining on which target elements the annotation applies
-            if (!isTargetAnnotation && !visited.isTargetAllowed(target)) {
-                addError("Annotation @" + name + " is not allowed on element "
-                        + AnnotationNode.targetToName(target), visited);
-            }
-            visitDeprecation(node, visited);
-            visitOverride(node, visited);
-        }
-        checkForDuplicateAnnotations(node, runtimeAnnotations);
-    }
-
-    private void checkForDuplicateAnnotations(AnnotatedNode node, Map<String, List<AnnotationNode>> runtimeAnnotations) {
-        for (Map.Entry<String, List<AnnotationNode>> next : runtimeAnnotations.entrySet()) {
-            if (next.getValue().size() > 1) {
-                ClassNode repeatable = null;
-                AnnotationNode repeatee = next.getValue().get(0);
-                List<AnnotationNode> repeateeAnnotations = repeatee.getClassNode().getAnnotations();
-                for (AnnotationNode anno : repeateeAnnotations) {
-                    ClassNode annoClassNode = anno.getClassNode();
-                    if (annoClassNode.getName().equals("java.lang.annotation.Repeatable")) {
-                        Expression value = anno.getMember("value");
-                        if (value instanceof ClassExpression) {
-                            ClassExpression ce = (ClassExpression) value;
-                            if (ce.getType() != null && ce.getType().isAnnotationDefinition()) {
-                                repeatable = ce.getType();
-                                break;
-                            }
-                        }
-                    }
-                }
-                if (repeatable != null) {
-                    AnnotationNode collector = new AnnotationNode(repeatable);
-                    collector.setRuntimeRetention(true); // checked earlier
-                    List<Expression> annos = new ArrayList<Expression>();
-                    for (AnnotationNode an : next.getValue()) {
-                        annos.add(new AnnotationConstantExpression(an));
-                    }
-                    collector.addMember("value", new ListExpression(annos));
-                    node.addAnnotation(collector);
-                    node.getAnnotations().removeAll(next.getValue());
-                }
-            }
-        }
-    }
-
-    private static void visitDeprecation(AnnotatedNode node, AnnotationNode visited) {
-        if (visited.getClassNode().isResolved() && visited.getClassNode().getName().equals("java.lang.Deprecated")) {
-            if (node instanceof MethodNode) {
-                MethodNode mn = (MethodNode) node;
-                mn.setModifiers(mn.getModifiers() | Opcodes.ACC_DEPRECATED);
-            } else if (node instanceof FieldNode) {
-                FieldNode fn = (FieldNode) node;
-                fn.setModifiers(fn.getModifiers() | Opcodes.ACC_DEPRECATED);
-            } else if (node instanceof ClassNode) {
-                ClassNode cn = (ClassNode) node;
-                cn.setModifiers(cn.getModifiers() | Opcodes.ACC_DEPRECATED);
-            }
-        }
-    }
-
-    // TODO GROOVY-5011 handle case of @Override on a property
-    private void visitOverride(AnnotatedNode node, AnnotationNode visited) {
-        ClassNode annotationClassNode = visited.getClassNode();
-        if (annotationClassNode.isResolved() && annotationClassNode.getName().equals("java.lang.Override")) {
-            if (node instanceof MethodNode && !Boolean.TRUE.equals(node.getNodeMetaData(Verifier.DEFAULT_PARAMETER_GENERATED))) {
-                boolean override = false;
-                MethodNode origMethod = (MethodNode) node;
-                ClassNode cNode = origMethod.getDeclaringClass();
-                if (origMethod.hasDefaultValue()) {
-                    List<MethodNode> variants = cNode.getDeclaredMethods(origMethod.getName());
-                    for (MethodNode m : variants) {
-                        if (m.getAnnotations().contains(visited) && isOverrideMethod(m)) {
-                            override = true;
-                            break;
-                        }
-                    }
-                } else {
-                    override = isOverrideMethod(origMethod);
-                }
-
-                if (!override) {
-                    addError("Method '" + origMethod.getName() + "' from class '" + cNode.getName() + "' does not override " +
-                            "method from its superclass or interfaces but is annotated with @Override.", visited);
-                }
-            }
-        }
-    }
-
-    private static boolean isOverrideMethod(MethodNode method) {
-        ClassNode cNode = method.getDeclaringClass();
-        ClassNode next = cNode;
-        outer:
-        while (next != null) {
-            Map genericsSpec = createGenericsSpec(next);
-            MethodNode mn = correctToGenericsSpec(genericsSpec, method);
-            if (next != cNode) {
-                ClassNode correctedNext = correctToGenericsSpecRecurse(genericsSpec, next);
-                MethodNode found = getDeclaredMethodCorrected(genericsSpec, mn, correctedNext);
-                if (found != null) break;
-            }
-            List<ClassNode> ifaces = new ArrayList<ClassNode>(Arrays.asList(next.getInterfaces()));
-            Map updatedGenericsSpec = new HashMap(genericsSpec);
-            while (!ifaces.isEmpty()) {
-                ClassNode origInterface = ifaces.remove(0);
-                if (!origInterface.equals(ClassHelper.OBJECT_TYPE)) {
-                    updatedGenericsSpec = createGenericsSpec(origInterface, updatedGenericsSpec);
-                    ClassNode iNode = correctToGenericsSpecRecurse(updatedGenericsSpec, origInterface);
-                    MethodNode found2 = getDeclaredMethodCorrected(updatedGenericsSpec, mn, iNode);
-                    if (found2 != null) break outer;
-                    ifaces.addAll(Arrays.asList(iNode.getInterfaces()));
-                }
-            }
-            ClassNode superClass = next.getUnresolvedSuperClass();
-            if (superClass != null) {
-                next =  correctToGenericsSpecRecurse(updatedGenericsSpec, superClass);
-            } else {
-                next = null;
-            }
-        }
-        return next != null;
-    }
-
-    private static MethodNode getDeclaredMethodCorrected(Map genericsSpec, MethodNode mn, ClassNode correctedNext) {
-        for (MethodNode orig :  correctedNext.getDeclaredMethods(mn.getName())) {
-            MethodNode method = correctToGenericsSpec(genericsSpec, orig);
-            if (ParameterUtils.parametersEqual(method.getParameters(), mn.getParameters())) {
-                return method;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Resolve metadata and details of the annotation.
-     *
-     * @param unvisited the node to visit
-     * @return the visited node
-     */
-    private AnnotationNode visitAnnotation(AnnotationNode unvisited) {
-        ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration());
-        AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector);
-        AnnotationNode visited = visitor.visit(unvisited);
-        this.source.getErrorCollector().addCollectorContents(errorCollector);
-        return visited;
-    }
-
-    /**
-     * Check if the current runtime allows Annotation usage.
-     *
-     * @return true if running on a 1.5+ runtime
-     */
-    protected boolean isAnnotationCompatible() {
-        return CompilerConfiguration.isPostJDK5(this.source.getConfiguration().getTargetBytecode());
-    }
-
-    public void addError(String msg, ASTNode expr) {
-        this.source.getErrorCollector().addErrorAndContinue(
-                new SyntaxErrorMessage(
-                        new SyntaxException(msg + '\n', expr.getLineNumber(), expr.getColumnNumber(), expr.getLastLineNumber(), expr.getLastColumnNumber()), this.source)
-        );
-    }
-
-    @Override
-    protected SourceUnit getSourceUnit() {
-        return source;
-    }
-
-    // TODO use it or lose it
-    public void visitGenericType(GenericsType genericsType) {
-
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.classgen;
+
+import org.codehaus.groovy.ast.ASTNode;
+import org.codehaus.groovy.ast.AnnotatedNode;
+import org.codehaus.groovy.ast.AnnotationNode;
+import org.codehaus.groovy.ast.ClassCodeVisitorSupport;
+import org.codehaus.groovy.ast.ClassHelper;
+import org.codehaus.groovy.ast.ClassNode;
+import org.codehaus.groovy.ast.ConstructorNode;
+import org.codehaus.groovy.ast.FieldNode;
+import org.codehaus.groovy.ast.GenericsType;
+import org.codehaus.groovy.ast.MethodNode;
+import org.codehaus.groovy.ast.PackageNode;
+import org.codehaus.groovy.ast.Parameter;
+import org.codehaus.groovy.ast.PropertyNode;
+import org.codehaus.groovy.ast.expr.AnnotationConstantExpression;
+import org.codehaus.groovy.ast.expr.ClassExpression;
+import org.codehaus.groovy.ast.expr.DeclarationExpression;
+import org.codehaus.groovy.ast.expr.Expression;
+import org.codehaus.groovy.ast.expr.ListExpression;
+import org.codehaus.groovy.ast.stmt.ReturnStatement;
+import org.codehaus.groovy.ast.stmt.Statement;
+import org.codehaus.groovy.ast.tools.ParameterUtils;
+import org.codehaus.groovy.control.AnnotationConstantsVisitor;
+import org.codehaus.groovy.control.CompilerConfiguration;
+import org.codehaus.groovy.control.ErrorCollector;
+import org.codehaus.groovy.control.SourceUnit;
+import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
+import org.codehaus.groovy.syntax.SyntaxException;
+import org.objectweb.asm.Opcodes;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpec;
+import static org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse;
+import static org.codehaus.groovy.ast.tools.GenericsUtils.createGenericsSpec;
+
+/**
+ * A specialized Groovy AST visitor meant to perform additional verifications upon the
+ * current AST. Currently it does checks on annotated nodes and annotations itself.
+ * <p>
+ * Current limitations:
+ * - annotations on local variables are not supported
+ */
+public class ExtendedVerifier extends ClassCodeVisitorSupport {
+    public static final String JVM_ERROR_MESSAGE = "Please make sure you are running on a JVM >= 1.5";
+
+    private final SourceUnit source;
+    private ClassNode currentClass;
+
+    public ExtendedVerifier(SourceUnit sourceUnit) {
+        this.source = sourceUnit;
+    }
+
+    public void visitClass(ClassNode node) {
+        AnnotationConstantsVisitor acv = new AnnotationConstantsVisitor();
+        acv.visitClass(node, this.source);
+        this.currentClass = node;
+        if (node.isAnnotationDefinition()) {
+            visitAnnotations(node, AnnotationNode.ANNOTATION_TARGET);
+        } else {
+            visitAnnotations(node, AnnotationNode.TYPE_TARGET);
+        }
+        PackageNode packageNode = node.getPackage();
+        if (packageNode != null) {
+            visitAnnotations(packageNode, AnnotationNode.PACKAGE_TARGET);
+        }
+        node.visitContents(this);
+    }
+
+    public void visitField(FieldNode node) {
+        visitAnnotations(node, AnnotationNode.FIELD_TARGET);
+    }
+
+    @Override
+    public void visitDeclarationExpression(DeclarationExpression expression) {
+        visitAnnotations(expression, AnnotationNode.LOCAL_VARIABLE_TARGET);
+    }
+
+    public void visitConstructor(ConstructorNode node) {
+        visitConstructorOrMethod(node, AnnotationNode.CONSTRUCTOR_TARGET);
+    }
+
+    public void visitMethod(MethodNode node) {
+        visitConstructorOrMethod(node, AnnotationNode.METHOD_TARGET);
+    }
+
+    private void visitConstructorOrMethod(MethodNode node, int methodTarget) {
+        visitAnnotations(node, methodTarget);
+        for (int i = 0; i < node.getParameters().length; i++) {
+            Parameter parameter = node.getParameters()[i];
+            visitAnnotations(parameter, AnnotationNode.PARAMETER_TARGET);
+        }
+
+        if (this.currentClass.isAnnotationDefinition() && !node.isStaticConstructor()) {
+            ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration());
+            AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector);
+            visitor.setReportClass(currentClass);
+            visitor.checkReturnType(node.getReturnType(), node);
+            if (node.getParameters().length > 0) {
+                addError("Annotation members may not have parameters.", node.getParameters()[0]);
+            }
+            if (node.getExceptions().length > 0) {
+                addError("Annotation members may not have a throws clause.", node.getExceptions()[0]);
+            }
+            ReturnStatement code = (ReturnStatement) node.getCode();
+            if (code != null) {
+                visitor.visitExpression(node.getName(), code.getExpression(), node.getReturnType());
+                visitor.checkCircularReference(currentClass, node.getReturnType(), code.getExpression());
+            }
+            this.source.getErrorCollector().addCollectorContents(errorCollector);
+        }
+        Statement code = node.getCode();
+        if (code != null) {
+            code.visit(this);
+        }
+
+    }
+
+    public void visitProperty(PropertyNode node) {
+    }
+
+    protected void visitAnnotations(AnnotatedNode node, int target) {
+        if (node.getAnnotations().isEmpty()) {
+            return;
+        }
+        this.currentClass.setAnnotated(true);
+        if (!isAnnotationCompatible()) {
+            addError("Annotations are not supported in the current runtime. " + JVM_ERROR_MESSAGE, node);
+            return;
+        }
+        Map<String, List<AnnotationNode>> runtimeAnnotations = new LinkedHashMap<String, List<AnnotationNode>>();
+        for (AnnotationNode unvisited : node.getAnnotations()) {
+            AnnotationNode visited = visitAnnotation(unvisited);
+            String name = visited.getClassNode().getName();
+            if (visited.hasRuntimeRetention()) {
+                List<AnnotationNode> seen = runtimeAnnotations.get(name);
+                if (seen == null) {
+                    seen = new ArrayList<AnnotationNode>();
+                }
+                seen.add(visited);
+                runtimeAnnotations.put(name, seen);
+            }
+            boolean isTargetAnnotation = name.equals("java.lang.annotation.Target");
+
+            // Check if the annotation target is correct, unless it's the target annotating an annotation definition
+            // defining on which target elements the annotation applies
+            if (!isTargetAnnotation && !visited.isTargetAllowed(target)) {
+                addError("Annotation @" + name + " is not allowed on element "
+                        + AnnotationNode.targetToName(target), visited);
+            }
+            visitDeprecation(node, visited);
+            visitOverride(node, visited);
+        }
+        checkForDuplicateAnnotations(node, runtimeAnnotations);
+    }
+
+    private void checkForDuplicateAnnotations(AnnotatedNode node, Map<String, List<AnnotationNode>> runtimeAnnotations) {
+        for (Map.Entry<String, List<AnnotationNode>> next : runtimeAnnotations.entrySet()) {
+            if (next.getValue().size() > 1) {
+                ClassNode repeatable = null;
+                AnnotationNode repeatee = next.getValue().get(0);
+                List<AnnotationNode> repeateeAnnotations = repeatee.getClassNode().getAnnotations();
+                for (AnnotationNode anno : repeateeAnnotations) {
+                    ClassNode annoClassNode = anno.getClassNode();
+                    if (annoClassNode.getName().equals("java.lang.annotation.Repeatable")) {
+                        Expression value = anno.getMember("value");
+                        if (value instanceof ClassExpression) {
+                            ClassExpression ce = (ClassExpression) value;
+                            if (ce.getType() != null && ce.getType().isAnnotationDefinition()) {
+                                repeatable = ce.getType();
+                                break;
+                            }
+                        }
+                    }
+                }
+                if (repeatable != null) {
+                    AnnotationNode collector = new AnnotationNode(repeatable);
+                    collector.setRuntimeRetention(true); // checked earlier
+                    List<Expression> annos = new ArrayList<Expression>();
+                    for (AnnotationNode an : next.getValue()) {
+                        annos.add(new AnnotationConstantExpression(an));
+                    }
+                    collector.addMember("value", new ListExpression(annos));
+                    node.addAnnotation(collector);
+                    node.getAnnotations().removeAll(next.getValue());
+                }
+            }
+        }
+    }
+
+    private static void visitDeprecation(AnnotatedNode node, AnnotationNode visited) {
+        if (visited.getClassNode().isResolved() && visited.getClassNode().getName().equals("java.lang.Deprecated")) {
+            if (node instanceof MethodNode) {
+                MethodNode mn = (MethodNode) node;
+                mn.setModifiers(mn.getModifiers() | Opcodes.ACC_DEPRECATED);
+            } else if (node instanceof FieldNode) {
+                FieldNode fn = (FieldNode) node;
+                fn.setModifiers(fn.getModifiers() | Opcodes.ACC_DEPRECATED);
+            } else if (node instanceof ClassNode) {
+                ClassNode cn = (ClassNode) node;
+                cn.setModifiers(cn.getModifiers() | Opcodes.ACC_DEPRECATED);
+            }
+        }
+    }
+
+    // TODO GROOVY-5011 handle case of @Override on a property
+    private void visitOverride(AnnotatedNode node, AnnotationNode visited) {
+        ClassNode annotationClassNode = visited.getClassNode();
+        if (annotationClassNode.isResolved() && annotationClassNode.getName().equals("java.lang.Override")) {
+            if (node instanceof MethodNode && !Boolean.TRUE.equals(node.getNodeMetaData(Verifier.DEFAULT_PARAMETER_GENERATED))) {
+                boolean override = false;
+                MethodNode origMethod = (MethodNode) node;
+                ClassNode cNode = origMethod.getDeclaringClass();
+                if (origMethod.hasDefaultValue()) {
+                    List<MethodNode> variants = cNode.getDeclaredMethods(origMethod.getName());
+                    for (MethodNode m : variants) {
+                        if (m.getAnnotations().contains(visited) && isOverrideMethod(m)) {
+                            override = true;
+                            break;
+                        }
+                    }
+                } else {
+                    override = isOverrideMethod(origMethod);
+                }
+
+                if (!override) {
+                    addError("Method '" + origMethod.getName() + "' from class '" + cNode.getName() + "' does not override " +
+                            "method from its superclass or interfaces but is annotated with @Override.", visited);
+                }
+            }
+        }
+    }
+
+    private static boolean isOverrideMethod(MethodNode method) {
+        ClassNode cNode = method.getDeclaringClass();
+        ClassNode next = cNode;
+        outer:
+        while (next != null) {
+            Map genericsSpec = createGenericsSpec(next);
+            MethodNode mn = correctToGenericsSpec(genericsSpec, method);
+            if (next != cNode) {
+                ClassNode correctedNext = correctToGenericsSpecRecurse(genericsSpec, next);
+                MethodNode found = getDeclaredMethodCorrected(genericsSpec, mn, correctedNext);
+                if (found != null) break;
+            }
+            List<ClassNode> ifaces = new ArrayList<ClassNode>(Arrays.asList(next.getInterfaces()));
+            Map updatedGenericsSpec = new HashMap(genericsSpec);
+            while (!ifaces.isEmpty()) {
+                ClassNode origInterface = ifaces.remove(0);
+                if (!origInterface.equals(ClassHelper.OBJECT_TYPE)) {
+                    updatedGenericsSpec = createGenericsSpec(origInterface, updatedGenericsSpec);
+                    ClassNode iNode = correctToGenericsSpecRecurse(updatedGenericsSpec, origInterface);
+                    MethodNode found2 = getDeclaredMethodCorrected(updatedGenericsSpec, mn, iNode);
+                    if (found2 != null) break outer;
+                    ifaces.addAll(Arrays.asList(iNode.getInterfaces()));
+                }
+            }
+            ClassNode superClass = next.getUnresolvedSuperClass();
+            if (superClass != null) {
+                next =  correctToGenericsSpecRecurse(updatedGenericsSpec, superClass);
+            } else {
+                next = null;
+            }
+        }
+        return next != null;
+    }
+
+    private static MethodNode getDeclaredMethodCorrected(Map genericsSpec, MethodNode mn, ClassNode correctedNext) {
+        for (MethodNode orig :  correctedNext.getDeclaredMethods(mn.getName())) {
+            MethodNode method = correctToGenericsSpec(genericsSpec, orig);
+            if (ParameterUtils.parametersEqual(method.getParameters(), mn.getParameters())) {
+                return method;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Resolve metadata and details of the annotation.
+     *
+     * @param unvisited the node to visit
+     * @return the visited node
+     */
+    private AnnotationNode visitAnnotation(AnnotationNode unvisited) {
+        ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration());
+        AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector);
+        AnnotationNode visited = visitor.visit(unvisited);
+        this.source.getErrorCollector().addCollectorContents(errorCollector);
+        return visited;
+    }
+
+    /**
+     * Check if the current runtime allows Annotation usage.
+     *
+     * @return true if running on a 1.5+ runtime
+     */
+    protected boolean isAnnotationCompatible() {
+        return CompilerConfiguration.isPostJDK5(this.source.getConfiguration().getTargetBytecode());
+    }
+
+    public void addError(String msg, ASTNode expr) {
+        this.source.getErrorCollector().addErrorAndContinue(
+                new SyntaxErrorMessage(
+                        new SyntaxException(msg + '\n', expr.getLineNumber(), expr.getColumnNumber(), expr.getLastLineNumber(), expr.getLastColumnNumber()), this.source)
+        );
+    }
+
+    @Override
+    protected SourceUnit getSourceUnit() {
+        return source;
+    }
+
+    // TODO use it or lose it
+    public void visitGenericType(GenericsType genericsType) {
+
+    }
+}
diff --git a/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitorHelper.java b/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitorHelper.java
index 0971146..9452768 100644
--- a/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitorHelper.java
+++ b/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitorHelper.java
@@ -1,143 +1,143 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.classgen;
-
-import org.codehaus.groovy.ast.ClassCodeVisitorSupport;
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.InnerClassNode;
-import org.codehaus.groovy.ast.Parameter;
-import org.codehaus.groovy.ast.VariableScope;
-import org.codehaus.groovy.ast.expr.ArgumentListExpression;
-import org.codehaus.groovy.ast.expr.BinaryExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.FieldExpression;
-import org.codehaus.groovy.ast.expr.GStringExpression;
-import org.codehaus.groovy.ast.expr.MethodCallExpression;
-import org.codehaus.groovy.ast.expr.PropertyExpression;
-import org.codehaus.groovy.ast.expr.SpreadExpression;
-import org.codehaus.groovy.ast.expr.VariableExpression;
-import org.codehaus.groovy.ast.stmt.BlockStatement;
-import org.codehaus.groovy.ast.stmt.ExpressionStatement;
-import org.codehaus.groovy.ast.stmt.ReturnStatement;
-import org.codehaus.groovy.syntax.Token;
-import org.codehaus.groovy.syntax.Types;
-import org.objectweb.asm.Opcodes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public abstract class InnerClassVisitorHelper extends ClassCodeVisitorSupport {
-    protected static void setPropertyGetterDispatcher(BlockStatement block, Expression thiz, Parameter[] parameters) {
-        List<ConstantExpression> gStringStrings = new ArrayList<ConstantExpression>();
-        gStringStrings.add(new ConstantExpression(""));
-        gStringStrings.add(new ConstantExpression(""));
-        List<Expression> gStringValues = new ArrayList<Expression>();
-        gStringValues.add(new VariableExpression(parameters[0]));
-        block.addStatement(
-                new ReturnStatement(
-                        new PropertyExpression(
-                                thiz,
-                                new GStringExpression("$name", gStringStrings, gStringValues)
-                        )
-                )
-        );
-    }
-
-    protected static void setPropertySetterDispatcher(BlockStatement block, Expression thiz, Parameter[] parameters) {
-        List<ConstantExpression> gStringStrings = new ArrayList<ConstantExpression>();
-        gStringStrings.add(new ConstantExpression(""));
-        gStringStrings.add(new ConstantExpression(""));
-        List<Expression> gStringValues = new ArrayList<Expression>();
-        gStringValues.add(new VariableExpression(parameters[0]));
-        block.addStatement(
-                new ExpressionStatement(
-                        new BinaryExpression(
-                                new PropertyExpression(
-                                        thiz,
-                                        new GStringExpression("$name", gStringStrings, gStringValues)
-                                ),
-                                Token.newSymbol(Types.ASSIGN, -1, -1),
-                                new VariableExpression(parameters[1])
-                        )
-                )
-        );
-    }
-
-    protected static void setMethodDispatcherCode(BlockStatement block, Expression thiz, Parameter[] parameters) {
-        List<ConstantExpression> gStringStrings = new ArrayList<ConstantExpression>();
-        gStringStrings.add(new ConstantExpression(""));
-        gStringStrings.add(new ConstantExpression(""));
-        List<Expression> gStringValues = new ArrayList<Expression>();
-        gStringValues.add(new VariableExpression(parameters[0]));
-        block.addStatement(
-                new ReturnStatement(
-                        new MethodCallExpression(
-                                thiz,
-                                new GStringExpression("$name", gStringStrings, gStringValues),
-                                new ArgumentListExpression(
-                                        new SpreadExpression(new VariableExpression(parameters[1]))
-                                )
-                        )
-                )
-        );
-    }
-
-    protected static boolean isStatic(InnerClassNode node) {
-        VariableScope scope = node.getVariableScope();
-        if (scope != null) return scope.getParent().isInStaticContext();
-        return (node.getModifiers() & Opcodes.ACC_STATIC) != 0;
-    }
-
-    protected static ClassNode getClassNode(ClassNode node, boolean isStatic) {
-        if (isStatic) node = ClassHelper.CLASS_Type;
-        return node;
-    }
-
-    protected static int getObjectDistance(ClassNode node) {
-        int count = 0;
-        while (node != null && node != ClassHelper.OBJECT_TYPE) {
-            count++;
-            node = node.getSuperClass();
-        }
-        return count;
-    }
-
-    protected static void addFieldInit(Parameter p, FieldNode fn, BlockStatement block) {
-        VariableExpression ve = new VariableExpression(p);
-        FieldExpression fe = new FieldExpression(fn);
-        block.addStatement(new ExpressionStatement(
-                new BinaryExpression(fe, Token.newSymbol(Types.ASSIGN, -1, -1), ve)
-        ));
-    }
-
-    protected static boolean shouldHandleImplicitThisForInnerClass(ClassNode cn) {
-        if (cn.isEnum() || cn.isInterface()) return false;
-        if ((cn.getModifiers() & Opcodes.ACC_STATIC) != 0) return false;
-
-        if (!(cn instanceof InnerClassNode)) return false;
-        InnerClassNode innerClass = (InnerClassNode) cn;
-        // scope != null means aic, we don't handle that here
-        if (innerClass.getVariableScope() != null) return false;
-        // static inner classes don't need this$0
-        return (innerClass.getModifiers() & Opcodes.ACC_STATIC) == 0;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.classgen;
+
+import org.codehaus.groovy.ast.ClassCodeVisitorSupport;
+import org.codehaus.groovy.ast.ClassHelper;
+import org.codehaus.groovy.ast.ClassNode;
+import org.codehaus.groovy.ast.FieldNode;
+import org.codehaus.groovy.ast.InnerClassNode;
+import org.codehaus.groovy.ast.Parameter;
+import org.codehaus.groovy.ast.VariableScope;
+import org.codehaus.groovy.ast.expr.ArgumentListExpression;
+import org.codehaus.groovy.ast.expr.BinaryExpression;
+import org.codehaus.groovy.ast.expr.ConstantExpression;
+import org.codehaus.groovy.ast.expr.Expression;
+import org.codehaus.groovy.ast.expr.FieldExpression;
+import org.codehaus.groovy.ast.expr.GStringExpression;
+import org.codehaus.groovy.ast.expr.MethodCallExpression;
+import org.codehaus.groovy.ast.expr.PropertyExpression;
+import org.codehaus.groovy.ast.expr.SpreadExpression;
+import org.codehaus.groovy.ast.expr.VariableExpression;
+import org.codehaus.groovy.ast.stmt.BlockStatement;
+import org.codehaus.groovy.ast.stmt.ExpressionStatement;
+import org.codehaus.groovy.ast.stmt.ReturnStatement;
+import org.codehaus.groovy.syntax.Token;
+import org.codehaus.groovy.syntax.Types;
+import org.objectweb.asm.Opcodes;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public abstract class InnerClassVisitorHelper extends ClassCodeVisitorSupport {
+    protected static void setPropertyGetterDispatcher(BlockStatement block, Expression thiz, Parameter[] parameters) {
+        List<ConstantExpression> gStringStrings = new ArrayList<ConstantExpression>();
+        gStringStrings.add(new ConstantExpression(""));
+        gStringStrings.add(new ConstantExpression(""));
+        List<Expression> gStringValues = new ArrayList<Expression>();
+        gStringValues.add(new VariableExpression(parameters[0]));
+        block.addStatement(
+                new ReturnStatement(
+                        new PropertyExpression(
+                                thiz,
+                                new GStringExpression("$name", gStringStrings, gStringValues)
+                        )
+                )
+        );
+    }
+
+    protected static void setPropertySetterDispatcher(BlockStatement block, Expression thiz, Parameter[] parameters) {
+        List<ConstantExpression> gStringStrings = new ArrayList<ConstantExpression>();
+        gStringStrings.add(new ConstantExpression(""));
+        gStringStrings.add(new ConstantExpression(""));
+        List<Expression> gStringValues = new ArrayList<Expression>();
+        gStringValues.add(new VariableExpression(parameters[0]));
+        block.addStatement(
+                new ExpressionStatement(
+                        new BinaryExpression(
+                                new PropertyExpression(
+                                        thiz,
+                                        new GStringExpression("$name", gStringStrings, gStringValues)
+                                ),
+                                Token.newSymbol(Types.ASSIGN, -1, -1),
+                                new VariableExpression(parameters[1])
+                        )
+                )
+        );
+    }
+
+    protected static void setMethodDispatcherCode(BlockStatement block, Expression thiz, Parameter[] parameters) {
+        List<ConstantExpression> gStringStrings = new ArrayList<ConstantExpression>();
+        gStringStrings.add(new ConstantExpression(""));
+        gStringStrings.add(new ConstantExpression(""));
+        List<Expression> gStringValues = new ArrayList<Expression>();
+        gStringValues.add(new VariableExpression(parameters[0]));
+        block.addStatement(
+                new ReturnStatement(
+                        new MethodCallExpression(
+                                thiz,
+                                new GStringExpression("$name", gStringStrings, gStringValues),
+                                new ArgumentListExpression(
+                                        new SpreadExpression(new VariableExpression(parameters[1]))
+                                )
+                        )
+                )
+        );
+    }
+
+    protected static boolean isStatic(InnerClassNode node) {
+        VariableScope scope = node.getVariableScope();
+        if (scope != null) return scope.getParent().isInStaticContext();
+        return (node.getModifiers() & Opcodes.ACC_STATIC) != 0;
+    }
+
+    protected static ClassNode getClassNode(ClassNode node, boolean isStatic) {
+        if (isStatic) node = ClassHelper.CLASS_Type;
+        return node;
+    }
+
+    protected static int getObjectDistance(ClassNode node) {
+        int count = 0;
+        while (node != null && node != ClassHelper.OBJECT_TYPE) {
+            count++;
+            node = node.getSuperClass();
+        }
+        return count;
+    }
+
+    protected static void addFieldInit(Parameter p, FieldNode fn, BlockStatement block) {
+        VariableExpression ve = new VariableExpression(p);
+        FieldExpression fe = new FieldExpression(fn);
+        block.addStatement(new ExpressionStatement(
+                new BinaryExpression(fe, Token.newSymbol(Types.ASSIGN, -1, -1), ve)
+        ));
+    }
+
+    protected static boolean shouldHandleImplicitThisForInnerClass(ClassNode cn) {
+        if (cn.isEnum() || cn.isInterface()) return false;
+        if ((cn.getModifiers() & Opcodes.ACC_STATIC) != 0) return false;
+
+        if (!(cn instanceof InnerClassNode)) return false;
+        InnerClassNode innerClass = (InnerClassNode) cn;
+        // scope != null means aic, we don't handle that here
+        if (innerClass.getVariableScope() != null) return false;
+        // static inner classes don't need this$0
+        return (innerClass.getModifiers() & Opcodes.ACC_STATIC) == 0;
+    }
+}
diff --git a/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java b/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java
index 0ca38f5..09d788a 100644
--- a/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java
+++ b/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java
@@ -1,66 +1,66 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.control;
-
-import groovy.lang.GroovyRuntimeException;
-import org.codehaus.groovy.util.URLStreams;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- * Looks for source file extensions in META-INF/services/org.codehaus.groovy.source.Extensions
- */
-public class SourceExtensionHandler {
-
-    public static Set<String> getRegisteredExtensions(ClassLoader loader) {
-        Set<String> extensions = new LinkedHashSet<String>();
-        extensions.add("groovy");
-        try {
-            Enumeration<URL> globalServices = loader.getResources("META-INF/groovy/org.codehaus.groovy.source.Extensions");
-            if (!globalServices.hasMoreElements()) {
-                globalServices = loader.getResources("META-INF/services/org.codehaus.groovy.source.Extensions");
-            }
-            while (globalServices.hasMoreElements()) {
-                URL service = globalServices.nextElement();
-                try (BufferedReader svcIn = new BufferedReader(new InputStreamReader(URLStreams.openUncachedStream(service)))) {
-                    String extension = svcIn.readLine();
-                    while (extension != null) {
-                        extension = extension.trim();
-                        if (!extension.startsWith("#") && extension.length() > 0) {
-                            extensions.add(extension);
-                        }
-                        extension = svcIn.readLine();
-                    }
-                } catch (IOException ex) {
-                    throw new GroovyRuntimeException("IO Exception attempting to load registered source extension " +
-                            service.toExternalForm() + ". Exception: " + ex.toString());
-                }
-            }
-        } catch (IOException ex) {
-            throw new GroovyRuntimeException("IO Exception getting registered source extensions. Exception: " + ex.toString());
-        }
-        return extensions;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.control;
+
+import groovy.lang.GroovyRuntimeException;
+import org.codehaus.groovy.util.URLStreams;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+/**
+ * Looks for source file extensions in META-INF/services/org.codehaus.groovy.source.Extensions
+ */
+public class SourceExtensionHandler {
+
+    public static Set<String> getRegisteredExtensions(ClassLoader loader) {
+        Set<String> extensions = new LinkedHashSet<String>();
+        extensions.add("groovy");
+        try {
+            Enumeration<URL> globalServices = loader.getResources("META-INF/groovy/org.codehaus.groovy.source.Extensions");
+            if (!globalServices.hasMoreElements()) {
+                globalServices = loader.getResources("META-INF/services/org.codehaus.groovy.source.Extensions");
+            }
+            while (globalServices.hasMoreElements()) {
+                URL service = globalServices.nextElement();
+                try (BufferedReader svcIn = new BufferedReader(new InputStreamReader(URLStreams.openUncachedStream(service)))) {
+                    String extension = svcIn.readLine();
+                    while (extension != null) {
+                        extension = extension.trim();
+                        if (!extension.startsWith("#") && extension.length() > 0) {
+                            extensions.add(extension);
+                        }
+                        extension = svcIn.readLine();
+                    }
+                } catch (IOException ex) {
+                    throw new GroovyRuntimeException("IO Exception attempting to load registered source extension " +
+                            service.toExternalForm() + ". Exception: " + ex.toString());
+                }
+            }
+        } catch (IOException ex) {
+            throw new GroovyRuntimeException("IO Exception getting registered source extensions. Exception: " + ex.toString());
+        }
+        return extensions;
+    }
+}
diff --git a/src/main/java/org/codehaus/groovy/reflection/ParameterTypes.java b/src/main/java/org/codehaus/groovy/reflection/ParameterTypes.java
index ebeb771..6069036 100644
--- a/src/main/java/org/codehaus/groovy/reflection/ParameterTypes.java
+++ b/src/main/java/org/codehaus/groovy/reflection/ParameterTypes.java
@@ -1,385 +1,385 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.reflection;
-
-import org.codehaus.groovy.GroovyBugError;
-import org.codehaus.groovy.runtime.MetaClassHelper;
-import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;
-import org.codehaus.groovy.runtime.wrappers.Wrapper;
-
-import java.lang.reflect.Array;
-
-public class ParameterTypes {
-    private static final Class[] NO_PARAMETERS = new Class[0];
-
-    protected volatile Class[] nativeParamTypes;
-    protected volatile CachedClass[] parameterTypes;
-
-    protected boolean isVargsMethod;
-
-    public ParameterTypes() {
-    }
-
-    public ParameterTypes(Class pt[]) {
-        nativeParamTypes = pt;
-    }
-
-    public ParameterTypes(String pt[]) {
-        nativeParamTypes = new Class[pt.length];
-        for (int i = 0; i != pt.length; ++i) {
-            try {
-                nativeParamTypes[i] = Class.forName(pt[i]);
-            } catch (ClassNotFoundException e) {
-                NoClassDefFoundError err = new NoClassDefFoundError();
-                err.initCause(e);
-                throw err;
-            }
-        }
-    }
-
-    public ParameterTypes(CachedClass[] parameterTypes) {
-        setParametersTypes(parameterTypes);
-    }
-
-    protected final void setParametersTypes(CachedClass[] pt) {
-        this.parameterTypes = pt;
-        isVargsMethod = pt.length > 0 && pt[pt.length - 1].isArray;
-    }
-
-    public CachedClass[] getParameterTypes() {
-        if (parameterTypes == null) {
-            getParametersTypes0();
-        }
-
-        return parameterTypes;
-    }
-
-    private synchronized void getParametersTypes0() {
-        if (parameterTypes != null)
-            return;
-
-        Class[] npt = nativeParamTypes == null ? getPT() : nativeParamTypes;
-        if (npt.length == 0) {
-            nativeParamTypes = NO_PARAMETERS;
-            setParametersTypes(CachedClass.EMPTY_ARRAY);
-        } else {
-
-            CachedClass[] pt = new CachedClass[npt.length];
-            for (int i = 0; i != npt.length; ++i)
-                pt[i] = ReflectionCache.getCachedClass(npt[i]);
-
-            nativeParamTypes = npt;
-            setParametersTypes(pt);
-        }
-    }
-
-    public Class[] getNativeParameterTypes() {
-        if (nativeParamTypes == null) {
-            getNativeParameterTypes0();
-        }
-        return nativeParamTypes;
-    }
-
-    private synchronized void getNativeParameterTypes0() {
-        if (nativeParamTypes != null)
-            return;
-
-        Class[] npt;
-        if (parameterTypes != null) {
-            npt = new Class[parameterTypes.length];
-            for (int i = 0; i != parameterTypes.length; ++i) {
-                npt[i] = parameterTypes[i].getTheClass();
-            }
-        } else
-            npt = getPT();
-        nativeParamTypes = npt;
-    }
-
-    protected Class[] getPT() {
-        throw new UnsupportedOperationException(getClass().getName());
-    }
-
-    public boolean isVargsMethod() {
-        return isVargsMethod;
-    }
-
-    public boolean isVargsMethod(Object[] arguments) {
-        // Uncomment if at some point this method can be called before parameterTypes initialized
-        // getParameterTypes();
-        if (!isVargsMethod)
-            return false;
-
-        final int lenMinus1 = parameterTypes.length - 1;
-        // -1 because the varg part is optional
-        if (lenMinus1 == arguments.length) return true;
-        if (lenMinus1 > arguments.length) return false;
-        if (arguments.length > parameterTypes.length) return true;
-
-        // only case left is arguments.length == parameterTypes.length
-        Object last = arguments[arguments.length - 1];
-        if (last == null) return true;
-        Class clazz = last.getClass();
-        return !clazz.equals(parameterTypes[lenMinus1].getTheClass());
-
-    }
-
-    public final Object[] coerceArgumentsToClasses(Object[] argumentArray) {
-        // Uncomment if at some point this method can be called before parameterTypes initialized
-        // getParameterTypes();
-        argumentArray = correctArguments(argumentArray);
-
-        final CachedClass[] pt = parameterTypes;
-        final int len = argumentArray.length;
-        for (int i = 0; i < len; i++) {
-            final Object argument = argumentArray[i];
-            if (argument != null) {
-                argumentArray[i] = pt[i].coerceArgument(argument);
-            }
-        }
-        return argumentArray;
-    }
-
-    public Object[] correctArguments(Object[] argumentArray) {
-        // correct argumentArray's length
-        if (argumentArray == null) {
-            return MetaClassHelper.EMPTY_ARRAY;
-        }
-
-        final CachedClass[] pt = getParameterTypes();
-        if (pt.length == 1 && argumentArray.length == 0) {
-            if (isVargsMethod)
-                return new Object[]{Array.newInstance(pt[0].getTheClass().getComponentType(), 0)};
-            else
-                return MetaClassHelper.ARRAY_WITH_NULL;
-        }
-
-        if (isVargsMethod && isVargsMethod(argumentArray)) {
-            return fitToVargs(argumentArray, pt);
-        }
-
-        return argumentArray;
-    }
-
-    /**
-     * this method is called when the number of arguments to a method is greater than 1
-     * and if the method is a vargs method. This method will then transform the given
-     * arguments to make the method callable
-     *
-     * @param argumentArrayOrig the arguments used to call the method
-     * @param paramTypes        the types of the parameters the method takes
-     */
-    private static Object[] fitToVargs(Object[] argumentArrayOrig, CachedClass[] paramTypes) {
-        Class vargsClassOrig = paramTypes[paramTypes.length - 1].getTheClass().getComponentType();
-        Class vargsClass = ReflectionCache.autoboxType(vargsClassOrig);
-        Object[] argumentArray = argumentArrayOrig.clone();
-        MetaClassHelper.unwrap(argumentArray);
-
-        if (argumentArray.length == paramTypes.length - 1) {
-            // the vargs argument is missing, so fill it with an empty array
-            Object[] newArgs = new Object[paramTypes.length];
-            System.arraycopy(argumentArray, 0, newArgs, 0, argumentArray.length);
-            Object vargs = Array.newInstance(vargsClass, 0);
-            newArgs[newArgs.length - 1] = vargs;
-            return newArgs;
-        } else if (argumentArray.length == paramTypes.length) {
-            // the number of arguments is correct, but if the last argument
-            // is no array we have to wrap it in a array. If the last argument
-            // is null, then we don't have to do anything
-            Object lastArgument = argumentArray[argumentArray.length - 1];
-            if (lastArgument != null && !lastArgument.getClass().isArray()) {
-                // no array so wrap it
-                Object wrapped = makeCommonArray(argumentArray, paramTypes.length - 1, vargsClass);
-                Object[] newArgs = new Object[paramTypes.length];
-                System.arraycopy(argumentArray, 0, newArgs, 0, paramTypes.length - 1);
-                newArgs[newArgs.length - 1] = wrapped;
-                return newArgs;
-            } else {
-                // we may have to box the argument!
-                return argumentArray;
-            }
-        } else if (argumentArray.length > paramTypes.length) {
-            // the number of arguments is too big, wrap all exceeding elements
-            // in an array, but keep the old elements that are no vargs
-            Object[] newArgs = new Object[paramTypes.length];
-            // copy arguments that are not a varg
-            System.arraycopy(argumentArray, 0, newArgs, 0, paramTypes.length - 1);
-            // create a new array for the vargs and copy them
-            Object vargs = makeCommonArray(argumentArray, paramTypes.length - 1, vargsClass);
-            newArgs[newArgs.length - 1] = vargs;
-            return newArgs;
-        } else {
-            throw new GroovyBugError("trying to call a vargs method without enough arguments");
-        }
-    }
-
-    private static Object makeCommonArray(Object[] arguments, int offset, Class baseClass) {
-        Object[] result = (Object[]) Array.newInstance(baseClass, arguments.length - offset);
-        for (int i = offset; i < arguments.length; i++) {
-            Object v = arguments[i];
-            v = DefaultTypeTransformation.castToType(v, baseClass);
-            result[i - offset] = v;
-        }
-        return result;
-    }
-
-    public boolean isValidMethod(Class[] arguments) {
-        if (arguments == null) return true;
-
-        final int size = arguments.length;
-        CachedClass[] pt = getParameterTypes();
-        final int paramMinus1 = pt.length - 1;
-
-        if (isVargsMethod && size >= paramMinus1)
-            return isValidVarargsMethod(arguments, size, pt, paramMinus1);
-        else if (pt.length == size)
-            return isValidExactMethod(arguments, pt);
-        else if (pt.length == 1 && size == 0 && !pt[0].isPrimitive)
-            return true;
-        return false;
-    }
-
-    private static boolean isValidExactMethod(Class[] arguments, CachedClass[] pt) {
-        // lets check the parameter types match
-        int size = pt.length;
-        for (int i = 0; i < size; i++) {
-            if (!pt[i].isAssignableFrom(arguments[i])) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    public boolean isValidExactMethod(Object[] args) {
-        // lets check the parameter types match
-        getParametersTypes0();
-        int size = args.length;
-        if (size != parameterTypes.length)
-            return false;
-
-        for (int i = 0; i < size; i++) {
-            if (args[i] != null && !parameterTypes[i].isAssignableFrom(args[i].getClass())) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    public boolean isValidExactMethod(Class[] args) {
-        // lets check the parameter types match
-        getParametersTypes0();
-        int size = args.length;
-        if (size != parameterTypes.length)
-            return false;
-
-        for (int i = 0; i < size; i++) {
-            if (args[i] != null && !parameterTypes[i].isAssignableFrom(args[i])) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    private static boolean testComponentAssignable(Class toTestAgainst, Class toTest) {
-        Class component = toTest.getComponentType();
-        if (component == null) return false;
-        return MetaClassHelper.isAssignableFrom(toTestAgainst, component);
-    }
-
-    private static boolean isValidVarargsMethod(Class[] arguments, int size, CachedClass[] pt, int paramMinus1) {
-        // first check normal number of parameters
-        for (int i = 0; i < paramMinus1; i++) {
-            if (pt[i].isAssignableFrom(arguments[i])) continue;
-            return false;
-        }
-
-        // check direct match
-        CachedClass varg = pt[paramMinus1];
-        Class clazz = varg.getTheClass().getComponentType();
-        if (size == pt.length &&
-                (varg.isAssignableFrom(arguments[paramMinus1]) ||
-                        testComponentAssignable(clazz, arguments[paramMinus1]))) {
-            return true;
-        }
-
-        // check varged
-        for (int i = paramMinus1; i < size; i++) {
-            if (MetaClassHelper.isAssignableFrom(clazz, arguments[i])) continue;
-            return false;
-        }
-        return true;
-    }
-
-    public boolean isValidMethod(Object[] arguments) {
-        if (arguments == null) return true;
-
-        final int size = arguments.length;
-        CachedClass[] paramTypes = getParameterTypes();
-        final int paramMinus1 = paramTypes.length - 1;
-
-        if (size >= paramMinus1 && paramTypes.length > 0 &&
-                paramTypes[(paramMinus1)].isArray) {
-            // first check normal number of parameters
-            for (int i = 0; i < paramMinus1; i++) {
-                if (paramTypes[i].isAssignableFrom(getArgClass(arguments[i]))) continue;
-                return false;
-            }
-
-
-            // check direct match
-            CachedClass varg = paramTypes[paramMinus1];
-            Class clazz = varg.getTheClass().getComponentType();
-            if (size == paramTypes.length &&
-                    (varg.isAssignableFrom(getArgClass(arguments[paramMinus1])) ||
-                            testComponentAssignable(clazz, getArgClass(arguments[paramMinus1])))) {
-                return true;
-            }
-
-
-            // check varged
-            for (int i = paramMinus1; i < size; i++) {
-                if (MetaClassHelper.isAssignableFrom(clazz, getArgClass(arguments[i]))) continue;
-                return false;
-            }
-            return true;
-        } else if (paramTypes.length == size) {
-            // lets check the parameter types match
-            for (int i = 0; i < size; i++) {
-                if (paramTypes[i].isAssignableFrom(getArgClass(arguments[i]))) continue;
-                return false;
-            }
-            return true;
-        } else if (paramTypes.length == 1 && size == 0 && !paramTypes[0].isPrimitive) {
-            return true;
-        }
-        return false;
-    }
-
-    private static Class getArgClass(Object arg) {
-        Class cls;
-        if (arg == null) {
-            cls = null;
-        } else {
-            if (arg instanceof Wrapper) {
-                cls = ((Wrapper) arg).getType();
-            } else
-                cls = arg.getClass();
-        }
-        return cls;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.reflection;
+
+import org.codehaus.groovy.GroovyBugError;
+import org.codehaus.groovy.runtime.MetaClassHelper;
+import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;
+import org.codehaus.groovy.runtime.wrappers.Wrapper;
+
+import java.lang.reflect.Array;
+
+public class ParameterTypes {
+    private static final Class[] NO_PARAMETERS = new Class[0];
+
+    protected volatile Class[] nativeParamTypes;
+    protected volatile CachedClass[] parameterTypes;
+
+    protected boolean isVargsMethod;
+
+    public ParameterTypes() {
+    }
+
+    public ParameterTypes(Class pt[]) {
+        nativeParamTypes = pt;
+    }
+
+    public ParameterTypes(String pt[]) {
+        nativeParamTypes = new Class[pt.length];
+        for (int i = 0; i != pt.length; ++i) {
+            try {
+                nativeParamTypes[i] = Class.forName(pt[i]);
+            } catch (ClassNotFoundException e) {
+                NoClassDefFoundError err = new NoClassDefFoundError();
+                err.initCause(e);
+                throw err;
+            }
+        }
+    }
+
+    public ParameterTypes(CachedClass[] parameterTypes) {
+        setParametersTypes(parameterTypes);
+    }
+
+    protected final void setParametersTypes(CachedClass[] pt) {
+        this.parameterTypes = pt;
+        isVargsMethod = pt.length > 0 && pt[pt.length - 1].isArray;
+    }
+
+    public CachedClass[] getParameterTypes() {
+        if (parameterTypes == null) {
+            getParametersTypes0();
+        }
+
+        return parameterTypes;
+    }
+
+    private synchronized void getParametersTypes0() {
+        if (parameterTypes != null)
+            return;
+
+        Class[] npt = nativeParamTypes == null ? getPT() : nativeParamTypes;
+        if (npt.length == 0) {
+            nativeParamTypes = NO_PARAMETERS;
+            setParametersTypes(CachedClass.EMPTY_ARRAY);
+        } else {
+
+            CachedClass[] pt = new CachedClass[npt.length];
+            for (int i = 0; i != npt.length; ++i)
+                pt[i] = ReflectionCache.getCachedClass(npt[i]);
+
+            nativeParamTypes = npt;
+            setParametersTypes(pt);
+        }
+    }
+
+    public Class[] getNativeParameterTypes() {
+        if (nativeParamTypes == null) {
+            getNativeParameterTypes0();
+        }
+        return nativeParamTypes;
+    }
+
+    private synchronized void getNativeParameterTypes0() {
+        if (nativeParamTypes != null)
+            return;
+
+        Class[] npt;
+        if (parameterTypes != null) {
+            npt = new Class[parameterTypes.length];
+            for (int i = 0; i != parameterTypes.length; ++i) {
+                npt[i] = parameterTypes[i].getTheClass();
+            }
+        } else
+            npt = getPT();
+        nativeParamTypes = npt;
+    }
+
+    protected Class[] getPT() {
+        throw new UnsupportedOperationException(getClass().getName());
+    }
+
+    public boolean isVargsMethod() {
+        return isVargsMethod;
+    }
+
+    public boolean isVargsMethod(Object[] arguments) {
+        // Uncomment if at some point this method can be called before parameterTypes initialized
+        // getParameterTypes();
+        if (!isVargsMethod)
+            return false;
+
+        final int lenMinus1 = parameterTypes.length - 1;
+        // -1 because the varg part is optional
+        if (lenMinus1 == arguments.length) return true;
+        if (lenMinus1 > arguments.length) return false;
+        if (arguments.length > parameterTypes.length) return true;
+
+        // only case left is arguments.length == parameterTypes.length
+        Object last = arguments[arguments.length - 1];
+        if (last == null) return true;
+        Class clazz = last.getClass();
+        return !clazz.equals(parameterTypes[lenMinus1].getTheClass());
+
+    }
+
+    public final Object[] coerceArgumentsToClasses(Object[] argumentArray) {
+        // Uncomment if at some point this method can be called before parameterTypes initialized
+        // getParameterTypes();
+        argumentArray = correctArguments(argumentArray);
+
+        final CachedClass[] pt = parameterTypes;
+        final int len = argumentArray.length;
+        for (int i = 0; i < len; i++) {
+            final Object argument = argumentArray[i];
+            if (argument != null) {
+                argumentArray[i] = pt[i].coerceArgument(argument);
+            }
+        }
+        return argumentArray;
+    }
+
+    public Object[] correctArguments(Object[] argumentArray) {
+        // correct argumentArray's length
+        if (argumentArray == null) {
+            return MetaClassHelper.EMPTY_ARRAY;
+        }
+
+        final CachedClass[] pt = getParameterTypes();
+        if (pt.length == 1 && argumentArray.length == 0) {
+            if (isVargsMethod)
+                return new Object[]{Array.newInstance(pt[0].getTheClass().getComponentType(), 0)};
+            else
+                return MetaClassHelper.ARRAY_WITH_NULL;
+        }
+
+        if (isVargsMethod && isVargsMethod(argumentArray)) {
+            return fitToVargs(argumentArray, pt);
+        }
+
+        return argumentArray;
+    }
+
+    /**
+     * this method is called when the number of arguments to a method is greater than 1
+     * and if the method is a vargs method. This method will then transform the given
+     * arguments to make the method callable
+     *
+     * @param argumentArrayOrig the arguments used to call the method
+     * @param paramTypes        the types of the parameters the method takes
+     */
+    private static Object[] fitToVargs(Object[] argumentArrayOrig, CachedClass[] paramTypes) {
+        Class vargsClassOrig = paramTypes[paramTypes.length - 1].getTheClass().getComponentType();
+        Class vargsClass = ReflectionCache.autoboxType(vargsClassOrig);
+        Object[] argumentArray = argumentArrayOrig.clone();
+        MetaClassHelper.unwrap(argumentArray);
+
+        if (argumentArray.length == paramTypes.length - 1) {
+            // the vargs argument is missing, so fill it with an empty array
+            Object[] newArgs = new Object[paramTypes.length];
+            System.arraycopy(argumentArray, 0, newArgs, 0, argumentArray.length);
+            Object vargs = Array.newInstance(vargsClass, 0);
+            newArgs[newArgs.length - 1] = vargs;
+            return newArgs;
+        } else if (argumentArray.length == paramTypes.length) {
+            // the number of arguments is correct, but if the last argument
+            // is no array we have to wrap it in a array. If the last argument
+            // is null, then we don't have to do anything
+            Object lastArgument = argumentArray[argumentArray.length - 1];
+            if (lastArgument != null && !lastArgument.getClass().isArray()) {
+                // no array so wrap it
+                Object wrapped = makeCommonArray(argumentArray, paramTypes.length - 1, vargsClass);
+                Object[] newArgs = new Object[paramTypes.length];
+                System.arraycopy(argumentArray, 0, newArgs, 0, paramTypes.length - 1);
+                newArgs[newArgs.length - 1] = wrapped;
+                return newArgs;
+            } else {
+                // we may have to box the argument!
+                return argumentArray;
+            }
+        } else if (argumentArray.length > paramTypes.length) {
+            // the number of arguments is too big, wrap all exceeding elements
+            // in an array, but keep the old elements that are no vargs
+            Object[] newArgs = new Object[paramTypes.length];
+            // copy arguments that are not a varg
+            System.arraycopy(argumentArray, 0, newArgs, 0, paramTypes.length - 1);
+            // create a new array for the vargs and copy them
+            Object vargs = makeCommonArray(argumentArray, paramTypes.length - 1, vargsClass);
+            newArgs[newArgs.length - 1] = vargs;
+            return newArgs;
+        } else {
+            throw new GroovyBugError("trying to call a vargs method without enough arguments");
+        }
+    }
+
+    private static Object makeCommonArray(Object[] arguments, int offset, Class baseClass) {
+        Object[] result = (Object[]) Array.newInstance(baseClass, arguments.length - offset);
+        for (int i = offset; i < arguments.length; i++) {
+            Object v = arguments[i];
+            v = DefaultTypeTransformation.castToType(v, baseClass);
+            result[i - offset] = v;
+        }
+        return result;
+    }
+
+    public boolean isValidMethod(Class[] arguments) {
+        if (arguments == null) return true;
+
+        final int size = arguments.length;
+        CachedClass[] pt = getParameterTypes();
+        final int paramMinus1 = pt.length - 1;
+
+        if (isVargsMethod && size >= paramMinus1)
+            return isValidVarargsMethod(arguments, size, pt, paramMinus1);
+        else if (pt.length == size)
+            return isValidExactMethod(arguments, pt);
+        else if (pt.length == 1 && size == 0 && !pt[0].isPrimitive)
+            return true;
+        return false;
+    }
+
+    private static boolean isValidExactMethod(Class[] arguments, CachedClass[] pt) {
+        // lets check the parameter types match
+        int size = pt.length;
+        for (int i = 0; i < size; i++) {
+            if (!pt[i].isAssignableFrom(arguments[i])) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public boolean isValidExactMethod(Object[] args) {
+        // lets check the parameter types match
+        getParametersTypes0();
+        int size = args.length;
+        if (size != parameterTypes.length)
+            return false;
+
+        for (int i = 0; i < size; i++) {
+            if (args[i] != null && !parameterTypes[i].isAssignableFrom(args[i].getClass())) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public boolean isValidExactMethod(Class[] args) {
+        // lets check the parameter types match
+        getParametersTypes0();
+        int size = args.length;
+        if (size != parameterTypes.length)
+            return false;
+
+        for (int i = 0; i < size; i++) {
+            if (args[i] != null && !parameterTypes[i].isAssignableFrom(args[i])) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private static boolean testComponentAssignable(Class toTestAgainst, Class toTest) {
+        Class component = toTest.getComponentType();
+        if (component == null) return false;
+        return MetaClassHelper.isAssignableFrom(toTestAgainst, component);
+    }
+
+    private static boolean isValidVarargsMethod(Class[] arguments, int size, CachedClass[] pt, int paramMinus1) {
+        // first check normal number of parameters
+        for (int i = 0; i < paramMinus1; i++) {
+            if (pt[i].isAssignableFrom(arguments[i])) continue;
+            return false;
+        }
+
+        // check direct match
+        CachedClass varg = pt[paramMinus1];
+        Class clazz = varg.getTheClass().getComponentType();
+        if (size == pt.length &&
+                (varg.isAssignableFrom(arguments[paramMinus1]) ||
+                        testComponentAssignable(clazz, arguments[paramMinus1]))) {
+            return true;
+        }
+
+        // check varged
+        for (int i = paramMinus1; i < size; i++) {
+            if (MetaClassHelper.isAssignableFrom(clazz, arguments[i])) continue;
+            return false;
+        }
+        return true;
+    }
+
+    public boolean isValidMethod(Object[] arguments) {
+        if (arguments == null) return true;
+
+        final int size = arguments.length;
+        CachedClass[] paramTypes = getParameterTypes();
+        final int paramMinus1 = paramTypes.length - 1;
+
+        if (size >= paramMinus1 && paramTypes.length > 0 &&
+                paramTypes[(paramMinus1)].isArray) {
+            // first check normal number of parameters
+            for (int i = 0; i < paramMinus1; i++) {
+                if (paramTypes[i].isAssignableFrom(getArgClass(arguments[i]))) continue;
+                return false;
+            }
+
+
+            // check direct match
+            CachedClass varg = paramTypes[paramMinus1];
+            Class clazz = varg.getTheClass().getComponentType();
+            if (size == paramTypes.length &&
+                    (varg.isAssignableFrom(getArgClass(arguments[paramMinus1])) ||
+                            testComponentAssignable(clazz, getArgClass(arguments[paramMinus1])))) {
+                return true;
+            }
+
+
+            // check varged
+            for (int i = paramMinus1; i < size; i++) {
+                if (MetaClassHelper.isAssignableFrom(clazz, getArgClass(arguments[i]))) continue;
+                return false;
+            }
+            return true;
+        } else if (paramTypes.length == size) {
+            // lets check the parameter types match
+            for (int i = 0; i < size; i++) {
+                if (paramTypes[i].isAssignableFrom(getArgClass(arguments[i]))) continue;
+                return false;
+            }
+            return true;
+        } else if (paramTypes.length == 1 && size == 0 && !paramTypes[0].isPrimitive) {
+            return true;
+        }
+        return false;
+    }
+
+    private static Class getArgClass(Object arg) {
+        Class cls;
+        if (arg == null) {
+            cls = null;
+        } else {
+            if (arg instanceof Wrapper) {
+                cls = ((Wrapper) arg).getType();
+            } else
+                cls = arg.getClass();
+        }
+        return cls;
+    }
+}
diff --git a/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java b/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java
index bed1a48..59c86d2 100644
--- a/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java
+++ b/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java
@@ -1,226 +1,226 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.runtime;
-
-import groovy.lang.GroovyObject;
-import groovy.lang.GroovyRuntimeException;
-import groovy.lang.GroovySystem;
-import groovy.lang.MetaClass;
-import org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl;
-import org.codehaus.groovy.vmplugin.VMPlugin;
-import org.codehaus.groovy.vmplugin.VMPluginFactory;
-
-import java.io.Serializable;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Proxy;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * This class is a general adapter to map a call to a Java interface
- * to a given delegate.
- */
-public abstract class ConversionHandler implements InvocationHandler, Serializable {
-    private final Object delegate;
-    private static final long serialVersionUID = 1162833717190835227L;
-    private final ConcurrentHashMap<Method, Object> handleCache;
-    {
-        if (VMPluginFactory.getPlugin().getVersion() >= 7) {
-            handleCache = new ConcurrentHashMap<Method, Object>(16, 0.9f, 2);
-        } else {
-            handleCache = null;
-        }
-    }
-
-    private MetaClass metaClass;
-
-    /**
-     * Creates a ConversionHandler with an delegate.
-     *
-     * @param delegate the delegate
-     * @throws IllegalArgumentException if the given delegate is null
-     */
-    public ConversionHandler(Object delegate) {
-        if (delegate == null) {
-            throw new IllegalArgumentException("delegate must not be null");
-        }
-        this.delegate = delegate;
-    }
-
-    /**
-     * Returns the delegate.
-     *
-     * @return the delegate
-     */
-    public Object getDelegate() {
-        return delegate;
-    }
-
-    /**
-     * This method is a default implementation for the invoke method given in
-     * InvocationHandler. Any call to a method with a declaring class that is
-     * not Object, excluding toString() and default methods is redirected to invokeCustom.
-     * <p>
-     * Methods like equals and hashcode are called on the class itself instead
-     * of the delegate because they are considered fundamental methods that should
-     * not be overwritten. The toString() method gets special treatment as it is
-     * deemed to be a method that you might wish to override when called from Groovy.
-     * Interface default methods from Java 8 on the other hand are considered being
-     * default implementations you don't normally want to change. So they are called
-     * directly too
-     * </p><p>
-     * In many scenarios, it is better to overwrite the invokeCustom method where
-     * the core Object related methods are filtered out.
-     *</p>
-     * @param proxy  the proxy
-     * @param method the method
-     * @param args   the arguments
-     * @return the result of the invocation by method or delegate
-     * @throws Throwable if caused by the delegate or the method
-     * @see #invokeCustom(Object, Method, Object[])
-     * @see InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
-     */
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        if (handleCache != null && isDefaultMethod(method) && !defaultOverridden(method)) {
-            VMPlugin plugin = VMPluginFactory.getPlugin();
-            Object handle = handleCache.get(method);
-            if (handle == null) {
-                handle = plugin.getInvokeSpecialHandle(method, proxy);
-                handleCache.put(method, handle);
-            }
-            return plugin.invokeHandle(handle, args);
-        }
-
-        if (!checkMethod(method)) {
-            try {
-                if (method.getDeclaringClass() == GroovyObject.class) {
-                    if ("getMetaClass".equals(method.getName())) {
-                        return getMetaClass(proxy);
-                    } else if ("setMetaClass".equals(method.getName())) {
-                        return setMetaClass((MetaClass) args[0]);
-                    }
-                }
-                return invokeCustom(proxy, method, args);
-            } catch (GroovyRuntimeException gre) {
-                throw ScriptBytecodeAdapter.unwrap(gre);
-            }
-        }
-
-        try {
-            return method.invoke(this, args);
-        } catch (InvocationTargetException ite) {
-            throw ite.getTargetException();
-        }
-    }
-
-    private boolean defaultOverridden(Method method) {
-        return delegate instanceof Map && ((Map) delegate).containsKey(method.getName());
-    }
-
-    protected boolean isDefaultMethod(Method method) {
-        return ((method.getModifiers() & (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) ==
-                Modifier.PUBLIC) && method.getDeclaringClass().isInterface();
-    }
-
-    protected boolean checkMethod(Method method) {
-        return isCoreObjectMethod(method);
-    }
-
-    /**
-     * This method is called for all Methods not defined on Object.
-     * The delegate should be called here.
-     *
-     * @param proxy  the proxy
-     * @param method the method
-     * @param args   the arguments
-     * @return the result of the invocation of the delegate
-     * @throws Throwable any exception causes by the delegate
-     * @see #invoke(Object, Method, Object[])
-     * @see InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
-     */
-    public abstract Object invokeCustom(Object proxy, Method method, Object[] args) throws Throwable;
-
-    /**
-     * Indicates whether some other object is "equal to" this one.
-     * The delegate is used if the class of the parameter and the
-     * current class are equal. In other cases the method will return
-     * false. The exact class is here used, if inheritance is needed,
-     * this method must be overwritten.
-     *
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    public boolean equals(Object obj) {
-        if (obj instanceof Proxy) {
-            obj = Proxy.getInvocationHandler(obj);
-        }
-
-        if (obj instanceof ConversionHandler) {
-            return (((ConversionHandler) obj).getDelegate()).equals(delegate);
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * Returns a hash code value for the delegate.
-     *
-     * @see java.lang.Object#hashCode()
-     */
-    public int hashCode() {
-        return delegate.hashCode();
-    }
-
-    /**
-     * Returns a String version of the delegate.
-     *
-     * @see java.lang.Object#toString()
-     */
-    public String toString() {
-        return delegate.toString();
-    }
-
-    /**
-     * Checks whether a method is a core method from java.lang.Object.
-     * Such methods often receive special treatment because they are
-     * deemed fundamental enough to not be tampered with.
-     *
-     * @param method the method to check
-     * @return true if the method is deemed to be a core method
-     */
-    public static boolean isCoreObjectMethod(Method method) {
-        return Object.class.equals(method.getDeclaringClass());
-    }
-
-    private MetaClass setMetaClass(MetaClass mc) {
-        metaClass = mc;
-        return mc;
-    }
-
-    private MetaClass getMetaClass(Object proxy) {
-        MetaClass mc = metaClass;
-        if (mc == null) {
-            mc = ((MetaClassRegistryImpl) GroovySystem.getMetaClassRegistry()).getMetaClass(proxy);
-            metaClass = mc;
-        }
-        return mc;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.runtime;
+
+import groovy.lang.GroovyObject;
+import groovy.lang.GroovyRuntimeException;
+import groovy.lang.GroovySystem;
+import groovy.lang.MetaClass;
+import org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl;
+import org.codehaus.groovy.vmplugin.VMPlugin;
+import org.codehaus.groovy.vmplugin.VMPluginFactory;
+
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Proxy;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * This class is a general adapter to map a call to a Java interface
+ * to a given delegate.
+ */
+public abstract class ConversionHandler implements InvocationHandler, Serializable {
+    private final Object delegate;
+    private static final long serialVersionUID = 1162833717190835227L;
+    private final ConcurrentHashMap<Method, Object> handleCache;
+    {
+        if (VMPluginFactory.getPlugin().getVersion() >= 7) {
+            handleCache = new ConcurrentHashMap<Method, Object>(16, 0.9f, 2);
+        } else {
+            handleCache = null;
+        }
+    }
+
+    private MetaClass metaClass;
+
+    /**
+     * Creates a ConversionHandler with an delegate.
+     *
+     * @param delegate the delegate
+     * @throws IllegalArgumentException if the given delegate is null
+     */
+    public ConversionHandler(Object delegate) {
+        if (delegate == null) {
+            throw new IllegalArgumentException("delegate must not be null");
+        }
+        this.delegate = delegate;
+    }
+
+    /**
+     * Returns the delegate.
+     *
+     * @return the delegate
+     */
+    public Object getDelegate() {
+        return delegate;
+    }
+
+    /**
+     * This method is a default implementation for the invoke method given in
+     * InvocationHandler. Any call to a method with a declaring class that is
+     * not Object, excluding toString() and default methods is redirected to invokeCustom.
+     * <p>
+     * Methods like equals and hashcode are called on the class itself instead
+     * of the delegate because they are considered fundamental methods that should
+     * not be overwritten. The toString() method gets special treatment as it is
+     * deemed to be a method that you might wish to override when called from Groovy.
+     * Interface default methods from Java 8 on the other hand are considered being
+     * default implementations you don't normally want to change. So they are called
+     * directly too
+     * </p><p>
+     * In many scenarios, it is better to overwrite the invokeCustom method where
+     * the core Object related methods are filtered out.
+     *</p>
+     * @param proxy  the proxy
+     * @param method the method
+     * @param args   the arguments
+     * @return the result of the invocation by method or delegate
+     * @throws Throwable if caused by the delegate or the method
+     * @see #invokeCustom(Object, Method, Object[])
+     * @see InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
+     */
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        if (handleCache != null && isDefaultMethod(method) && !defaultOverridden(method)) {
+            VMPlugin plugin = VMPluginFactory.getPlugin();
+            Object handle = handleCache.get(method);
+            if (handle == null) {
+                handle = plugin.getInvokeSpecialHandle(method, proxy);
+                handleCache.put(method, handle);
+            }
+            return plugin.invokeHandle(handle, args);
+        }
+
+        if (!checkMethod(method)) {
+            try {
+                if (method.getDeclaringClass() == GroovyObject.class) {
+                    if ("getMetaClass".equals(method.getName())) {
+                        return getMetaClass(proxy);
+                    } else if ("setMetaClass".equals(method.getName())) {
+                        return setMetaClass((MetaClass) args[0]);
+                    }
+                }
+                return invokeCustom(proxy, method, args);
+            } catch (GroovyRuntimeException gre) {
+                throw ScriptBytecodeAdapter.unwrap(gre);
+            }
+        }
+
+        try {
+            return method.invoke(this, args);
+        } catch (InvocationTargetException ite) {
+            throw ite.getTargetException();
+        }
+    }
+
+    private boolean defaultOverridden(Method method) {
+        return delegate instanceof Map && ((Map) delegate).containsKey(method.getName());
+    }
+
+    protected boolean isDefaultMethod(Method method) {
+        return ((method.getModifiers() & (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) ==
+                Modifier.PUBLIC) && method.getDeclaringClass().isInterface();
+    }
+
+    protected boolean checkMethod(Method method) {
+        return isCoreObjectMethod(method);
+    }
+
+    /**
+     * This method is called for all Methods not defined on Object.
+     * The delegate should be called here.
+     *
+     * @param proxy  the proxy
+     * @param method the method
+     * @param args   the arguments
+     * @return the result of the invocation of the delegate
+     * @throws Throwable any exception causes by the delegate
+     * @see #invoke(Object, Method, Object[])
+     * @see InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
+     */
+    public abstract Object invokeCustom(Object proxy, Method method, Object[] args) throws Throwable;
+
+    /**
+     * Indicates whether some other object is "equal to" this one.
+     * The delegate is used if the class of the parameter and the
+     * current class are equal. In other cases the method will return
+     * false. The exact class is here used, if inheritance is needed,
+     * this method must be overwritten.
+     *
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals(Object obj) {
+        if (obj instanceof Proxy) {
+            obj = Proxy.getInvocationHandler(obj);
+        }
+
+        if (obj instanceof ConversionHandler) {
+            return (((ConversionHandler) obj).getDelegate()).equals(delegate);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Returns a hash code value for the delegate.
+     *
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode() {
+        return delegate.hashCode();
+    }
+
+    /**
+     * Returns a String version of the delegate.
+     *
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        return delegate.toString();
+    }
+
+    /**
+     * Checks whether a method is a core method from java.lang.Object.
+     * Such methods often receive special treatment because they are
+     * deemed fundamental enough to not be tampered with.
+     *
+     * @param method the method to check
+     * @return true if the method is deemed to be a core method
+     */
+    public static boolean isCoreObjectMethod(Method method) {
+        return Object.class.equals(method.getDeclaringClass());
+    }
+
+    private MetaClass setMetaClass(MetaClass mc) {
+        metaClass = mc;
+        return mc;
+    }
+
+    private MetaClass getMetaClass(Object proxy) {
+        MetaClass mc = metaClass;
+        if (mc == null) {
+            mc = ((MetaClassRegistryImpl) GroovySystem.getMetaClassRegistry()).getMetaClass(proxy);
+            metaClass = mc;
+        }
+        return mc;
+    }
+}
diff --git a/src/main/java/org/codehaus/groovy/runtime/ConvertedClosure.java b/src/main/java/org/codehaus/groovy/runtime/ConvertedClosure.java
index 84a627f..f21b143 100644
--- a/src/main/java/org/codehaus/groovy/runtime/ConvertedClosure.java
+++ b/src/main/java/org/codehaus/groovy/runtime/ConvertedClosure.java
@@ -1,54 +1,54 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.runtime;
-
-import groovy.lang.Closure;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-
-/**
- * This class is a general adapter to adapt a closure to any Java interface.
- */
-public class ConvertedClosure extends ConversionHandler implements Serializable {
-    private final String methodName;
-    private static final long serialVersionUID = 1162833713450835227L;
-
-    /**
-     * to create a ConvertedClosure object.
-     * @param closure the closure object.
-     */
-    public ConvertedClosure(Closure closure, String method) {
-        super(closure);
-        this.methodName = method;
-    }
-    
-    public ConvertedClosure(Closure closure) {
-        this(closure,null);
-    }
-
-    @Override
-    public Object invokeCustom(Object proxy, Method method, Object[] args)
-    throws Throwable {
-        if (methodName!=null && !methodName.equals(method.getName())) return null;
-        return ((Closure) getDelegate()).call(args);
-    }
-
-}
-
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.runtime;
+
+import groovy.lang.Closure;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+/**
+ * This class is a general adapter to adapt a closure to any Java interface.
+ */
+public class ConvertedClosure extends ConversionHandler implements Serializable {
+    private final String methodName;
+    private static final long serialVersionUID = 1162833713450835227L;
+
+    /**
+     * to create a ConvertedClosure object.
+     * @param closure the closure object.
+     */
+    public ConvertedClosure(Closure closure, String method) {
+        super(closure);
+        this.methodName = method;
+    }
+    
+    public ConvertedClosure(Closure closure) {
+        this(closure,null);
+    }
+
+    @Override
+    public Object invokeCustom(Object proxy, Method method, Object[] args)
+    throws Throwable {
+        if (methodName!=null && !methodName.equals(method.getName())) return null;
+        return ((Closure) getDelegate()).call(args);
+    }
+
+}
+
diff --git a/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethodsSupport.java b/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethodsSupport.java
index 24929a8..9a97fc3 100644
--- a/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethodsSupport.java
+++ b/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethodsSupport.java
@@ -1,90 +1,90 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.runtime;
-
-/**
- * Keep this constant in a separate file as it is troublesome for Antlr to parse for doc purposes.
- */
-public class EncodingGroovyMethodsSupport {
-    static final byte[] TRANSLATE_TABLE = (
-            "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
-                    //           \t    \n                \r
-                    + "\u0042\u0041\u0041\u0042\u0042\u0041\u0042\u0042"
-                    //
-                    + "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
-                    //
-                    + "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
-                    //     sp     !     "     #     $     %     &     '
-                    + "\u0041\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
-                    //      (     )     *     +     ,     -     .     /
-                    + "\u0042\u0042\u0042\u003E\u0042\u0042\u0042\u003F"
-                    //      0     1     2     3     4     5     6     7
-                    + "\u0034\u0035\u0036\u0037\u0038\u0039\u003A\u003B"
-                    //      8     9     :     ;     <     =     >     ?
-                    + "\u003C\u003D\u0042\u0042\u0042\u0040\u0042\u0042"
-                    //      @     A     B     C     D     E     F     G
-                    + "\u0042\u0000\u0001\u0002\u0003\u0004\u0005\u0006"
-                    //      H     I J K     L     M N     O
-                    + "\u0007\u0008\t\n\u000B\u000C\r\u000E"
-                    //      P     Q     R     S     T     U     V     W
-                    + "\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016"
-                    //      X     Y     Z     [     \     ]     ^     _
-                    + "\u0017\u0018\u0019\u0042\u0042\u0042\u0042\u0042"
-                    //      '     a     b     c     d     e     f     g
-                    + "\u0042\u001A\u001B\u001C\u001D\u001E\u001F\u0020"
-                    //      h i     j     k     l     m     n     o
-                    + "\u0021\"\u0023\u0024\u0025\u0026\u0027\u0028"
-                    //      p     q     r     s     t     u     v     w
-                    + "\u0029\u002A\u002B\u002C\u002D\u002E\u002F\u0030"
-                    //      x     y     z
-                    + "\u0031\u0032\u0033").getBytes();
-
-    static final byte[] TRANSLATE_TABLE_URLSAFE = (
-            "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
-                    //           \t    \n                \r
-                    + "\u0042\u0041\u0041\u0042\u0042\u0041\u0042\u0042"
-                    //
-                    + "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
-                    //
-                    + "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
-                    //     sp     !     "     #     $     %     &     '
-                    + "\u0041\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
-                    //      (     )     *     +     ,     -     .     /
-                    + "\u0042\u0042\u0042\u0042\u0042\u003E\u0042\u0042"
-                    //      0     1     2     3     4     5     6     7
-                    + "\u0034\u0035\u0036\u0037\u0038\u0039\u003A\u003B"
-                    //      8     9     :     ;     <     =     >     ?
-                    + "\u003C\u003D\u0042\u0042\u0042\u0040\u0042\u0042"
-                    //      @     A     B     C     D     E     F     G
-                    + "\u0042\u0000\u0001\u0002\u0003\u0004\u0005\u0006"
-                    //      H     I J K     L     M N     O
-                    + "\u0007\u0008\t\n\u000B\u000C\r\u000E"
-                    //      P     Q     R     S     T     U     V     W
-                    + "\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016"
-                    //      X     Y     Z     [     \     ]     ^     _
-                    + "\u0017\u0018\u0019\u0042\u0042\u0042\u0042\u003F"
-                    //      '     a     b     c     d     e     f     g
-                    + "\u0042\u001A\u001B\u001C\u001D\u001E\u001F\u0020"
-                    //      h i     j     k     l     m     n     o
-                    + "\u0021\"\u0023\u0024\u0025\u0026\u0027\u0028"
-                    //      p     q     r     s     t     u     v     w
-                    + "\u0029\u002A\u002B\u002C\u002D\u002E\u002F\u0030"
-                    //      x     y     z
-                    + "\u0031\u0032\u0033").getBytes();
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.runtime;
+
+/**
+ * Keep this constant in a separate file as it is troublesome for Antlr to parse for doc purposes.
+ */
+public class EncodingGroovyMethodsSupport {
+    static final byte[] TRANSLATE_TABLE = (
+            "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
+                    //           \t    \n                \r
+                    + "\u0042\u0041\u0041\u0042\u0042\u0041\u0042\u0042"
+                    //
+                    + "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
+                    //
+                    + "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
+                    //     sp     !     "     #     $     %     &     '
+                    + "\u0041\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
+                    //      (     )     *     +     ,     -     .     /
+                    + "\u0042\u0042\u0042\u003E\u0042\u0042\u0042\u003F"
+                    //      0     1     2     3     4     5     6     7
+                    + "\u0034\u0035\u0036\u0037\u0038\u0039\u003A\u003B"
+                    //      8     9     :     ;     <     =     >     ?
+                    + "\u003C\u003D\u0042\u0042\u0042\u0040\u0042\u0042"
+                    //      @     A     B     C     D     E     F     G
+                    + "\u0042\u0000\u0001\u0002\u0003\u0004\u0005\u0006"
+                    //      H     I J K     L     M N     O
+                    + "\u0007\u0008\t\n\u000B\u000C\r\u000E"
+                    //      P     Q     R     S     T     U     V     W
+                    + "\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016"
+                    //      X     Y     Z     [     \     ]     ^     _
+                    + "\u0017\u0018\u0019\u0042\u0042\u0042\u0042\u0042"
+                    //      '     a     b     c     d     e     f     g
+                    + "\u0042\u001A\u001B\u001C\u001D\u001E\u001F\u0020"
+                    //      h i     j     k     l     m     n     o
+                    + "\u0021\"\u0023\u0024\u0025\u0026\u0027\u0028"
+                    //      p     q     r     s     t     u     v     w
+                    + "\u0029\u002A\u002B\u002C\u002D\u002E\u002F\u0030"
+                    //      x     y     z
+                    + "\u0031\u0032\u0033").getBytes();
+
+    static final byte[] TRANSLATE_TABLE_URLSAFE = (
+            "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
+                    //           \t    \n                \r
+                    + "\u0042\u0041\u0041\u0042\u0042\u0041\u0042\u0042"
+                    //
+                    + "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
+                    //
+                    + "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
+                    //     sp     !     "     #     $     %     &     '
+                    + "\u0041\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
+                    //      (     )     *     +     ,     -     .     /
+                    + "\u0042\u0042\u0042\u0042\u0042\u003E\u0042\u0042"
+                    //      0     1     2     3     4     5     6     7
+                    + "\u0034\u0035\u0036\u0037\u0038\u0039\u003A\u003B"
+                    //      8     9     :     ;     <     =     >     ?
+                    + "\u003C\u003D\u0042\u0042\u0042\u0040\u0042\u0042"
+                    //      @     A     B     C     D     E     F     G
+                    + "\u0042\u0000\u0001\u0002\u0003\u0004\u0005\u0006"
+                    //      H     I J K     L     M N     O
+                    + "\u0007\u0008\t\n\u000B\u000C\r\u000E"
+                    //      P     Q     R     S     T     U     V     W
+                    + "\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016"
+                    //      X     Y     Z     [     \     ]     ^     _
+                    + "\u0017\u0018\u0019\u0042\u0042\u0042\u0042\u003F"
+                    //      '     a     b     c     d     e     f     g
+                    + "\u0042\u001A\u001B\u001C\u001D\u001E\u001F\u0020"
+                    //      h i     j     k     l     m     n     o
+                    + "\u0021\"\u0023\u0024\u0025\u0026\u0027\u0028"
+                    //      p     q     r     s     t     u     v     w
+                    + "\u0029\u002A\u002B\u002C\u002D\u002E\u002F\u0030"
+                    //      x     y     z
+                    + "\u0031\u0032\u0033").getBytes();
+}
diff --git a/src/main/java/org/codehaus/groovy/runtime/GStringImpl.java b/src/main/java/org/codehaus/groovy/runtime/GStringImpl.java
index 7e5beec..b1c66fe 100644
--- a/src/main/java/org/codehaus/groovy/runtime/GStringImpl.java
+++ b/src/main/java/org/codehaus/groovy/runtime/GStringImpl.java
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.codehaus.groovy.runtime;
-
-import groovy.lang.GString;
-
-/**
- * Default implementation of a GString used by the compiler. A GString
- * consist of a list of values and strings which can be combined to
- * create a new String.
- *
- * @see groovy.lang.GString
- */
-public class GStringImpl extends GString {
-    private static final long serialVersionUID = 3581289038662723858L;
-    private String[] strings;
-
-    /**
-     * Create a new GString with values and strings.
-     * <p>
-     * Each value is prefixed by a string, after the last value
-     * an additional String might be used. This means
-     * <code>strings.length == values.length  ||  strings.length == values.length + 1</code>.
-     * <p>
-     * <b>NOTE:</b> The lengths are <b>not</b> checked. Using different lengths might result
-     * in unpredictable behaviour.
-     *
-     * @param values  the value parts
-     * @param strings the string parts
-     */
-    public GStringImpl(Object[] values, String[] strings) {
-        super(values);
-        this.strings = strings;
-    }
-
-    /**
-     * Get the strings of this GString.
-     * <p>
-     * This methods returns the same array as used in the constructor. Changing
-     * the values will result in changes of the GString. It is not recommended
-     * to do so.
-     */
-    public String[] getStrings() {
-        return strings;
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.codehaus.groovy.runtime;
+
+import groovy.lang.GString;
+
+/**
+ * Default implementation of a GString used by the compiler. A GString
+ * consist of a list of values and strings which can be combined to
+ * create a new String.
+ *
+ * @see groovy.lang.GString
+ */
+public class GStringImpl extends GString {
+    private static final long serialVersionUID = 3581289038662723858L;
+    private String[] strings;
+
+    /**
+     * Create a new GString with values and strings.
+     * <p>
+     * Each value is prefixed by a string, after the last value
+     * an additional String might be used. This means
+     * <code>strings.length == values.length  ||  strings.length == values.length + 1</code>.
+     * <p>
+     * <b>NOTE:</b> The lengths are <b>not</b> checked. Using different lengths might result
+     * in unpredictable behaviour.
+     *
+     * @param values  the value parts
+     * @param strings the string parts
+     */
+    public GStringImpl(Object[] values, String[] strings) {
+        super(values);
+        this.strings = strings;
+    }
+
+    /**
+     * Get the strings of this GString.
+     * <p>
+     * This methods returns the same array as used in the constructor. Changing
+     * the values will result in changes of the GString. It is not recommended
+     * to do so.
+     */
+    public String[] getStrings() {
+        return strings;
+    }
+
+}
diff --git a/src/main/java/org/codehaus/groovy/runtime/NumberAwareComparator.java b/src/main/java/org/codehaus/groovy/runtime/NumberAwareComparator.java
index c44a48e..6a11b03 100644
--- a/src/main/java/org/codehaus/groovy/runtime/NumberAwareComparator.java
+++ b/src/main/java/org/codehaus/groovy/runtime/NumberAwareComparator.java
@@ -1,56 +1,56 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.runtime;
-
-import groovy.lang.GroovyRuntimeException;
-import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;
-
-import java.io.Serializable;
-import java.util.Comparator;
-
-/**
- * Compares two objects using Groovy's friendly comparison algorithm, i.e.
- * handles nulls gracefully (nul being less than everything else) and
- * performs numeric type coercion if required.
- */
-public class NumberAwareComparator<T> implements Comparator<T>, Serializable {
-    private static final long serialVersionUID = 9017657289076651660L;
-
-    public int compare(T o1, T o2) {
-        try {
-            return DefaultTypeTransformation.compareTo(o1, o2);
-        } catch (ClassCastException | IllegalArgumentException | GroovyRuntimeException cce) {
-            /* ignore */
-        }
-        // since the object does not have a valid compareTo method
-        // we compare using the hashcodes. null cases are handled by
-        // DefaultTypeTransformation.compareTo
-        // This is not exactly a mathematical valid approach, since we compare object
-        // that cannot be compared. To avoid strange side effects we do a pseudo order
-        // using hashcodes, but without equality. Since then an x and y with the same
-        // hashcodes will behave different depending on if we compare x with y or
-        // x with y, the result might be unstable as well. Setting x and y to equal
-        // may mean the removal of x or y in a sorting operation, which we don't want.
-        int x1 = o1.hashCode();
-        int x2 = o2.hashCode();
-        if (x1 == x2 && o1.equals(o2)) return 0;
-        if (x1 > x2) return 1;
-        return -1;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.runtime;
+
+import groovy.lang.GroovyRuntimeException;
+import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;
+
+import java.io.Serializable;
+import java.util.Comparator;
+
+/**
+ * Compares two objects using Groovy's friendly comparison algorithm, i.e.
+ * handles nulls gracefully (nul being less than everything else) and
+ * performs numeric type coercion if required.
+ */
+public class NumberAwareComparator<T> implements Comparator<T>, Serializable {
+    private static final long serialVersionUID = 9017657289076651660L;
+
+    public int compare(T o1, T o2) {
+        try {
+            return DefaultTypeTransformation.compareTo(o1, o2);
+        } catch (ClassCastException | IllegalArgumentException | GroovyRuntimeException cce) {
+            /* ignore */
+        }
+        // since the object does not have a valid compareTo method
+        // we compare using the hashcodes. null cases are handled by
+        // DefaultTypeTransformation.compareTo
+        // This is not exactly a mathematical valid approach, since we compare object
+        // that cannot be compared. To avoid strange side effects we do a pseudo order
+        // using hashcodes, but without equality. Since then an x and y with the same
+        // hashcodes will behave different depending on if we compare x with y or
+        // x with y, the result might be unstable as well. Setting x and y to equal
+        // may mean the removal of x or y in a sorting operation, which we don't want.
+        int x1 = o1.hashCode();
+        int x2 = o2.hashCode();
+        if (x1 == x2 && o1.equals(o2)) return 0;
+        if (x1 > x2) return 1;
+        return -1;
+    }
+}
diff --git a/src/main/java/org/codehaus/groovy/runtime/dgmimpl/arrays/CharacterArrayPutAtMetaMethod.java b/src/main/java/org/codehaus/groovy/runtime/dgmimpl/arrays/CharacterArrayPutAtMetaMethod.java
index 053b7d4..039e21c 100644
--- a/src/main/java/org/codehaus/groovy/runtime/dgmimpl/arrays/CharacterArrayPutAtMetaMethod.java
+++ b/src/main/java/org/codehaus/groovy/runtime/dgmimpl/arrays/CharacterArrayPutAtMetaMethod.java
@@ -1,86 +1,86 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.runtime.dgmimpl.arrays;
-
-import groovy.lang.MetaClassImpl;
-import groovy.lang.MetaMethod;
-import org.codehaus.groovy.reflection.CachedClass;
-import org.codehaus.groovy.reflection.ReflectionCache;
-import org.codehaus.groovy.runtime.callsite.CallSite;
-import org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite;
-import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;
-
-public class CharacterArrayPutAtMetaMethod extends ArrayPutAtMetaMethod {
-    private static final CachedClass OBJECT_CLASS = ReflectionCache.OBJECT_CLASS;
-    private static final CachedClass ARR_CLASS = ReflectionCache.getCachedClass(char[].class);
-    private static final CachedClass[] PARAM_CLASS_ARR = new CachedClass[]{INTEGER_CLASS, OBJECT_CLASS};
-
-    public CharacterArrayPutAtMetaMethod() {
-        parameterTypes = PARAM_CLASS_ARR;
-    }
-
-    public final CachedClass getDeclaringClass() {
-        return ARR_CLASS;
-    }
-
-    public Object invoke(Object object, Object[] args) {
-        final char[] objects = (char[]) object;
-        final int index = normaliseIndex((Integer) args[0], objects.length);
-        objects[index] = DefaultTypeTransformation.getCharFromSizeOneString(args[1]);
-        return null;
-    }
-
-    public CallSite createPojoCallSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params, Object receiver, Object[] args) {
-        if (!(args[0] instanceof Integer) || !(args[1] instanceof Character))
-            return PojoMetaMethodSite.createNonAwareCallSite(site, metaClass, metaMethod, params, args);
-        else
-            return new MyPojoMetaMethodSite(site, metaClass, metaMethod, params);
-    }
-
-    private static class MyPojoMetaMethodSite extends PojoMetaMethodSite {
-        public MyPojoMetaMethodSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params) {
-            super(site, metaClass, metaMethod, params);
-        }
-
-        public Object call(Object receiver, Object[] args) throws Throwable {
-            if ((receiver instanceof char[] && args[0] instanceof Integer && args[1] instanceof Character)
-                    && checkPojoMetaClass()) {
-                final char[] objects = (char[]) receiver;
-                objects[normaliseIndex((Integer) args[0], objects.length)] = (Character) args[1];
-                return null;
-            } else
-                return super.call(receiver, args);
-        }
-
-        public Object call(Object receiver, Object arg1, Object arg2) throws Throwable {
-            if (checkPojoMetaClass()) {
-                try {
-                    final char[] objects = (char[]) receiver;
-                    objects[normaliseIndex((Integer) arg1, objects.length)] = (Character) arg2;
-                    return null;
-                }
-                catch (ClassCastException e) {
-                    if ((receiver instanceof char[]) && (arg1 instanceof Integer))
-                        throw e;
-                }
-            }
-            return super.call(receiver, arg1, arg2);
-        }
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.runtime.dgmimpl.arrays;
+
+import groovy.lang.MetaClassImpl;
+import groovy.lang.MetaMethod;
+import org.codehaus.groovy.reflection.CachedClass;
+import org.codehaus.groovy.reflection.ReflectionCache;
+import org.codehaus.groovy.runtime.callsite.CallSite;
+import org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite;
+import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;
+
+public class CharacterArrayPutAtMetaMethod extends ArrayPutAtMetaMethod {
+    private static final CachedClass OBJECT_CLASS = ReflectionCache.OBJECT_CLASS;
+    private static final CachedClass ARR_CLASS = ReflectionCache.getCachedClass(char[].class);
+    private static final CachedClass[] PARAM_CLASS_ARR = new CachedClass[]{INTEGER_CLASS, OBJECT_CLASS};
+
+    public CharacterArrayPutAtMetaMethod() {
+        parameterTypes = PARAM_CLASS_ARR;
+    }
+
+    public final CachedClass getDeclaringClass() {
+        return ARR_CLASS;
+    }
+
+    public Object invoke(Object object, Object[] args) {
+        final char[] objects = (char[]) object;
+        final int index = normaliseIndex((Integer) args[0], objects.length);
+        objects[index] = DefaultTypeTransformation.getCharFromSizeOneString(args[1]);
+        return null;
+    }
+
+    public CallSite createPojoCallSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params, Object receiver, Object[] args) {
+        if (!(args[0] instanceof Integer) || !(args[1] instanceof Character))
+            return PojoMetaMethodSite.createNonAwareCallSite(site, metaClass, metaMethod, params, args);
+        else
+            return new MyPojoMetaMethodSite(site, metaClass, metaMethod, params);
+    }
+
+    private static class MyPojoMetaMethodSite extends PojoMetaMethodSite {
+        public MyPojoMetaMethodSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params) {
+            super(site, metaClass, metaMethod, params);
+        }
+
+        public Object call(Object receiver, Object[] args) throws Throwable {
+            if ((receiver instanceof char[] && args[0] instanceof Integer && args[1] instanceof Character)
+                    && checkPojoMetaClass()) {
+                final char[] objects = (char[]) receiver;
+                objects[normaliseIndex((Integer) args[0], objects.length)] = (Character) args[1];
+                return null;
+            } else
+                return super.call(receiver, args);
+        }
+
+        public Object call(Object receiver, Object arg1, Object arg2) throws Throwable {
+            if (checkPojoMetaClass()) {
+                try {
+                    final char[] objects = (char[]) receiver;
+                    objects[normaliseIndex((Integer) arg1, objects.length)] = (Character) arg2;
+                    return null;
+                }
+                catch (ClassCastException e) {
+                    if ((receiver instanceof char[]) && (arg1 instanceof Integer))
+                        throw e;
+                }
+            }
+            return super.call(receiver, arg1, arg2);
+        }
+    }
+}
diff --git a/src/main/java/org/codehaus/groovy/runtime/dgmimpl/arrays/ObjectArrayPutAtMetaMethod.java b/src/main/java/org/codehaus/groovy/runtime/dgmimpl/arrays/ObjectArrayPutAtMetaMethod.java
index 28e51ba..3db454d 100644
--- a/src/main/java/org/codehaus/groovy/runtime/dgmimpl/arrays/ObjectArrayPutAtMetaMethod.java
+++ b/src/main/java/org/codehaus/groovy/runtime/dgmimpl/arrays/ObjectArrayPutAtMetaMethod.java
@@ -1,97 +1,97 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.runtime.dgmimpl.arrays;
-
-import groovy.lang.GString;
-import groovy.lang.MetaClassImpl;
-import groovy.lang.MetaMethod;
-import org.codehaus.groovy.reflection.CachedClass;
-import org.codehaus.groovy.reflection.ReflectionCache;
-import org.codehaus.groovy.runtime.callsite.CallSite;
-import org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite;
-import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;
-
-public class ObjectArrayPutAtMetaMethod extends ArrayPutAtMetaMethod {
-    private static final CachedClass OBJECT_CLASS = ReflectionCache.getCachedClass(Object.class);
-    private static final CachedClass OBJECT_ARR_CLASS = ReflectionCache.OBJECT_ARRAY_CLASS;
-    private static final CachedClass[] PARAM_CLASS_ARR = new CachedClass[]{INTEGER_CLASS, OBJECT_CLASS};
-
-    public ObjectArrayPutAtMetaMethod() {
-        parameterTypes = PARAM_CLASS_ARR;
-    }
-
-    public final CachedClass getDeclaringClass() {
-        return OBJECT_ARR_CLASS;
-    }
-
-    public Object invoke(Object object, Object[] arguments) {
-        final Object[] objects = (Object[]) object;
-        final int index = normaliseIndex((Integer) arguments[0], objects.length);
-        objects[index] = adjustNewValue(objects, arguments[1]);
-        return null;
-    }
-
-    private static Object adjustNewValue(Object[] objects, Object newValue) {
-        Class arrayComponentClass = objects.getClass().getComponentType();
-        Object adjustedNewVal = newValue;
-        if (newValue instanceof Number) {
-            if (!arrayComponentClass.equals(newValue.getClass())) {
-                adjustedNewVal = DefaultTypeTransformation.castToType(newValue, arrayComponentClass);
-            }
-        } else if (Character.class.isAssignableFrom(arrayComponentClass)) {
-            adjustedNewVal = DefaultTypeTransformation.getCharFromSizeOneString(newValue);
-        } else if (Number.class.isAssignableFrom(arrayComponentClass)) {
-            if (newValue instanceof Character || newValue instanceof String || newValue instanceof GString) {
-                Character ch = DefaultTypeTransformation.getCharFromSizeOneString(newValue);
-                adjustedNewVal = DefaultTypeTransformation.castToType(ch, arrayComponentClass);
-            }
-        } else if (arrayComponentClass.isArray()) {
-            adjustedNewVal = DefaultTypeTransformation.castToType(newValue, arrayComponentClass);
-        }
-        return adjustedNewVal;
-    }
-
-    public CallSite createPojoCallSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params, Object receiver, Object[] args) {
-        if (!(args[0] instanceof Integer))
-            return PojoMetaMethodSite.createNonAwareCallSite(site, metaClass, metaMethod, params, args);
-        else
-            return new MyPojoMetaMethodSite(site, metaClass, metaMethod, params);
-    }
-
-    private static class MyPojoMetaMethodSite extends PojoMetaMethodSite {
-        public MyPojoMetaMethodSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params) {
-            super(site, metaClass, metaMethod, params);
-        }
-
-        public Object call(Object receiver, Object arg1, Object arg2) throws Throwable {
-            if (checkPojoMetaClass()) {
-                try {
-                    final Object[] objects = (Object[]) receiver;
-                    objects[normaliseIndex((Integer) arg1, objects.length)] = adjustNewValue(objects, arg2);
-                    return null;
-                }
-                catch (ClassCastException e) {
-                    if ((receiver instanceof Object[]) && (arg1 instanceof Integer))
-                        throw e;
-                }
-            }
-            return super.call(receiver, arg1, arg2);
-        }
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.runtime.dgmimpl.arrays;
+
+import groovy.lang.GString;
+import groovy.lang.MetaClassImpl;
+import groovy.lang.MetaMethod;
+import org.codehaus.groovy.reflection.CachedClass;
+import org.codehaus.groovy.reflection.ReflectionCache;
+import org.codehaus.groovy.runtime.callsite.CallSite;
+import org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite;
+import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;
+
+public class ObjectArrayPutAtMetaMethod extends ArrayPutAtMetaMethod {
+    private static final CachedClass OBJECT_CLASS = ReflectionCache.getCachedClass(Object.class);
+    private static final CachedClass OBJECT_ARR_CLASS = ReflectionCache.OBJECT_ARRAY_CLASS;
+    private static final CachedClass[] PARAM_CLASS_ARR = new CachedClass[]{INTEGER_CLASS, OBJECT_CLASS};
+
+    public ObjectArrayPutAtMetaMethod() {
+        parameterTypes = PARAM_CLASS_ARR;
+    }
+
+    public final CachedClass getDeclaringClass() {
+        return OBJECT_ARR_CLASS;
+    }
+
+    public Object invoke(Object object, Object[] arguments) {
+        final Object[] objects = (Object[]) object;
+        final int index = normaliseIndex((Integer) arguments[0], objects.length);
+        objects[index] = adjustNewValue(objects, arguments[1]);
+        return null;
+    }
+
+    private static Object adjustNewValue(Object[] objects, Object newValue) {
+        Class arrayComponentClass = objects.getClass().getComponentType();
+        Object adjustedNewVal = newValue;
+        if (newValue instanceof Number) {
+            if (!arrayComponentClass.equals(newValue.getClass())) {
+                adjustedNewVal = DefaultTypeTransformation.castToType(newValue, arrayComponentClass);
+            }
+        } else if (Character.class.isAssignableFrom(arrayComponentClass)) {
+            adjustedNewVal = DefaultTypeTransformation.getCharFromSizeOneString(newValue);
+        } else if (Number.class.isAssignableFrom(arrayComponentClass)) {
+            if (newValue instanceof Character || newValue instanceof String || newValue instanceof GString) {
+                Character ch = DefaultTypeTransformation.getCharFromSizeOneString(newValue);
+                adjustedNewVal = DefaultTypeTransformation.castToType(ch, arrayComponentClass);
+            }
+        } else if (arrayComponentClass.isArray()) {
+            adjustedNewVal = DefaultTypeTransformation.castToType(newValue, arrayComponentClass);
+        }
+        return adjustedNewVal;
+    }
+
+    public CallSite createPojoCallSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params, Object receiver, Object[] args) {
+        if (!(args[0] instanceof Integer))
+            return PojoMetaMethodSite.createNonAwareCallSite(site, metaClass, metaMethod, params, args);
+        else
+            return new MyPojoMetaMethodSite(site, metaClass, metaMethod, params);
+    }
+
+    private static class MyPojoMetaMethodSite extends PojoMetaMethodSite {
+        public MyPojoMetaMethodSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params) {
+            super(site, metaClass, metaMethod, params);
+        }
+
+        public Object call(Object receiver, Object arg1, Object arg2) throws Throwable {
+            if (checkPojoMetaClass()) {
+                try {
+                    final Object[] objects = (Object[]) receiver;
+                    objects[normaliseIndex((Integer) arg1, objects.length)] = adjustNewValue(objects, arg2);
+                    return null;
+                }
+                catch (ClassCastException e) {
+                    if ((receiver instanceof Object[]) && (arg1 instanceof Integer))
+                        throw e;
+                }
+            }
+            return super.call(receiver, arg1, arg2);
+        }
+    }
+}
diff --git a/src/main/java/org/codehaus/groovy/runtime/metaclass/ConcurrentReaderHashMap.java b/src/main/java/org/codehaus/groovy/runtime/metaclass/ConcurrentReaderHashMap.java
index ef7da8f..560cf97 100644
--- a/src/main/java/org/codehaus/groovy/runtime/metaclass/ConcurrentReaderHashMap.java
+++ b/src/main/java/org/codehaus/groovy/runtime/metaclass/ConcurrentReaderHashMap.java
@@ -1,1271 +1,1271 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.runtime.metaclass;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.AbstractCollection;
-import java.util.AbstractMap;
-import java.util.AbstractSet;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-/**
- * A hash table that supports mostly-concurrent reading, but
- * exclusive writing.  Because reads are not limited to periods
- * without writes, a concurrent reader policy is weaker than a classic
- * reader/writer policy, but is generally faster and allows more
- * concurrency. This class is a good choice especially for tables that
- * are mainly created by one thread during the start-up phase of a
- * program, and from then on, are mainly read (with perhaps occasional
- * additions or removals) in many threads.  If you also need concurrency
- * among writes, consider instead using ConcurrentHashMap.
- * <p>
- *
- * Successful retrievals using get(key) and containsKey(key) usually
- * run without locking. Unsuccessful ones (i.e., when the key is not
- * present) do involve brief synchronization (locking).  Also, the
- * size and isEmpty methods are always synchronized.
- *
- * <p> Because retrieval operations can ordinarily overlap with
- * writing operations (i.e., put, remove, and their derivatives),
- * retrievals can only be guaranteed to return the results of the most
- * recently <em>completed</em> operations holding upon their
- * onset. Retrieval operations may or may not return results
- * reflecting in-progress writing operations.  However, the retrieval
- * operations do always return consistent results -- either those
- * holding before any single modification or after it, but never a
- * nonsense result.  For aggregate operations such as putAll and
- * clear, concurrent reads may reflect insertion or removal of only
- * some entries. In those rare contexts in which you use a hash table
- * to synchronize operations across threads (for example, to prevent
- * reads until after clears), you should either encase operations
- * in synchronized blocks, or instead use java.util.Hashtable.
- *
- * <p>
- *
- * This class also supports optional guaranteed
- * exclusive reads, simply by surrounding a call within a synchronized
- * block, as in <br> 
- * <code>ConcurrentReaderHashMap t; ... Object v; <br>
- * synchronized(t) { v = t.get(k); } </code> <br>
- *
- * But this is not usually necessary in practice. For
- * example, it is generally inefficient to write:
- *
- * <pre>
- *   ConcurrentReaderHashMap t; ...            // Inefficient version
- *   Object key; ...
- *   Object value; ...
- *   synchronized(t) { 
- *     if (!t.containsKey(key))
- *       t.put(key, value);
- *       // other code if not previously present
- *     }
- *     else {
- *       // other code if it was previously present
- *     }
- *   }
- *</pre>
- * Instead, if the values are intended to be the same in each case, just take advantage of the fact that put returns
- * null if the key was not previously present:
- * <pre>
- *   ConcurrentReaderHashMap t; ...                // Use this instead
- *   Object key; ...
- *   Object value; ...
- *   Object oldValue = t.put(key, value);
- *   if (oldValue == null) {
- *     // other code if not previously present
- *   }
- *   else {
- *     // other code if it was previously present
- *   }
- *</pre>
- * <p>
- *
- * Iterators and Enumerations (i.e., those returned by
- * keySet().iterator(), entrySet().iterator(), values().iterator(),
- * keys(), and elements()) return elements reflecting the state of the
- * hash table at some point at or since the creation of the
- * iterator/enumeration.  They will return at most one instance of
- * each element (via next()/nextElement()), but might or might not
- * reflect puts and removes that have been processed since they were
- * created.  They do <em>not</em> throw ConcurrentModificationException.
- * However, these iterators are designed to be used by only one
- * thread at a time. Sharing an iterator across multiple threads may
- * lead to unpredictable results if the table is being concurrently
- * modified.  Again, you can ensure interference-free iteration by
- * enclosing the iteration in a synchronized block.  <p>
- *
- * This class may be used as a direct replacement for any use of
- * java.util.Hashtable that does not depend on readers being blocked
- * during updates. Like Hashtable but unlike java.util.HashMap,
- * this class does NOT allow <tt>null</tt> to be used as a key or
- * value.  This class is also typically faster than ConcurrentHashMap
- * when there is usually only one thread updating the table, but 
- * possibly many retrieving values from it.
- * <p>
- *
- * Implementation note: A slightly faster implementation of
- * this class will be possible once planned Java Memory Model
- * revisions are in place.
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- *
- * @author Adapted from ConcurrentHashMap (Doug Lea)
- * @author adapted by the Groovy community
- */
-public class ConcurrentReaderHashMap 
-  extends AbstractMap 
-  implements Cloneable, Serializable {
-  private static final long serialVersionUID = -3225682440765612861L;
-
-
-  /*
-    The basic strategy is an optimistic-style scheme based on
-    the guarantee that the hash table and its lists are always
-    kept in a consistent enough state to be read without locking:
-
-    * Read operations first proceed without locking, by traversing the
-       apparently correct list of the apparently correct bin. If an
-       entry is found, but not invalidated (value field null), it is
-       returned. If not found, operations must recheck (after a memory
-       barrier) to make sure they are using both the right list and
-       the right table (which can change under re-sizes). If
-       invalidated, reads must acquire main update lock to wait out
-       the update, and then re-traverse.
-
-    * All list additions are at the front of each bin, making it easy
-       to check changes, and also fast to traverse.  Entry next
-       pointers are never assigned. Remove() builds new nodes when
-       necessary to preserve this.
-
-    * Remove() (also clear()) invalidates removed nodes to alert read
-       operations that they must wait out the full modifications.
-  */
-
-  /** A Serializable class for barrier lock **/
-  protected static class BarrierLock implements java.io.Serializable {
-      private static final long serialVersionUID = -2159505361622844863L;
-  }
-
-  /**
-   * Lock used only for its memory effects.
-   **/
-  protected final BarrierLock barrierLock = new BarrierLock();
-
-  /**
-   * field written to only to guarantee lock ordering.
-   **/
-  protected transient Object lastWrite;
-
-  /**
-   * Force a memory synchronization that will cause
-   * all readers to see table. Call only when already
-   * holding main sync lock.
-   **/
-  protected final void recordModification(Object x) { 
-    synchronized(barrierLock) {
-      lastWrite = x;
-    }
-  }
-
-  /**
-   * Get ref to table; the reference and the cells it
-   * accesses will be at least as fresh as from last
-   * use of barrierLock
-   **/
-  protected final Entry[] getTableForReading() { 
-    synchronized(barrierLock) {
-      return table; 
-    }
-  }
-
-
-  /**
-   * The default initial number of table slots for this table (32).
-   * Used when not otherwise specified in constructor.
-   **/
-  public static final int DEFAULT_INITIAL_CAPACITY = 32; 
-
-
-  /**
-   * The minimum capacity, used if a lower value is implicitly specified
-   * by either of the constructors with arguments.  
-   * MUST be a power of two.
-   */
-  private static final int MINIMUM_CAPACITY = 4;
-  
-  /**
-   * The maximum capacity, used if a higher value is implicitly specified
-   * by either of the constructors with arguments.
-   * MUST be a power of two &lt;= 1&lt;&lt;30.
-   */
-  private static final int MAXIMUM_CAPACITY = 1 << 30;
-  
-  /**
-   * The default load factor for this table (1.0).
-   * Used when not otherwise specified in constructor.
-   **/
-
-  public static final float DEFAULT_LOAD_FACTOR = 0.75f; 
-
-
-  /**
-   * The hash table data.
-   */
-  protected transient Entry[] table;
-
-  /**
-   * The total number of mappings in the hash table.
-   */
-  protected transient int count;
-
-  /**
-   * The table is rehashed when its size exceeds this threshold.  (The
-   * value of this field is always (int)(capacity * loadFactor).)
-   *
-   * @serial
-   */
-  protected int threshold;
-
-  /**
-   * The load factor for the hash table.
-   *
-   * @serial
-   */
-  protected float loadFactor;
-
-  /**
-   * Returns the appropriate capacity (power of two) for the specified 
-   * initial capacity argument.
-   */
-  private static int p2capacity(int initialCapacity) {
-    int cap = initialCapacity;
-    
-    // Compute the appropriate capacity
-    int result;
-    if (cap > MAXIMUM_CAPACITY || cap < 0) {
-      result = MAXIMUM_CAPACITY;
-    } else {
-      result = MINIMUM_CAPACITY;
-      while (result < cap)
-        result <<= 1;
-    }
-    return result;
-  }
-
-  /**
-   * Return hash code for Object x. Since we are using power-of-two
-   * tables, it is worth the effort to improve hashcode via
-   * the same multiplicative scheme as used in IdentityHashMap.
-   */
-  private static int hash(Object x) {
-    int h = x.hashCode();
-    // Multiply by 127 (quickly, via shifts), and mix in some high
-    // bits to help guard against bunching of codes that are
-    // consecutive or equally spaced.
-    return ((h << 7) - h + (h >>> 9) + (h >>> 17));
-  }
-
-  /** 
-   * Check for equality of non-null references x and y. 
-   **/
-  protected boolean eq(Object x, Object y) {
-    return x == y || x.equals(y);
-  }
-
-  /**
-   * Constructs a new, empty map with the specified initial 
-   * capacity and the specified load factor. 
-   *
-   * @param initialCapacity the initial capacity
-   *  The actual initial capacity is rounded to the nearest power of two.
-   * @param loadFactor  the load factor of the ConcurrentReaderHashMap
-   * @throws IllegalArgumentException  if the initial maximum number 
-   *               of elements is less
-   *               than zero, or if the load factor is non-positive.
-   */
-  public ConcurrentReaderHashMap(int initialCapacity, float loadFactor) {
-    if (loadFactor <= 0)
-      throw new IllegalArgumentException("Illegal Load factor: "+
-                                         loadFactor);
-    this.loadFactor = loadFactor;
-
-    int cap = p2capacity(initialCapacity);
-
-    table = new Entry[cap];
-    threshold = (int)(cap * loadFactor);
-  }
-
-  /**
-   * Constructs a new, empty map with the specified initial 
-   * capacity and default load factor.
-   *
-   * @param   initialCapacity   the initial capacity of the 
-   *                            ConcurrentReaderHashMap.
-   * @throws    IllegalArgumentException if the initial maximum number 
-   *              of elements is less than zero.
-   */
-  public ConcurrentReaderHashMap(int initialCapacity) {
-    this(initialCapacity, DEFAULT_LOAD_FACTOR);
-  }
-
-  /**
-   * Constructs a new, empty map with a default initial capacity
-   * and load factor.
-   */
-  public ConcurrentReaderHashMap() {
-    this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR);
-  }
-
-  /**
-   * Constructs a new map with the same mappings as the given map.  The
-   * map is created with a capacity of twice the number of mappings in
-   * the given map or 16 (whichever is greater), and a default load factor.
-   */
-  public ConcurrentReaderHashMap(Map t) {
-        this(Math.max((int) (t.size() / DEFAULT_LOAD_FACTOR) + 1, 16),
-             DEFAULT_LOAD_FACTOR);
-    putAll(t);
-  }
-
-  /**
-   * Returns the number of key-value mappings in this map.
-   *
-   * @return the number of key-value mappings in this map.
-   */
-  public synchronized int size() {
-    return count;
-  }
-
-  /**
-   * Returns <tt>true</tt> if this map contains no key-value mappings.
-   *
-   * @return <tt>true</tt> if this map contains no key-value mappings.
-   */
-  public synchronized boolean isEmpty() {
-    return count == 0;
-  }
-  
-
-
-  /**
-   * Returns the value to which the specified key is mapped in this table.
-   *
-   * @param   key   a key in the table.
-   * @return  the value to which the key is mapped in this table;
-   *          <code>null</code> if the key is not mapped to any value in
-   *          this table.
-   * @exception  NullPointerException  if the key is <code>null</code>.
-   * @see     #put(Object, Object)
-   */
-  public Object get(Object key) {
-
-    // throw null pointer exception if key null
-    int hash = hash(key);
-
-    /* 
-       Start off at the apparently correct bin.  If entry is found, we
-       need to check after a barrier anyway.  If not found, we need a
-       barrier to check if we are actually in right bin. So either
-       way, we encounter only one barrier unless we need to retry.
-       And we only need to fully synchronize if there have been
-       concurrent modifications.
-    */
-
-    Entry[] tab = table;
-    int index = hash & (tab.length - 1);
-    Entry first = tab[index];
-    Entry e = first;
-
-    for (;;) {
-      if (e == null) {
-
-        // If key apparently not there, check to
-        // make sure this was a valid read
-
-        Entry[] reread = getTableForReading();
-        if (tab == reread && first == tab[index])
-          return null;
-        else {
-          // Wrong list -- must restart traversal at new first
-          tab = reread;
-          e = first = tab[index = hash & (tab.length-1)];
-        }
-
-      }
-
-      else if (e.hash == hash && eq(key, e.key)) {
-        Object value = e.value;
-        if (value != null) 
-          return value;
-
-        // Entry was invalidated during deletion. But it could
-        // have been re-inserted, so we must re-traverse.
-        // To avoid useless contention, get lock to wait out modifications
-        // before re-traversing.
-
-        synchronized(this) {
-          tab = table;
-        }
-        e = first = tab[index = hash & (tab.length-1)];
-
-      }
-      else
-        e = e.next;
-    }
-  }
-
-
-  /**
-   * Tests if the specified object is a key in this table.
-   * 
-   * @param   key   possible key.
-   * @return  <code>true</code> if and only if the specified object 
-   *          is a key in this table, as determined by the 
-   *          <tt>equals</tt> method; <code>false</code> otherwise.
-   * @exception  NullPointerException  if the key is <code>null</code>.
-   * @see     #contains(Object)
-   */
-  public boolean containsKey(Object key) {
-    return get(key) != null;
-  }
-
-  /**
-   * Maps the specified <code>key</code> to the specified 
-   * <code>value</code> in this table. Neither the key nor the 
-   * value can be <code>null</code>. <p>
-   *
-   * The value can be retrieved by calling the <code>get</code> method 
-   * with a key that is equal to the original key. 
-   *
-   * @param      key     the table key.
-   * @param      value   the value.
-   * @return     the previous value of the specified key in this table,
-   *             or <code>null</code> if it did not have one.
-   * @exception  NullPointerException  if the key or value is <code>null</code>.
-   * @see     Object#equals(Object)
-   * @see     #get(Object)
-   */
-  public Object put(Object key, Object value) {
-    if (value == null) 
-      throw new NullPointerException();
-    
-    int hash = hash(key);
-    Entry[] tab = table;
-    int index = hash & (tab.length-1);
-    Entry first = tab[index];
-    Entry e;
-
-    for (e = first; e != null; e = e.next)
-      if (e.hash == hash && eq(key, e.key))
-        break;
-
-    synchronized(this) {
-      if (tab == table) {
-        if (e == null) {
-          //  make sure we are adding to correct list
-          if (first == tab[index]) {
-            //  Add to front of list
-            Entry newEntry = new Entry(hash, key, value, first);
-            tab[index] = newEntry;
-            if (++count >= threshold) rehash();
-            else recordModification(newEntry);
-            return null;
-          }
-        }
-        else {
-          Object oldValue = e.value; 
-          if (first == tab[index] && oldValue != null) {
-            e.value = value;
-            return oldValue;
-          }
-        }
-      }
-      
-      // retry if wrong list or lost race against concurrent remove
-      return sput(key, value, hash);
-    }
-  }
-
-
-  /**
-   * Continuation of put(), called only when sync lock is
-   * held and interference has been detected.
-   **/
-  protected Object sput(Object key, Object value, int hash) { 
-
-    Entry[] tab = table;
-    int index = hash & (tab.length-1);
-    Entry first = tab[index];
-    Entry e = first;
-
-    for (;;) {
-      if (e == null) {
-        Entry newEntry = new Entry(hash, key, value, first);
-        tab[index] = newEntry;
-        if (++count >= threshold) rehash();
-        else recordModification(newEntry);
-        return null;
-      }
-      else if (e.hash == hash && eq(key, e.key)) {
-        Object oldValue = e.value; 
-        e.value = value;
-        return oldValue;
-      }
-      else
-        e = e.next;
-    }
-  }
-
-
-  /**
-   * Rehashes the contents of this map into a new table
-   * with a larger capacity. This method is called automatically when the
-   * number of keys in this map exceeds its capacity and load factor.
-   */
-  protected void rehash() { 
-    Entry[] oldTable = table;
-    int oldCapacity = oldTable.length;
-    if (oldCapacity >= MAXIMUM_CAPACITY) {
-      threshold = Integer.MAX_VALUE; // avoid re-triggering
-      return;
-    }
-
-    int newCapacity = oldCapacity << 1;
-    int mask = newCapacity - 1;
-    threshold = (int)(newCapacity * loadFactor);
-
-    Entry[] newTable = new Entry[newCapacity];
-    /*
-     * Reclassify nodes in each list to new Map.  Because we are
-     * using power-of-two expansion, the elements from each bin
-     * must either stay at same index, or move to
-     * oldCapacity+index. We also eliminate unnecessary node
-     * creation by catching cases where old nodes can be reused
-     * because their next fields won't change. Statistically, at
-     * the default threshold, only about one-sixth of them need
-     * cloning. (The nodes they replace will be garbage
-     * collectible as soon as they are no longer referenced by any
-     * reader thread that may be in the midst of traversing table
-     * right now.)
-     */
-    
-    for (int i = 0; i < oldCapacity ; i++) {
-      // We need to guarantee that any existing reads of old Map can
-      // proceed. So we cannot yet null out each bin.
-      Entry e = oldTable[i];
-      
-      if (e != null) {
-        int idx = e.hash & mask;
-        Entry next = e.next;
-        
-        //  Single node on list
-        if (next == null) 
-          newTable[idx] = e;
-        
-        else {    
-          // Reuse trailing consecutive sequence of all same bit
-          Entry lastRun = e;
-          int lastIdx = idx;
-          for (Entry last = next; last != null; last = last.next) {
-            int k = last.hash & mask;
-            if (k != lastIdx) {
-              lastIdx = k;
-              lastRun = last;
-            }
-          }
-          newTable[lastIdx] = lastRun;
-          
-          // Clone all remaining nodes
-          for (Entry p = e; p != lastRun; p = p.next) {
-            int k = p.hash & mask;
-            newTable[k] = new Entry(p.hash, p.key, 
-                                    p.value, newTable[k]);
-          }
-        }
-      }
-    }
-
-    table = newTable;
-    recordModification(newTable);
-  }
-
-  /**
-   * Removes the key (and its corresponding value) from this 
-   * table. This method does nothing if the key is not in the table.
-   *
-   * @param   key   the key that needs to be removed.
-   * @return  the value to which the key had been mapped in this table,
-   *          or <code>null</code> if the key did not have a mapping.
-   * @exception  NullPointerException  if the key is
-   *               <code>null</code>.
-   */
-  public Object remove(Object key) {
-    /*
-      Find the entry, then 
-        1. Set value field to null, to force get() to retry
-        2. Rebuild the list without this entry.
-           All entries following removed node can stay in list, but
-           all preceding ones need to be cloned.  Traversals rely
-           on this strategy to ensure that elements will not be
-          repeated during iteration.
-    */
-          
-
-    int hash = hash(key);
-    Entry[] tab = table;
-    int index = hash & (tab.length-1);
-    Entry first = tab[index];
-    Entry e = first;
-      
-    for (e = first; e != null; e = e.next) 
-      if (e.hash == hash && eq(key, e.key)) 
-        break;
-
-
-    synchronized(this) {
-      if (tab == table) {
-        if (e == null) {
-          if (first == tab[index])
-            return null;
-        }
-        else {
-          Object oldValue = e.value;
-          if (first == tab[index] && oldValue != null) {
-            e.value = null;
-            count--;
-            
-            Entry head = e.next;
-            for (Entry p = first; p != e; p = p.next) 
-              head = new Entry(p.hash, p.key, p.value, head);
-            
-            tab[index] = head;
-            recordModification(head);
-            return oldValue;
-          }
-        }
-      }
-    
-      // Wrong list or interference
-      return sremove(key, hash);
-    }
-  }
-
-  /**
-   * Continuation of remove(), called only when sync lock is
-   * held and interference has been detected.
-   **/
-  protected Object sremove(Object key, int hash) {
-    Entry[] tab = table;
-    int index = hash & (tab.length-1);
-    Entry first = tab[index];
-      
-    for (Entry e = first; e != null; e = e.next) {
-      if (e.hash == hash && eq(key, e.key)) {
-        Object oldValue = e.value;
-        e.value = null;
-        count--;
-        Entry head = e.next;
-        for (Entry p = first; p != e; p = p.next) 
-          head = new Entry(p.hash, p.key, p.value, head);
-        
-        tab[index] = head;
-        recordModification(head);
-        return oldValue;
-      }
-    }
-    return null;
-  }
-
-
-  /**
-   * Returns <tt>true</tt> if this map maps one or more keys to the
-   * specified value. Note: This method requires a full internal
-   * traversal of the hash table, and so is much slower than
-   * method <tt>containsKey</tt>.
-   *
-   * @param value value whose presence in this map is to be tested.
-   * @return <tt>true</tt> if this map maps one or more keys to the
-   * specified value.  
-   * @exception  NullPointerException  if the value is <code>null</code>.
-   */
-  public boolean containsValue(Object value) {
-    if (value == null) throw new NullPointerException();
-
-    Entry tab[] = getTableForReading();
-    
-    for (int i = 0 ; i < tab.length; ++i) {
-      for (Entry e = tab[i] ; e != null ; e = e.next) 
-        if (value.equals(e.value))
-          return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * Tests if some key maps into the specified value in this table.
-   * This operation is more expensive than the <code>containsKey</code>
-   * method.<p>
-   *
-   * Note that this method is identical in functionality to containsValue,
-   * (which is part of the Map interface in the collections framework).
-   * 
-   * @param      value   a value to search for.
-   * @return     <code>true</code> if and only if some key maps to the
-   *             <code>value</code> argument in this table as 
-   *             determined by the <tt>equals</tt> method;
-   *             <code>false</code> otherwise.
-   * @exception  NullPointerException  if the value is <code>null</code>.
-   * @see        #containsKey(Object)
-   * @see        #containsValue(Object)
-   * @see      Map
-   */
-  public boolean contains(Object value) {
-    return containsValue(value);
-  }
-
-
-  /**
-   * Copies all of the mappings from the specified map to this one.
-   * 
-   * These mappings replace any mappings that this map had for any of the
-   * keys currently in the specified Map.
-   *
-   * @param t Mappings to be stored in this map.
-   */
-  public synchronized void putAll(Map t) {
-    int n = t.size();
-    if (n == 0)
-      return;
-
-    // Expand enough to hold at least n elements without resizing.
-    // We can only resize table by factor of two at a time.
-    // It is faster to rehash with fewer elements, so do it now.
-    while (n >= threshold)
-      rehash();
-
-    for (Iterator it = t.entrySet().iterator(); it.hasNext();) {
-      Map.Entry entry = (Map.Entry) it.next();
-      Object key = entry.getKey();
-      Object value = entry.getValue();
-      put(key, value);
-    }
-  }
-
-
-  /**
-   * Removes all mappings from this map.
-   */
-  public synchronized void clear() {
-    Entry tab[] = table;
-    for (int i = 0; i < tab.length ; ++i) { 
-
-      // must invalidate all to force concurrent get's to wait and then retry
-      for (Entry e = tab[i]; e != null; e = e.next) 
-        e.value = null; 
-
-      tab[i] = null;
-    }
-    count = 0;
-    recordModification(tab);
-  }
-
-  /**
-   * Returns a shallow copy of this 
-   * <tt>ConcurrentReaderHashMap</tt> instance: the keys and
-   * values themselves are not cloned.
-   *
-   * @return a shallow copy of this map.
-   */
-  public synchronized Object clone() {
-    try { 
-      ConcurrentReaderHashMap t = (ConcurrentReaderHashMap)super.clone();
-
-      t.keySet = null;
-      t.entrySet = null;
-      t.values = null;
-
-      Entry[] tab = table;
-      t.table = new Entry[tab.length];
-      Entry[] ttab = t.table;
-
-      for (int i = 0; i < tab.length; ++i) {
-        Entry first = null;
-        for (Entry e = tab[i]; e != null; e = e.next) 
-          first = new Entry(e.hash, e.key, e.value, first);
-        ttab[i] = first;
-      }
-
-      return t;
-    } 
-    catch (CloneNotSupportedException e) { 
-      // this shouldn't happen, since we are Cloneable
-      throw new InternalError();
-    }
-  }
-
-  // Views
-
-  protected transient Set keySet = null;
-  protected transient Set entrySet = null;
-  protected transient Collection values = null;
-
-  /**
-   * Returns a set view of the keys contained in this map.  The set is
-   * backed by the map, so changes to the map are reflected in the set, and
-   * vice-versa.  The set supports element removal, which removes the
-   * corresponding mapping from this map, via the <tt>Iterator.remove</tt>,
-   * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt>, and
-   * <tt>clear</tt> operations.  It does not support the <tt>add</tt> or
-   * <tt>addAll</tt> operations.
-   *
-   * @return a set view of the keys contained in this map.
-   */
-  public Set keySet() {
-    Set ks = keySet;
-    return (ks != null)? ks : (keySet = new KeySet());
-  }
-  
-  private class KeySet extends AbstractSet {
-    public Iterator iterator() {
-      return new KeyIterator();
-    }
-    public int size() {
-      return ConcurrentReaderHashMap.this.size();
-    }
-    public boolean contains(Object o) {
-      return ConcurrentReaderHashMap.this.containsKey(o);
-    }
-    public boolean remove(Object o) {
-      return ConcurrentReaderHashMap.this.remove(o) != null;
-    }
-    public void clear() {
-      ConcurrentReaderHashMap.this.clear();
-    }
-    public Object[] toArray() {
-      Collection c = new ArrayList();
-      for (Iterator i = iterator(); i.hasNext(); )
-          c.add(i.next());
-      return c.toArray();
-    }
-    public Object[] toArray(Object[] a) {
-      Collection c = new ArrayList();
-      for (Iterator i = iterator(); i.hasNext(); )
-          c.add(i.next());
-      return c.toArray(a);
-    }
-  }
-
-  /**
-   * Returns a collection view of the values contained in this map.  The
-   * collection is backed by the map, so changes to the map are reflected in
-   * the collection, and vice-versa.  The collection supports element
-   * removal, which removes the corresponding mapping from this map, via the
-   * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>,
-   * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> operations.
-   * It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
-   *
-   * @return a collection view of the values contained in this map.
-   */
-  public Collection values() {
-    Collection vs = values;
-    return (vs != null)? vs : (values = new Values());
-  }
-  
-  private class Values extends AbstractCollection {
-    public Iterator iterator() {
-      return new ValueIterator();
-    }
-    public int size() {
-      return ConcurrentReaderHashMap.this.size();
-    }
-    public boolean contains(Object o) {
-      return ConcurrentReaderHashMap.this.containsValue(o);
-    }
-    public void clear() {
-      ConcurrentReaderHashMap.this.clear();
-    }
-    public Object[] toArray() {
-      Collection c = new ArrayList();
-      for (Iterator i = iterator(); i.hasNext(); )
-          c.add(i.next());
-      return c.toArray();
-    }
-    public Object[] toArray(Object[] a) {
-      Collection c = new ArrayList();
-      for (Iterator i = iterator(); i.hasNext(); )
-          c.add(i.next());
-      return c.toArray(a);
-    }
-  }
-
-  /**
-   * Returns a collection view of the mappings contained in this map.  Each
-   * element in the returned collection is a <tt>Map.Entry</tt>.  The
-   * collection is backed by the map, so changes to the map are reflected in
-   * the collection, and vice-versa.  The collection supports element
-   * removal, which removes the corresponding mapping from the map, via the
-   * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>,
-   * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> operations.
-   * It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
-   *
-   * @return a collection view of the mappings contained in this map.
-   */
-  public Set entrySet() {
-    Set es = entrySet;
-    return (es != null) ? es : (entrySet = new EntrySet());
-  }
-
-  private class EntrySet extends AbstractSet {
-    public Iterator iterator() {
-      return new HashIterator();
-    }
-    public boolean contains(Object o) {
-      if (!(o instanceof Map.Entry))
-        return false;
-      Map.Entry entry = (Map.Entry)o;
-      Object v = ConcurrentReaderHashMap.this.get(entry.getKey());
-      return v != null && v.equals(entry.getValue());
-    }
-    public boolean remove(Object o) {
-      if (!(o instanceof Map.Entry))
-        return false;
-      return ConcurrentReaderHashMap.this.findAndRemoveEntry((Map.Entry)o);
-    }
-    public int size() {
-      return ConcurrentReaderHashMap.this.size();
-    }
-    public void clear() {
-      ConcurrentReaderHashMap.this.clear();
-    }
-    public Object[] toArray() {
-      Collection c = new ArrayList();
-      for (Iterator i = iterator(); i.hasNext(); )
-          c.add(i.next());
-      return c.toArray();
-    }
-    public Object[] toArray(Object[] a) {
-      Collection c = new ArrayList();
-      for (Iterator i = iterator(); i.hasNext(); )
-          c.add(i.next());
-      return c.toArray(a);
-    }
-  }
-
-  /**
-   * Helper method for entrySet.remove
-   **/
-  protected synchronized boolean findAndRemoveEntry(Map.Entry entry) {
-    Object key = entry.getKey();
-    Object v = get(key);
-    if (v != null && v.equals(entry.getValue())) {
-      remove(key);
-      return true;
-    }
-    else
-      return false;
-  }
-
-  /**
-   * Returns an enumeration of the keys in this table.
-   *
-   * @return  an enumeration of the keys in this table.
-   * @see     Enumeration
-   * @see     #elements()
-   * @see   #keySet()
-   * @see   Map
-   */
-  public Enumeration keys() {
-    return new KeyIterator();
-  }
-
-  /**
-   * Returns an enumeration of the values in this table.
-   * Use the Enumeration methods on the returned object to fetch the elements
-   * sequentially.
-   *
-   * @return  an enumeration of the values in this table.
-   * @see     java.util.Enumeration
-   * @see     #keys()
-   * @see   #values()
-   * @see   Map
-   */
-  public Enumeration elements() {
-    return new ValueIterator();
-  }
-
-
-  /**
-   * ConcurrentReaderHashMap collision list entry.
-   */
-  protected static class Entry implements Map.Entry {
-
-    /* 
-       The use of volatile for value field ensures that
-       we can detect status changes without synchronization.
-       The other fields are never changed, and are
-       marked as final. 
-    */
-    protected final int hash;
-    protected final Object key;
-    protected final Entry next;
-    protected volatile Object value;
-
-    Entry(int hash, Object key, Object value, Entry next) {
-      this.hash = hash;
-      this.key = key;
-      this.next = next;
-      this.value = value;
-    }
-
-    // Map.Entry Ops 
-
-    public Object getKey() {
-      return key;
-    }
-
-    /**
-     * Get the value.  Note: In an entrySet or entrySet.iterator,
-     * unless the set or iterator is used under synchronization of the
-     * table as a whole (or you can otherwise guarantee lack of
-     * concurrent modification), <tt>getValue</tt> <em>might</em>
-     * return null, reflecting the fact that the entry has been
-     * concurrently removed. However, there are no assurances that
-     * concurrent removals will be reflected using this method.
-     * 
-     * @return     the current value, or null if the entry has been 
-     * detectably removed.
-     **/
-    public Object getValue() {
-      return value; 
-    }
-
-    /**
-     * Set the value of this entry.  Note: In an entrySet or
-     * entrySet.iterator), unless the set or iterator is used under
-     * synchronization of the table as a whole (or you can otherwise
-     * guarantee lack of concurrent modification), <tt>setValue</tt>
-     * is not strictly guaranteed to actually replace the value field
-     * obtained via the <tt>get</tt> operation of the underlying hash
-     * table in multi-threaded applications.  If iterator-wide
-     * synchronization is not used, and any other concurrent
-     * <tt>put</tt> or <tt>remove</tt> operations occur, sometimes
-     * even to <em>other</em> entries, then this change is not
-     * guaranteed to be reflected in the hash table. (It might, or it
-     * might not. There are no assurances either way.)
-     *
-     * @param      value   the new value.
-     * @return     the previous value, or null if entry has been detectably
-     * removed.
-     * @exception  NullPointerException  if the value is <code>null</code>.
-     * 
-     **/
-    public Object setValue(Object value) {
-      if (value == null)
-        throw new NullPointerException();
-      Object oldValue = this.value;
-      this.value = value;
-      return oldValue;
-    }
-
-    public boolean equals(Object o) {
-      if (!(o instanceof Map.Entry))
-        return false;
-      Map.Entry e = (Map.Entry)o;
-      return (key.equals(e.getKey()) && value.equals(e.getValue()));
-    }
-    
-    public int hashCode() {
-      return  key.hashCode() ^ value.hashCode();
-    }
-    
-    public String toString() {
-      return key + "=" + value;
-    }
-
-  }
-
-  protected class HashIterator implements Iterator, Enumeration {
-    protected final Entry[] tab;           // snapshot of table
-    protected int index;                   // current slot 
-    protected Entry entry = null;          // current node of slot
-    protected Object currentKey;           // key for current node
-    protected Object currentValue;         // value for current node
-    protected Entry lastReturned = null;   // last node returned by next
-
-    protected HashIterator() {
-      tab = ConcurrentReaderHashMap.this.getTableForReading();
-      index = tab.length - 1;
-    }
-
-    public boolean hasMoreElements() { return hasNext(); }
-    public Object nextElement() { return next(); }
-
-
-    public boolean hasNext() {
-
-      /*
-        currentKey and currentValue are set here to ensure that next()
-        returns normally if hasNext() returns true. This avoids
-        surprises especially when final element is removed during
-        traversal -- instead, we just ignore the removal during
-        current traversal.  
-      */
-
-      for (;;) {
-        if (entry != null) {
-          Object v = entry.value;
-          if (v != null) {
-            currentKey = entry.key;
-            currentValue = v;
-            return true;
-          }
-          else
-            entry = entry.next;
-        }
-
-        while (entry == null && index >= 0)
-          entry = tab[index--];
-
-        if (entry == null) {
-          currentKey = currentValue = null;
-          return false;
-        }
-      }
-    }
-
-    protected Object returnValueOfNext() { return entry; }
-
-    public Object next() {
-      if (currentKey == null && !hasNext())
-        throw new NoSuchElementException();
-
-      Object result = returnValueOfNext();
-      lastReturned = entry;
-      currentKey = currentValue = null;
-      entry = entry.next;
-      return result;
-    }
-
-    public void remove() {
-      if (lastReturned == null)
-        throw new IllegalStateException();
-      ConcurrentReaderHashMap.this.remove(lastReturned.key);
-      lastReturned = null;
-    }
-
-  }
-
-
-  protected class KeyIterator extends HashIterator {
-    protected Object returnValueOfNext() { return currentKey; }
-  }
-  
-  protected class ValueIterator extends HashIterator {
-    protected Object returnValueOfNext() { return currentValue; }
-  }
-  
-
-
-  /**
-   * Save the state of the <tt>ConcurrentReaderHashMap</tt> 
-   * instance to a stream (i.e.,
-   * serialize it).
-   *
-   * @param s the stream
-   * @serialData The <i>capacity</i> of the
-   * ConcurrentReaderHashMap (the length of the
-   * bucket array) is emitted (int), followed  by the
-   * <i>size</i> of the ConcurrentReaderHashMap (the number of key-value
-   * mappings), followed by the key (Object) and value (Object)
-   * for each key-value mapping represented by the ConcurrentReaderHashMap
-   * The key-value mappings are emitted in no particular order.
-   */
-  private synchronized void writeObject(java.io.ObjectOutputStream s)
-    throws IOException  {
-    // Write out the threshold, loadfactor, and any hidden stuff
-    s.defaultWriteObject();
-    
-    // Write out number of buckets
-    s.writeInt(table.length);
-    
-    // Write out size (number of Mappings)
-    s.writeInt(count);
-    
-    // Write out keys and values (alternating)
-    for (int index = table.length-1; index >= 0; index--) {
-      Entry entry = table[index];
-      
-      while (entry != null) {
-        s.writeObject(entry.key);
-        s.writeObject(entry.value);
-        entry = entry.next;
-      }
-    }
-  }
-
-  /**
-   * Reconstitute the <tt>ConcurrentReaderHashMap</tt> 
-   * instance from a stream (i.e.,
-   * deserialize it).
-   *
-   * @param s the stream
-   */
-  private synchronized void readObject(java.io.ObjectInputStream s)
-    throws IOException, ClassNotFoundException  {
-    // Read in the threshold, loadfactor, and any hidden stuff
-    s.defaultReadObject();
-
-    // Read in number of buckets and allocate the bucket array;
-    int numBuckets = s.readInt();
-    table = new Entry[numBuckets];
-    
-    // Read in size (number of Mappings)
-    int size = s.readInt();
-    
-    // Read the keys and values, and put the mappings in the table
-    for (int i=0; i<size; i++) {
-      Object key = s.readObject();
-      Object value = s.readObject();
-      put(key, value);
-    }
-  }
-  
-  /** 
-   * @return the number of slots in this table
-   **/
-  public synchronized int capacity() {
-    return table.length;
-  }
-
-  /** 
-   * @return the load factor
-   **/
-  public float loadFactor() {
-    return loadFactor;
-  }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.runtime.metaclass;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.AbstractCollection;
+import java.util.AbstractMap;
+import java.util.AbstractSet;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+/**
+ * A hash table that supports mostly-concurrent reading, but
+ * exclusive writing.  Because reads are not limited to periods
+ * without writes, a concurrent reader policy is weaker than a classic
+ * reader/writer policy, but is generally faster and allows more
+ * concurrency. This class is a good choice especially for tables that
+ * are mainly created by one thread during the start-up phase of a
+ * program, and from then on, are mainly read (with perhaps occasional
+ * additions or removals) in many threads.  If you also need concurrency
+ * among writes, consider instead using ConcurrentHashMap.
+ * <p>
+ *
+ * Successful retrievals using get(key) and containsKey(key) usually
+ * run without locking. Unsuccessful ones (i.e., when the key is not
+ * present) do involve brief synchronization (locking).  Also, the
+ * size and isEmpty methods are always synchronized.
+ *
+ * <p> Because retrieval operations can ordinarily overlap with
+ * writing operations (i.e., put, remove, and their derivatives),
+ * retrievals can only be guaranteed to return the results of the most
+ * recently <em>completed</em> operations holding upon their
+ * onset. Retrieval operations may or may not return results
+ * reflecting in-progress writing operations.  However, the retrieval
+ * operations do always return consistent results -- either those
+ * holding before any single modification or after it, but never a
+ * nonsense result.  For aggregate operations such as putAll and
+ * clear, concurrent reads may reflect insertion or removal of only
+ * some entries. In those rare contexts in which you use a hash table
+ * to synchronize operations across threads (for example, to prevent
+ * reads until after clears), you should either encase operations
+ * in synchronized blocks, or instead use java.util.Hashtable.
+ *
+ * <p>
+ *
+ * This class also supports optional guaranteed
+ * exclusive reads, simply by surrounding a call within a synchronized
+ * block, as in <br> 
+ * <code>ConcurrentReaderHashMap t; ... Object v; <br>
+ * synchronized(t) { v = t.get(k); } </code> <br>
+ *
+ * But this is not usually necessary in practice. For
+ * example, it is generally inefficient to write:
+ *
+ * <pre>
+ *   ConcurrentReaderHashMap t; ...            // Inefficient version
+ *   Object key; ...
+ *   Object value; ...
+ *   synchronized(t) { 
+ *     if (!t.containsKey(key))
+ *       t.put(key, value);
+ *       // other code if not previously present
+ *     }
+ *     else {
+ *       // other code if it was previously present
+ *     }
+ *   }
+ *</pre>
+ * Instead, if the values are intended to be the same in each case, just take advantage of the fact that put returns
+ * null if the key was not previously present:
+ * <pre>
+ *   ConcurrentReaderHashMap t; ...                // Use this instead
+ *   Object key; ...
+ *   Object value; ...
+ *   Object oldValue = t.put(key, value);
+ *   if (oldValue == null) {
+ *     // other code if not previously present
+ *   }
+ *   else {
+ *     // other code if it was previously present
+ *   }
+ *</pre>
+ * <p>
+ *
+ * Iterators and Enumerations (i.e., those returned by
+ * keySet().iterator(), entrySet().iterator(), values().iterator(),
+ * keys(), and elements()) return elements reflecting the state of the
+ * hash table at some point at or since the creation of the
+ * iterator/enumeration.  They will return at most one instance of
+ * each element (via next()/nextElement()), but might or might not
+ * reflect puts and removes that have been processed since they were
+ * created.  They do <em>not</em> throw ConcurrentModificationException.
+ * However, these iterators are designed to be used by only one
+ * thread at a time. Sharing an iterator across multiple threads may
+ * lead to unpredictable results if the table is being concurrently
+ * modified.  Again, you can ensure interference-free iteration by
+ * enclosing the iteration in a synchronized block.  <p>
+ *
+ * This class may be used as a direct replacement for any use of
+ * java.util.Hashtable that does not depend on readers being blocked
+ * during updates. Like Hashtable but unlike java.util.HashMap,
+ * this class does NOT allow <tt>null</tt> to be used as a key or
+ * value.  This class is also typically faster than ConcurrentHashMap
+ * when there is usually only one thread updating the table, but 
+ * possibly many retrieving values from it.
+ * <p>
+ *
+ * Implementation note: A slightly faster implementation of
+ * this class will be possible once planned Java Memory Model
+ * revisions are in place.
+ *
+ * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
+ *
+ * @author Adapted from ConcurrentHashMap (Doug Lea)
+ * @author adapted by the Groovy community
+ */
+public class ConcurrentReaderHashMap 
+  extends AbstractMap 
+  implements Cloneable, Serializable {
+  private static final long serialVersionUID = -3225682440765612861L;
+
+
+  /*
+    The basic strategy is an optimistic-style scheme based on
+    the guarantee that the hash table and its lists are always
+    kept in a consistent enough state to be read without locking:
+
+    * Read operations first proceed without locking, by traversing the
+       apparently correct list of the apparently correct bin. If an
+       entry is found, but not invalidated (value field null), it is
+       returned. If not found, operations must recheck (after a memory
+       barrier) to make sure they are using both the right list and
+       the right table (which can change under re-sizes). If
+       invalidated, reads must acquire main update lock to wait out
+       the update, and then re-traverse.
+
+    * All list additions are at the front of each bin, making it easy
+       to check changes, and also fast to traverse.  Entry next
+       pointers are never assigned. Remove() builds new nodes when
+       necessary to preserve this.
+
+    * Remove() (also clear()) invalidates removed nodes to alert read
+       operations that they must wait out the full modifications.
+  */
+
+  /** A Serializable class for barrier lock **/
+  protected static class BarrierLock implements java.io.Serializable {
+      private static final long serialVersionUID = -2159505361622844863L;
+  }
+
+  /**
+   * Lock used only for its memory effects.
+   **/
+  protected final BarrierLock barrierLock = new BarrierLock();
+
+  /**
+   * field written to only to guarantee lock ordering.
+   **/
+  protected transient Object lastWrite;
+
+  /**
+   * Force a memory synchronization that will cause
+   * all readers to see table. Call only when already
+   * holding main sync lock.
+   **/
+  protected final void recordModification(Object x) { 
+    synchronized(barrierLock) {
+      lastWrite = x;
+    }
+  }
+
+  /**
+   * Get ref to table; the reference and the cells it
+   * accesses will be at least as fresh as from last
+   * use of barrierLock
+   **/
+  protected final Entry[] getTableForReading() { 
+    synchronized(barrierLock) {
+      return table; 
+    }
+  }
+
+
+  /**
+   * The default initial number of table slots for this table (32).
+   * Used when not otherwise specified in constructor.
+   **/
+  public static final int DEFAULT_INITIAL_CAPACITY = 32; 
+
+
+  /**
+   * The minimum capacity, used if a lower value is implicitly specified
+   * by either of the constructors with arguments.  
+   * MUST be a power of two.
+   */
+  private static final int MINIMUM_CAPACITY = 4;
+  
+  /**
+   * The maximum capacity, used if a higher value is implicitly specified
+   * by either of the constructors with arguments.
+   * MUST be a power of two &lt;= 1&lt;&lt;30.
+   */
+  private static final int MAXIMUM_CAPACITY = 1 << 30;
+  
+  /**
+   * The default load factor for this table (1.0).
+   * Used when not otherwise specified in constructor.
+   **/
+
+  public static final float DEFAULT_LOAD_FACTOR = 0.75f; 
+
+
+  /**
+   * The hash table data.
+   */
+  protected transient Entry[] table;
+
+  /**
+   * The total number of mappings in the hash table.
+   */
+  protected transient int count;
+
+  /**
+   * The table is rehashed when its size exceeds this threshold.  (The
+   * value of this field is always (int)(capacity * loadFactor).)
+   *
+   * @serial
+   */
+  protected int threshold;
+
+  /**
+   * The load factor for the hash table.
+   *
+   * @serial
+   */
+  protected float loadFactor;
+
+  /**
+   * Returns the appropriate capacity (power of two) for the specified 
+   * initial capacity argument.
+   */
+  private static int p2capacity(int initialCapacity) {
+    int cap = initialCapacity;
+    
+    // Compute the appropriate capacity
+    int result;
+    if (cap > MAXIMUM_CAPACITY || cap < 0) {
+      result = MAXIMUM_CAPACITY;
+    } else {
+      result = MINIMUM_CAPACITY;
+      while (result < cap)
+        result <<= 1;
+    }
+    return result;
+  }
+
+  /**
+   * Return hash code for Object x. Since we are using power-of-two
+   * tables, it is worth the effort to improve hashcode via
+   * the same multiplicative scheme as used in IdentityHashMap.
+   */
+  private static int hash(Object x) {
+    int h = x.hashCode();
+    // Multiply by 127 (quickly, via shifts), and mix in some high
+    // bits to help guard against bunching of codes that are
+    // consecutive or equally spaced.
+    return ((h << 7) - h + (h >>> 9) + (h >>> 17));
+  }
+
+  /** 
+   * Check for equality of non-null references x and y. 
+   **/
+  protected boolean eq(Object x, Object y) {
+    return x == y || x.equals(y);
+  }
+
+  /**
+   * Constructs a new, empty map with the specified initial 
+   * capacity and the specified load factor. 
+   *
+   * @param initialCapacity the initial capacity
+   *  The actual initial capacity is rounded to the nearest power of two.
+   * @param loadFactor  the load factor of the ConcurrentReaderHashMap
+   * @throws IllegalArgumentException  if the initial maximum number 
+   *               of elements is less
+   *               than zero, or if the load factor is non-positive.
+   */
+  public ConcurrentReaderHashMap(int initialCapacity, float loadFactor) {
+    if (loadFactor <= 0)
+      throw new IllegalArgumentException("Illegal Load factor: "+
+                                         loadFactor);
+    this.loadFactor = loadFactor;
+
+    int cap = p2capacity(initialCapacity);
+
+    table = new Entry[cap];
+    threshold = (int)(cap * loadFactor);
+  }
+
+  /**
+   * Constructs a new, empty map with the specified initial 
+   * capacity and default load factor.
+   *
+   * @param   initialCapacity   the initial capacity of the 
+   *                            ConcurrentReaderHashMap.
+   * @throws    IllegalArgumentException if the initial maximum number 
+   *              of elements is less than zero.
+   */
+  public ConcurrentReaderHashMap(int initialCapacity) {
+    this(initialCapacity, DEFAULT_LOAD_FACTOR);
+  }
+
+  /**
+   * Constructs a new, empty map with a default initial capacity
+   * and load factor.
+   */
+  public ConcurrentReaderHashMap() {
+    this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR);
+  }
+
+  /**
+   * Constructs a new map with the same mappings as the given map.  The
+   * map is created with a capacity of twice the number of mappings in
+   * the given map or 16 (whichever is greater), and a default load factor.
+   */
+  public ConcurrentReaderHashMap(Map t) {
+        this(Math.max((int) (t.size() / DEFAULT_LOAD_FACTOR) + 1, 16),
+             DEFAULT_LOAD_FACTOR);
+    putAll(t);
+  }
+
+  /**
+   * Returns the number of key-value mappings in this map.
+   *
+   * @return the number of key-value mappings in this map.
+   */
+  public synchronized int size() {
+    return count;
+  }
+
+  /**
+   * Returns <tt>true</tt> if this map contains no key-value mappings.
+   *
+   * @return <tt>true</tt> if this map contains no key-value mappings.
+   */
+  public synchronized boolean isEmpty() {
+    return count == 0;
+  }
+  
+
+
+  /**
+   * Returns the value to which the specified key is mapped in this table.
+   *
+   * @param   key   a key in the table.
+   * @return  the value to which the key is mapped in this table;
+   *          <code>null</code> if the key is not mapped to any value in
+   *          this table.
+   * @exception  NullPointerException  if the key is <code>null</code>.
+   * @see     #put(Object, Object)
+   */
+  public Object get(Object key) {
+
+    // throw null pointer exception if key null
+    int hash = hash(key);
+
+    /* 
+       Start off at the apparently correct bin.  If entry is found, we
+       need to check after a barrier anyway.  If not found, we need a
+       barrier to check if we are actually in right bin. So either
+       way, we encounter only one barrier unless we need to retry.
+       And we only need to fully synchronize if there have been
+       concurrent modifications.
+    */
+
+    Entry[] tab = table;
+    int index = hash & (tab.length - 1);
+    Entry first = tab[index];
+    Entry e = first;
+
+    for (;;) {
+      if (e == null) {
+
+        // If key apparently not there, check to
+        // make sure this was a valid read
+
+        Entry[] reread = getTableForReading();
+        if (tab == reread && first == tab[index])
+          return null;
+        else {
+          // Wrong list -- must restart traversal at new first
+          tab = reread;
+          e = first = tab[index = hash & (tab.length-1)];
+        }
+
+      }
+
+      else if (e.hash == hash && eq(key, e.key)) {
+        Object value = e.value;
+        if (value != null) 
+          return value;
+
+        // Entry was invalidated during deletion. But it could
+        // have been re-inserted, so we must re-traverse.
+        // To avoid useless contention, get lock to wait out modifications
+        // before re-traversing.
+
+        synchronized(this) {
+          tab = table;
+        }
+        e = first = tab[index = hash & (tab.length-1)];
+
+      }
+      else
+        e = e.next;
+    }
+  }
+
+
+  /**
+   * Tests if the specified object is a key in this table.
+   * 
+   * @param   key   possible key.
+   * @return  <code>true</code> if and only if the specified object 
+   *          is a key in this table, as determined by the 
+   *          <tt>equals</tt> method; <code>false</code> otherwise.
+   * @exception  NullPointerException  if the key is <code>null</code>.
+   * @see     #contains(Object)
+   */
+  public boolean containsKey(Object key) {
+    return get(key) != null;
+  }
+
+  /**
+   * Maps the specified <code>key</code> to the specified 
+   * <code>value</code> in this table. Neither the key nor the 
+   * value can be <code>null</code>. <p>
+   *
+   * The value can be retrieved by calling the <code>get</code> method 
+   * with a key that is equal to the original key. 
+   *
+   * @param      key     the table key.
+   * @param      value   the value.
+   * @return     the previous value of the specified key in this table,
+   *             or <code>null</code> if it did not have one.
+   * @exception  NullPointerException  if the key or value is <code>null</code>.
+   * @see     Object#equals(Object)
+   * @see     #get(Object)
+   */
+  public Object put(Object key, Object value) {
+    if (value == null) 
+      throw new NullPointerException();
+    
+    int hash = hash(key);
+    Entry[] tab = table;
+    int index = hash & (tab.length-1);
+    Entry first = tab[index];
+    Entry e;
+
+    for (e = first; e != null; e = e.next)
+      if (e.hash == hash && eq(key, e.key))
+        break;
+
+    synchronized(this) {
+      if (tab == table) {
+        if (e == null) {
+          //  make sure we are adding to correct list
+          if (first == tab[index]) {
+            //  Add to front of list
+            Entry newEntry = new Entry(hash, key, value, first);
+            tab[index] = newEntry;
+            if (++count >= threshold) rehash();
+            else recordModification(newEntry);
+            return null;
+          }
+        }
+        else {
+          Object oldValue = e.value; 
+          if (first == tab[index] && oldValue != null) {
+            e.value = value;
+            return oldValue;
+          }
+        }
+      }
+      
+      // retry if wrong list or lost race against concurrent remove
+      return sput(key, value, hash);
+    }
+  }
+
+
+  /**
+   * Continuation of put(), called only when sync lock is
+   * held and interference has been detected.
+   **/
+  protected Object sput(Object key, Object value, int hash) { 
+
+    Entry[] tab = table;
+    int index = hash & (tab.length-1);
+    Entry first = tab[index];
+    Entry e = first;
+
+    for (;;) {
+      if (e == null) {
+        Entry newEntry = new Entry(hash, key, value, first);
+        tab[index] = newEntry;
+        if (++count >= threshold) rehash();
+        else recordModification(newEntry);
+        return null;
+      }
+      else if (e.hash == hash && eq(key, e.key)) {
+        Object oldValue = e.value; 
+        e.value = value;
+        return oldValue;
+      }
+      else
+        e = e.next;
+    }
+  }
+
+
+  /**
+   * Rehashes the contents of this map into a new table
+   * with a larger capacity. This method is called automatically when the
+   * number of keys in this map exceeds its capacity and load factor.
+   */
+  protected void rehash() { 
+    Entry[] oldTable = table;
+    int oldCapacity = oldTable.length;
+    if (oldCapacity >= MAXIMUM_CAPACITY) {
+      threshold = Integer.MAX_VALUE; // avoid re-triggering
+      return;
+    }
+
+    int newCapacity = oldCapacity << 1;
+    int mask = newCapacity - 1;
+    threshold = (int)(newCapacity * loadFactor);
+
+    Entry[] newTable = new Entry[newCapacity];
+    /*
+     * Reclassify nodes in each list to new Map.  Because we are
+     * using power-of-two expansion, the elements from each bin
+     * must either stay at same index, or move to
+     * oldCapacity+index. We also eliminate unnecessary node
+     * creation by catching cases where old nodes can be reused
+     * because their next fields won't change. Statistically, at
+     * the default threshold, only about one-sixth of them need
+     * cloning. (The nodes they replace will be garbage
+     * collectible as soon as they are no longer referenced by any
+     * reader thread that may be in the midst of traversing table
+     * right now.)
+     */
+    
+    for (int i = 0; i < oldCapacity ; i++) {
+      // We need to guarantee that any existing reads of old Map can
+      // proceed. So we cannot yet null out each bin.
+      Entry e = oldTable[i];
+      
+      if (e != null) {
+        int idx = e.hash & mask;
+        Entry next = e.next;
+        
+        //  Single node on list
+        if (next == null) 
+          newTable[idx] = e;
+        
+        else {    
+          // Reuse trailing consecutive sequence of all same bit
+          Entry lastRun = e;
+          int lastIdx = idx;
+          for (Entry last = next; last != null; last = last.next) {
+            int k = last.hash & mask;
+            if (k != lastIdx) {
+              lastIdx = k;
+              lastRun = last;
+            }
+          }
+          newTable[lastIdx] = lastRun;
+          
+          // Clone all remaining nodes
+          for (Entry p = e; p != lastRun; p = p.next) {
+            int k = p.hash & mask;
+            newTable[k] = new Entry(p.hash, p.key, 
+                                    p.value, newTable[k]);
+          }
+        }
+      }
+    }
+
+    table = newTable;
+    recordModification(newTable);
+  }
+
+  /**
+   * Removes the key (and its corresponding value) from this 
+   * table. This method does nothing if the key is not in the table.
+   *
+   * @param   key   the key that needs to be removed.
+   * @return  the value to which the key had been mapped in this table,
+   *          or <code>null</code> if the key did not have a mapping.
+   * @exception  NullPointerException  if the key is
+   *               <code>null</code>.
+   */
+  public Object remove(Object key) {
+    /*
+      Find the entry, then 
+        1. Set value field to null, to force get() to retry
+        2. Rebuild the list without this entry.
+           All entries following removed node can stay in list, but
+           all preceding ones need to be cloned.  Traversals rely
+           on this strategy to ensure that elements will not be
+          repeated during iteration.
+    */
+          
+
+    int hash = hash(key);
+    Entry[] tab = table;
+    int index = hash & (tab.length-1);
+    Entry first = tab[index];
+    Entry e = first;
+      
+    for (e = first; e != null; e = e.next) 
+      if (e.hash == hash && eq(key, e.key)) 
+        break;
+
+
+    synchronized(this) {
+      if (tab == table) {
+        if (e == null) {
+          if (first == tab[index])
+            return null;
+        }
+        else {
+          Object oldValue = e.value;
+          if (first == tab[index] && oldValue != null) {
+            e.value = null;
+            count--;
+            
+            Entry head = e.next;
+            for (Entry p = first; p != e; p = p.next) 
+              head = new Entry(p.hash, p.key, p.value, head);
+            
+            tab[index] = head;
+            recordModification(head);
+            return oldValue;
+          }
+        }
+      }
+    
+      // Wrong list or interference
+      return sremove(key, hash);
+    }
+  }
+
+  /**
+   * Continuation of remove(), called only when sync lock is
+   * held and interference has been detected.
+   **/
+  protected Object sremove(Object key, int hash) {
+    Entry[] tab = table;
+    int index = hash & (tab.length-1);
+    Entry first = tab[index];
+      
+    for (Entry e = first; e != null; e = e.next) {
+      if (e.hash == hash && eq(key, e.key)) {
+        Object oldValue = e.value;
+        e.value = null;
+        count--;
+        Entry head = e.next;
+        for (Entry p = first; p != e; p = p.next) 
+          head = new Entry(p.hash, p.key, p.value, head);
+        
+        tab[index] = head;
+        recordModification(head);
+        return oldValue;
+      }
+    }
+    return null;
+  }
+
+
+  /**
+   * Returns <tt>true</tt> if this map maps one or more keys to the
+   * specified value. Note: This method requires a full internal
+   * traversal of the hash table, and so is much slower than
+   * method <tt>containsKey</tt>.
+   *
+   * @param value value whose presence in this map is to be tested.
+   * @return <tt>true</tt> if this map maps one or more keys to the
+   * specified value.  
+   * @exception  NullPointerException  if the value is <code>null</code>.
+   */
+  public boolean containsValue(Object value) {
+    if (value == null) throw new NullPointerException();
+
+    Entry tab[] = getTableForReading();
+    
+    for (int i = 0 ; i < tab.length; ++i) {
+      for (Entry e = tab[i] ; e != null ; e = e.next) 
+        if (value.equals(e.value))
+          return true;
+    }
+
+    return false;
+  }
+
+  /**
+   * Tests if some key maps into the specified value in this table.
+   * This operation is more expensive than the <code>containsKey</code>
+   * method.<p>
+   *
+   * Note that this method is identical in functionality to containsValue,
+   * (which is part of the Map interface in the collections framework).
+   * 
+   * @param      value   a value to search for.
+   * @return     <code>true</code> if and only if some key maps to the
+   *             <code>value</code> argument in this table as 
+   *             determined by the <tt>equals</tt> method;
+   *             <code>false</code> otherwise.
+   * @exception  NullPointerException  if the value is <code>null</code>.
+   * @see        #containsKey(Object)
+   * @see        #containsValue(Object)
+   * @see      Map
+   */
+  public boolean contains(Object value) {
+    return containsValue(value);
+  }
+
+
+  /**
+   * Copies all of the mappings from the specified map to this one.
+   * 
+   * These mappings replace any mappings that this map had for any of the
+   * keys currently in the specified Map.
+   *
+   * @param t Mappings to be stored in this map.
+   */
+  public synchronized void putAll(Map t) {
+    int n = t.size();
+    if (n == 0)
+      return;
+
+    // Expand enough to hold at least n elements without resizing.
+    // We can only resize table by factor of two at a time.
+    // It is faster to rehash with fewer elements, so do it now.
+    while (n >= threshold)
+      rehash();
+
+    for (Iterator it = t.entrySet().iterator(); it.hasNext();) {
+      Map.Entry entry = (Map.Entry) it.next();
+      Object key = entry.getKey();
+      Object value = entry.getValue();
+      put(key, value);
+    }
+  }
+
+
+  /**
+   * Removes all mappings from this map.
+   */
+  public synchronized void clear() {
+    Entry tab[] = table;
+    for (int i = 0; i < tab.length ; ++i) { 
+
+      // must invalidate all to force concurrent get's to wait and then retry
+      for (Entry e = tab[i]; e != null; e = e.next) 
+        e.value = null; 
+
+      tab[i] = null;
+    }
+    count = 0;
+    recordModification(tab);
+  }
+
+  /**
+   * Returns a shallow copy of this 
+   * <tt>ConcurrentReaderHashMap</tt> instance: the keys and
+   * values themselves are not cloned.
+   *
+   * @return a shallow copy of this map.
+   */
+  public synchronized Object clone() {
+    try { 
+      ConcurrentReaderHashMap t = (ConcurrentReaderHashMap)super.clone();
+
+      t.keySet = null;
+      t.entrySet = null;
+      t.values = null;
+
+      Entry[] tab = table;
+      t.table = new Entry[tab.length];
+      Entry[] ttab = t.table;
+
+      for (int i = 0; i < tab.length; ++i) {
+        Entry first = null;
+        for (Entry e = tab[i]; e != null; e = e.next) 
+          first = new Entry(e.hash, e.key, e.value, first);
+        ttab[i] = first;
+      }
+
+      return t;
+    } 
+    catch (CloneNotSupportedException e) { 
+      // this shouldn't happen, since we are Cloneable
+      throw new InternalError();
+    }
+  }
+
+  // Views
+
+  protected transient Set keySet = null;
+  protected transient Set entrySet = null;
+  protected transient Collection values = null;
+
+  /**
+   * Returns a set view of the keys contained in this map.  The set is
+   * backed by the map, so changes to the map are reflected in the set, and
+   * vice-versa.  The set supports element removal, which removes the
+   * corresponding mapping from this map, via the <tt>Iterator.remove</tt>,
+   * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt>, and
+   * <tt>clear</tt> operations.  It does not support the <tt>add</tt> or
+   * <tt>addAll</tt> operations.
+   *
+   * @return a set view of the keys contained in this map.
+   */
+  public Set keySet() {
+    Set ks = keySet;
+    return (ks != null)? ks : (keySet = new KeySet());
+  }
+  
+  private class KeySet extends AbstractSet {
+    public Iterator iterator() {
+      return new KeyIterator();
+    }
+    public int size() {
+      return ConcurrentReaderHashMap.this.size();
+    }
+    public boolean contains(Object o) {
+      return ConcurrentReaderHashMap.this.containsKey(o);
+    }
+    public boolean remove(Object o) {
+      return ConcurrentReaderHashMap.this.remove(o) != null;
+    }
+    public void clear() {
+      ConcurrentReaderHashMap.this.clear();
+    }
+    public Object[] toArray() {
+      Collection c = new ArrayList();
+      for (Iterator i = iterator(); i.hasNext(); )
+          c.add(i.next());
+      return c.toArray();
+    }
+    public Object[] toArray(Object[] a) {
+      Collection c = new ArrayList();
+      for (Iterator i = iterator(); i.hasNext(); )
+          c.add(i.next());
+      return c.toArray(a);
+    }
+  }
+
+  /**
+   * Returns a collection view of the values contained in this map.  The
+   * collection is backed by the map, so changes to the map are reflected in
+   * the collection, and vice-versa.  The collection supports element
+   * removal, which removes the corresponding mapping from this map, via the
+   * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>,
+   * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> operations.
+   * It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
+   *
+   * @return a collection view of the values contained in this map.
+   */
+  public Collection values() {
+    Collection vs = values;
+    return (vs != null)? vs : (values = new Values());
+  }
+  
+  private class Values extends AbstractCollection {
+    public Iterator iterator() {
+      return new ValueIterator();
+    }
+    public int size() {
+      return ConcurrentReaderHashMap.this.size();
+    }
+    public boolean contains(Object o) {
+      return ConcurrentReaderHashMap.this.containsValue(o);
+    }
+    public void clear() {
+      ConcurrentReaderHashMap.this.clear();
+    }
+    public Object[] toArray() {
+      Collection c = new ArrayList();
+      for (Iterator i = iterator(); i.hasNext(); )
+          c.add(i.next());
+      return c.toArray();
+    }
+    public Object[] toArray(Object[] a) {
+      Collection c = new ArrayList();
+      for (Iterator i = iterator(); i.hasNext(); )
+          c.add(i.next());
+      return c.toArray(a);
+    }
+  }
+
+  /**
+   * Returns a collection view of the mappings contained in this map.  Each
+   * element in the returned collection is a <tt>Map.Entry</tt>.  The
+   * collection is backed by the map, so changes to the map are reflected in
+   * the collection, and vice-versa.  The collection supports element
+   * removal, which removes the corresponding mapping from the map, via the
+   * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>,
+   * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> operations.
+   * It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
+   *
+   * @return a collection view of the mappings contained in this map.
+   */
+  public Set entrySet() {
+    Set es = entrySet;
+    return (es != null) ? es : (entrySet = new EntrySet());
+  }
+
+  private class EntrySet extends AbstractSet {
+    public Iterator iterator() {
+      return new HashIterator();
+    }
+    public boolean contains(Object o) {
+      if (!(o instanceof Map.Entry))
+        return false;
+      Map.Entry entry = (Map.Entry)o;
+      Object v = ConcurrentReaderHashMap.this.get(entry.getKey());
+      return v != null && v.equals(entry.getValue());
+    }
+    public boolean remove(Object o) {
+      if (!(o instanceof Map.Entry))
+        return false;
+      return ConcurrentReaderHashMap.this.findAndRemoveEntry((Map.Entry)o);
+    }
+    public int size() {
+      return ConcurrentReaderHashMap.this.size();
+    }
+    public void clear() {
+      ConcurrentReaderHashMap.this.clear();
+    }
+    public Object[] toArray() {
+      Collection c = new ArrayList();
+      for (Iterator i = iterator(); i.hasNext(); )
+          c.add(i.next());
+      return c.toArray();
+    }
+    public Object[] toArray(Object[] a) {
+      Collection c = new ArrayList();
+      for (Iterator i = iterator(); i.hasNext(); )
+          c.add(i.next());
+      return c.toArray(a);
+    }
+  }
+
+  /**
+   * Helper method for entrySet.remove
+   **/
+  protected synchronized boolean findAndRemoveEntry(Map.Entry entry) {
+    Object key = entry.getKey();
+    Object v = get(key);
+    if (v != null && v.equals(entry.getValue())) {
+      remove(key);
+      return true;
+    }
+    else
+      return false;
+  }
+
+  /**
+   * Returns an enumeration of the keys in this table.
+   *
+   * @return  an enumeration of the keys in this table.
+   * @see     Enumeration
+   * @see     #elements()
+   * @see   #keySet()
+   * @see   Map
+   */
+  public Enumeration keys() {
+    return new KeyIterator();
+  }
+
+  /**
+   * Returns an enumeration of the values in this table.
+   * Use the Enumeration methods on the returned object to fetch the elements
+   * sequentially.
+   *
+   * @return  an enumeration of the values in this table.
+   * @see     java.util.Enumeration
+   * @see     #keys()
+   * @see   #values()
+   * @see   Map
+   */
+  public Enumeration elements() {
+    return new ValueIterator();
+  }
+
+
+  /**
+   * ConcurrentReaderHashMap collision list entry.
+   */
+  protected static class Entry implements Map.Entry {
+
+    /* 
+       The use of volatile for value field ensures that
+       we can detect status changes without synchronization.
+       The other fields are never changed, and are
+       marked as final. 
+    */
+    protected final int hash;
+    protected final Object key;
+    protected final Entry next;
+    protected volatile Object value;
+
+    Entry(int hash, Object key, Object value, Entry next) {
+      this.hash = hash;
+      this.key = key;
+      this.next = next;
+      this.value = value;
+    }
+
+    // Map.Entry Ops 
+
+    public Object getKey() {
+      return key;
+    }
+
+    /**
+     * Get the value.  Note: In an entrySet or entrySet.iterator,
+     * unless the set or iterator is used under synchronization of the
+     * table as a whole (or you can otherwise guarantee lack of
+     * concurrent modification), <tt>getValue</tt> <em>might</em>
+     * return null, reflecting the fact that the entry has been
+     * concurrently removed. However, there are no assurances that
+     * concurrent removals will be reflected using this method.
+     * 
+     * @return     the current value, or null if the entry has been 
+     * detectably removed.
+     **/
+    public Object getValue() {
+      return value; 
+    }
+
+    /**
+     * Set the value of this entry.  Note: In an entrySet or
+     * entrySet.iterator), unless the set or iterator is used under
+     * synchronization of the table as a whole (or you can otherwise
+     * guarantee lack of concurrent modification), <tt>setValue</tt>
+     * is not strictly guaranteed to actually replace the value field
+     * obtained via the <tt>get</tt> operation of the underlying hash
+     * table in multi-threaded applications.  If iterator-wide
+     * synchronization is not used, and any other concurrent
+     * <tt>put</tt> or <tt>remove</tt> operations occur, sometimes
+     * even to <em>other</em> entries, then this change is not
+     * guaranteed to be reflected in the hash table. (It might, or it
+     * might not. There are no assurances either way.)
+     *
+     * @param      value   the new value.
+     * @return     the previous value, or null if entry has been detectably
+     * removed.
+     * @exception  NullPointerException  if the value is <code>null</code>.
+     * 
+     **/
+    public Object setValue(Object value) {
+      if (value == null)
+        throw new NullPointerException();
+      Object oldValue = this.value;
+      this.value = value;
+      return oldValue;
+    }
+
+    public boolean equals(Object o) {
+      if (!(o instanceof Map.Entry))
+        return false;
+      Map.Entry e = (Map.Entry)o;
+      return (key.equals(e.getKey()) && value.equals(e.getValue()));
+    }
+    
+    public int hashCode() {
+      return  key.hashCode() ^ value.hashCode();
+    }
+    
+    public String toString() {
+      return key + "=" + value;
+    }
+
+  }
+
+  protected class HashIterator implements Iterator, Enumeration {
+    protected final Entry[] tab;           // snapshot of table
+    protected int index;                   // current slot 
+    protected Entry entry = null;          // current node of slot
+    protected Object currentKey;           // key for current node
+    protected Object currentValue;         // value for current node
+    protected Entry lastReturned = null;   // last node returned by next
+
+    protected HashIterator() {
+      tab = ConcurrentReaderHashMap.this.getTableForReading();
+      index = tab.length - 1;
+    }
+
+    public boolean hasMoreElements() { return hasNext(); }
+    public Object nextElement() { return next(); }
+
+
+    public boolean hasNext() {
+
+      /*
+        currentKey and currentValue are set here to ensure that next()
+        returns normally if hasNext() returns true. This avoids
+        surprises especially when final element is removed during
+        traversal -- instead, we just ignore the removal during
+        current traversal.  
+      */
+
+      for (;;) {
+        if (entry != null) {
+          Object v = entry.value;
+          if (v != null) {
+            currentKey = entry.key;
+            currentValue = v;
+            return true;
+          }
+          else
+            entry = entry.next;
+        }
+
+        while (entry == null && index >= 0)
+          entry = tab[index--];
+
+        if (entry == null) {
+          currentKey = currentValue = null;
+          return false;
+        }
+      }
+    }
+
+    protected Object returnValueOfNext() { return entry; }
+
+    public Object next() {
+      if (currentKey == null && !hasNext())
+        throw new NoSuchElementException();
+
+      Object result = returnValueOfNext();
+      lastReturned = entry;
+      currentKey = currentValue = null;
+      entry = entry.next;
+      return result;
+    }
+
+    public void remove() {
+      if (lastReturned == null)
+        throw new IllegalStateException();
+      ConcurrentReaderHashMap.this.remove(lastReturned.key);
+      lastReturned = null;
+    }
+
+  }
+
+
+  protected class KeyIterator extends HashIterator {
+    protected Object returnValueOfNext() { return currentKey; }
+  }
+  
+  protected class ValueIterator extends HashIterator {
+    protected Object returnValueOfNext() { return currentValue; }
+  }
+  
+
+
+  /**
+   * Save the state of the <tt>ConcurrentReaderHashMap</tt> 
+   * instance to a stream (i.e.,
+   * serialize it).
+   *
+   * @param s the stream
+   * @serialData The <i>capacity</i> of the
+   * ConcurrentReaderHashMap (the length of the
+   * bucket array) is emitted (int), followed  by the
+   * <i>size</i> of the ConcurrentReaderHashMap (the number of key-value
+   * mappings), followed by the key (Object) and value (Object)
+   * for each key-value mapping represented by the ConcurrentReaderHashMap
+   * The key-value mappings are emitted in no particular order.
+   */
+  private synchronized void writeObject(java.io.ObjectOutputStream s)
+    throws IOException  {
+    // Write out the threshold, loadfactor, and any hidden stuff
+    s.defaultWriteObject();
+    
+    // Write out number of buckets
+    s.writeInt(table.length);
+    
+    // Write out size (number of Mappings)
+    s.writeInt(count);
+    
+    // Write out keys and values (alternating)
+    for (int index = table.length-1; index >= 0; index--) {
+      Entry entry = table[index];
+      
+      while (entry != null) {
+        s.writeObject(entry.key);
+        s.writeObject(entry.value);
+        entry = entry.next;
+      }
+    }
+  }
+
+  /**
+   * Reconstitute the <tt>ConcurrentReaderHashMap</tt> 
+   * instance from a stream (i.e.,
+   * deserialize it).
+   *
+   * @param s the stream
+   */
+  private synchronized void readObject(java.io.ObjectInputStream s)
+    throws IOException, ClassNotFoundException  {
+    // Read in the threshold, loadfactor, and any hidden stuff
+    s.defaultReadObject();
+
+    // Read in number of buckets and allocate the bucket array;
+    int numBuckets = s.readInt();
+    table = new Entry[numBuckets];
+    
+    // Read in size (number of Mappings)
+    int size = s.readInt();
+    
+    // Read the keys and values, and put the mappings in the table
+    for (int i=0; i<size; i++) {
+      Object key = s.readObject();
+      Object value = s.readObject();
+      put(key, value);
+    }
+  }
+  
+  /** 
+   * @return the number of slots in this table
+   **/
+  public synchronized int capacity() {
+    return table.length;
+  }
+
+  /** 
+   * @return the load factor
+   **/
+  public float loadFactor() {
+    return loadFactor;
+  }
+}
diff --git a/src/main/java/org/codehaus/groovy/runtime/metaclass/MethodSelectionException.java b/src/main/java/org/codehaus/groovy/runtime/metaclass/MethodSelectionException.java
index 06272ed..027e7ff 100644
--- a/src/main/java/org/codehaus/groovy/runtime/metaclass/MethodSelectionException.java
+++ b/src/main/java/org/codehaus/groovy/runtime/metaclass/MethodSelectionException.java
@@ -1,102 +1,102 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.runtime.metaclass;
-
-import groovy.lang.GroovyRuntimeException;
-import groovy.lang.MetaMethod;
-import org.codehaus.groovy.reflection.CachedConstructor;
-import org.codehaus.groovy.util.FastArray;
-
-import java.lang.reflect.Modifier;
-
-/**
- * This exception is thrown if the runtime is unable to select
- * a method. This class builds the exception text when calling 
- * getMessage.
- * <p>
- * <b>Note:</b> This exception as for internal use only!
- * 
- * @since Groovy 1.1
- */
-public class MethodSelectionException extends GroovyRuntimeException {
-
-    private static final long serialVersionUID = 8126246630023758333L;
-    private final String methodName;
-    private final FastArray methods;
-    private final Class[] arguments;
-    
-    /**
-     * Creates a new MethodSelectionException.
-     * @param methodName name of the method
-     * @param methods    a FastArray of methods
-     * @param arguments  the method call argument classes
-     */
-    public MethodSelectionException(String methodName, FastArray methods, Class[] arguments) {
-        super(methodName);
-        this.methodName = methodName;
-        this.arguments = arguments;
-        this.methods = methods;
-    }
-
-    public String getMessage() {
-        StringBuilder buffer = new StringBuilder();
-        buffer.append("Could not find which method ").append(methodName);
-        appendClassNames(buffer,arguments);
-        buffer.append(" to invoke from this list:");
-        appendMethods(buffer);
-        return buffer.toString();
-    }
-    
-    
-    private static void appendClassNames(StringBuilder argBuf, Class[] classes) {
-        argBuf.append("(");
-        for (int i = 0; i < classes.length; i++) {
-            if (i > 0) {
-                argBuf.append(", ");
-            }
-            Class clazz = classes[i];
-            String name = clazz==null? "null": clazz.getName();
-            argBuf.append(name);
-        }
-        argBuf.append(")");
-    }
-    
-    private void appendMethods(StringBuilder buffer) {
-        for (int i = 0; i < methods.size; i++) {
-            buffer.append("\n  ");
-            Object methodOrConstructor = methods.get(i);
-            if (methodOrConstructor instanceof MetaMethod) {
-                MetaMethod method = (MetaMethod) methodOrConstructor;
-                buffer.append(Modifier.toString(method.getModifiers()));
-                buffer.append(" ").append(method.getReturnType().getName());
-                buffer.append(" ").append(method.getDeclaringClass().getName());
-                buffer.append("#");
-                buffer.append(method.getName());
-                appendClassNames(buffer,method.getNativeParameterTypes());
-            }
-            else {
-                CachedConstructor method = (CachedConstructor) methodOrConstructor;
-                buffer.append(Modifier.toString(method.cachedConstructor.getModifiers()));
-                buffer.append(" ").append(method.cachedConstructor.getDeclaringClass().getName());
-                buffer.append("#<init>");
-                appendClassNames(buffer,method.getNativeParameterTypes());
-            }
-        }
-    }
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.runtime.metaclass;
+
+import groovy.lang.GroovyRuntimeException;
+import groovy.lang.MetaMethod;
+import org.codehaus.groovy.reflection.CachedConstructor;
+import org.codehaus.groovy.util.FastArray;
+
+import java.lang.reflect.Modifier;
+
+/**
+ * This exception is thrown if the runtime is unable to select
+ * a method. This class builds the exception text when calling 
+ * getMessage.
+ * <p>
+ * <b>Note:</b> This exception as for internal use only!
+ * 
+ * @since Groovy 1.1
+ */
+public class MethodSelectionException extends GroovyRuntimeException {
+
+    private static final long serialVersionUID = 8126246630023758333L;
+    private final String methodName;
+    private final FastArray methods;
+    private final Class[] arguments;
+    
+    /**
+     * Creates a new MethodSelectionException.
+     * @param methodName name of the method
+     * @param methods    a FastArray of methods
+     * @param arguments  the method call argument classes
+     */
+    public MethodSelectionException(String methodName, FastArray methods, Class[] arguments) {
+        super(methodName);
+        this.methodName = methodName;
+        this.arguments = arguments;
+        this.methods = methods;
+    }
+
+    public String getMessage() {
+        StringBuilder buffer = new StringBuilder();
+        buffer.append("Could not find which method ").append(methodName);
+        appendClassNames(buffer,arguments);
+        buffer.append(" to invoke from this list:");
+        appendMethods(buffer);
+        return buffer.toString();
+    }
+    
+    
+    private static void appendClassNames(StringBuilder argBuf, Class[] classes) {
+        argBuf.append("(");
+        for (int i = 0; i < classes.length; i++) {
+            if (i > 0) {
+                argBuf.append(", ");
+            }
+            Class clazz = classes[i];
+            String name = clazz==null? "null": clazz.getName();
+            argBuf.append(name);
+        }
+        argBuf.append(")");
+    }
+    
+    private void appendMethods(StringBuilder buffer) {
+        for (int i = 0; i < methods.size; i++) {
+            buffer.append("\n  ");
+            Object methodOrConstructor = methods.get(i);
+            if (methodOrConstructor instanceof MetaMethod) {
+                MetaMethod method = (MetaMethod) methodOrConstructor;
+                buffer.append(Modifier.toString(method.getModifiers()));
+                buffer.append(" ").append(method.getReturnType().getName());
+                buffer.append(" ").append(method.getDeclaringClass().getName());
+                buffer.append("#");
+                buffer.append(method.getName());
+                appendClassNames(buffer,method.getNativeParameterTypes());
+            }
+            else {
+                CachedConstructor method = (CachedConstructor) methodOrConstructor;
+                buffer.append(Modifier.toString(method.cachedConstructor.getModifiers()));
+                buffer.append(" ").append(method.cachedConstructor.getDeclaringClass().getName());
+                buffer.append("#<init>");
+                appendClassNames(buffer,method.getNativeParameterTypes());
+            }
+        }
+    }
 }
\ No newline at end of file
diff --git a/src/main/java/org/codehaus/groovy/runtime/typehandling/GroovyCastException.java b/src/main/java/org/codehaus/groovy/runtime/typehandling/GroovyCastException.java
index f9cace8..053353a 100644
--- a/src/main/java/org/codehaus/groovy/runtime/typehandling/GroovyCastException.java
+++ b/src/main/java/org/codehaus/groovy/runtime/typehandling/GroovyCastException.java
@@ -1,87 +1,87 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.runtime.typehandling;
-
-public class GroovyCastException extends ClassCastException {
-
-    private static final long serialVersionUID = 6859089155641797356L;
-
-    /**
-     * @param objectToCast object we tried to cast
-     * @param classToCastTo class we tried to cast to
-     * @param cause not kept but we pass on message from this Exception if any
-     */
-    public GroovyCastException(Object objectToCast, Class classToCastTo, Exception cause) {
-        super(makeMessage(objectToCast,classToCastTo) + " due to: " +
-                cause.getClass().getName() + (cause.getMessage() == null ? "" : ": " + cause.getMessage()));
-    }
-
-    /**
-     * @param objectToCast object we tried to cast
-     * @param classToCastTo class we tried to cast to
-     */
-    public GroovyCastException(Object objectToCast, Class classToCastTo) {
-        super(makeMessage(objectToCast,classToCastTo));
-    }
-
-    /**
-     * @param message custom Exception message
-     */
-    public GroovyCastException(String message) {
-        super(message);
-    }
-
-    private static String makeMessage(Object objectToCast, Class classToCastTo) {
-       String classToCastFrom;
-       Object msgObject = objectToCast;
-       if (objectToCast!=null) {
-           classToCastFrom = objectToCast.getClass().getName();
-       } else {
-           msgObject = "null";
-           classToCastFrom = "null";
-       }
-       String msg = 
-               "Cannot cast object '" + msgObject + "' " +
-               "with class '" + classToCastFrom + "' " +
-               "to class '" + classToCastTo.getName() + "'";
-
-       if (objectToCast==null){
-           msg += getWrapper(classToCastTo);
-       }
-
-       return msg;
-    }
-
-    private static String getWrapper(Class cls) {
-        Class ncls = cls;
-        if (cls==byte.class)        {ncls=Byte.class;}
-        else if (cls==short.class)  {ncls=Short.class;}
-        else if (cls==char.class)   {ncls=Character.class;}
-        else if (cls==int.class)    {ncls=Integer.class;}
-        else if (cls==long.class)   {ncls=Long.class;}
-        else if (cls==float.class)  {ncls=Float.class;}
-        else if (cls==double.class) {ncls=Double.class;}
-        if (cls!=null && ncls!=cls) {
-            String msg = ". Try '" + ncls.getName() + "' instead";
-            return msg;
-        }
-        return "";
-    }
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.runtime.typehandling;
+
+public class GroovyCastException extends ClassCastException {
+
+    private static final long serialVersionUID = 6859089155641797356L;
+
+    /**
+     * @param objectToCast object we tried to cast
+     * @param classToCastTo class we tried to cast to
+     * @param cause not kept but we pass on message from this Exception if any
+     */
+    public GroovyCastException(Object objectToCast, Class classToCastTo, Exception cause) {
+        super(makeMessage(objectToCast,classToCastTo) + " due to: " +
+                cause.getClass().getName() + (cause.getMessage() == null ? "" : ": " + cause.getMessage()));
+    }
+
+    /**
+     * @param objectToCast object we tried to cast
+     * @param classToCastTo class we tried to cast to
+     */
+    public GroovyCastException(Object objectToCast, Class classToCastTo) {
+        super(makeMessage(objectToCast,classToCastTo));
+    }
+
+    /**
+     * @param message custom Exception message
+     */
+    public GroovyCastException(String message) {
+        super(message);
+    }
+
+    private static String makeMessage(Object objectToCast, Class classToCastTo) {
+       String classToCastFrom;
+       Object msgObject = objectToCast;
+       if (objectToCast!=null) {
+           classToCastFrom = objectToCast.getClass().getName();
+       } else {
+           msgObject = "null";
+           classToCastFrom = "null";
+       }
+       String msg = 
+               "Cannot cast object '" + msgObject + "' " +
+               "with class '" + classToCastFrom + "' " +
+               "to class '" + classToCastTo.getName() + "'";
+
+       if (objectToCast==null){
+           msg += getWrapper(classToCastTo);
+       }
+
+       return msg;
+    }
+
+    private static String getWrapper(Class cls) {
+        Class ncls = cls;
+        if (cls==byte.class)        {ncls=Byte.class;}
+        else if (cls==short.class)  {ncls=Short.class;}
+        else if (cls==char.class)   {ncls=Character.class;}
+        else if (cls==int.class)    {ncls=Integer.class;}
+        else if (cls==long.class)   {ncls=Long.class;}
+        else if (cls==float.class)  {ncls=Float.class;}
+        else if (cls==double.class) {ncls=Double.class;}
+        if (cls!=null && ncls!=cls) {
+            String msg = ". Try '" + ncls.getName() + "' instead";
+            return msg;
+        }
+        return "";
+    }
+
+}
diff --git a/src/main/java/org/codehaus/groovy/runtime/typehandling/package.html b/src/main/java/org/codehaus/groovy/runtime/typehandling/package.html
index fab5318..a5f4506 100644
--- a/src/main/java/org/codehaus/groovy/runtime/typehandling/package.html
+++ b/src/main/java/org/codehaus/groovy/runtime/typehandling/package.html
@@ -1,30 +1,30 @@
-<!--
-
-     Licensed to the Apache Software Foundation (ASF) under one
-     or more contributor license agreements.  See the NOTICE file
-     distributed with this work for additional information
-     regarding copyright ownership.  The ASF licenses this file
-     to you under the Apache License, Version 2.0 (the
-     "License"); you may not use this file except in compliance
-     with the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing,
-     software distributed under the License is distributed on an
-     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-     KIND, either express or implied.  See the License for the
-     specific language governing permissions and limitations
-     under the License.
-
--->
-<html>
-  <head>
-    <title>package org.codehaus.groovy.runtime.typehandling*</title>
-  </head>
-  <body>
-    <p>Classes used to execute special actions based on the type. 
-    This includes mathematical operations and wrapper classes.
-    </p>
-  </body>
-</html>
+<!--
+
+     Licensed to the Apache Software Foundation (ASF) under one
+     or more contributor license agreements.  See the NOTICE file
+     distributed with this work for additional information
+     regarding copyright ownership.  The ASF licenses this file
+     to you under the Apache License, Version 2.0 (the
+     "License"); you may not use this file except in compliance
+     with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing,
+     software distributed under the License is distributed on an
+     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+     KIND, either express or implied.  See the License for the
+     specific language governing permissions and limitations
+     under the License.
+
+-->
+<html>
+  <head>
+    <title>package org.codehaus.groovy.runtime.typehandling*</title>
+  </head>
+  <body>
+    <p>Classes used to execute special actions based on the type. 
+    This includes mathematical operations and wrapper classes.
+    </p>
+  </body>
+</html>
diff --git a/src/main/java/org/codehaus/groovy/tools/StringHelper.java b/src/main/java/org/codehaus/groovy/tools/StringHelper.java
index 53b3b9e..c01388a 100644
--- a/src/main/java/org/codehaus/groovy/tools/StringHelper.java
+++ b/src/main/java/org/codehaus/groovy/tools/StringHelper.java
@@ -1,86 +1,86 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.tools;
-
-import java.util.LinkedList;
-import java.util.List;
-
-public class StringHelper {
-    private static final char
-        SPACE = ' ', SINGLE_QUOTE = '\'', DOUBLE_QUOTE = '"';
-    private static final String[] EMPTY_STRING_ARRAY = new String[0];
-
-    /**
-     * This method tokenizes a string by space characters, 
-     * but ignores spaces in quoted parts,that are parts in 
-     * '' or "". The method does allows the usage of "" in '' 
-     * and '' in "". The space character between tokens is not 
-     * returned. 
-     * 
-     * @param s the string to tokenize
-     * @return the tokens
-     */
-    public static String[] tokenizeUnquoted(String s) {
-        List tokens = new LinkedList();
-        int first = 0;
-        while (first < s.length()) {
-            first = skipWhitespace(s, first);
-            int last = scanToken(s, first);
-            if (first < last) {
-                tokens.add(s.substring(first, last));
-            }
-            first = last;
-        }
-        return (String[])tokens.toArray(EMPTY_STRING_ARRAY);
-    }
-
-    private static int scanToken(String s, int pos0) {
-        int pos = pos0;
-        while (pos < s.length()) {
-            char c = s.charAt(pos);
-            if (SPACE==c) break;
-            pos++;
-            if (SINGLE_QUOTE == c) {
-                pos = scanQuoted(s, pos, SINGLE_QUOTE);
-            } else if (DOUBLE_QUOTE == c) {
-                pos = scanQuoted(s, pos, DOUBLE_QUOTE);
-            }
-        }
-        return pos;
-    }
-
-    private static int scanQuoted(String s, int pos0, char quote) {
-        int pos = pos0;
-        while (pos < s.length()) {
-            char c = s.charAt(pos++);
-            if (quote == c) break;
-        }
-        return pos;
-    }
-
-    private static int skipWhitespace(String s, int pos0) {
-        int pos = pos0;
-        while (pos < s.length()) {
-            char c = s.charAt(pos);
-            if (SPACE!=c) break;
-            pos++;
-        }
-        return pos;
-    } 
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.tools;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class StringHelper {
+    private static final char
+        SPACE = ' ', SINGLE_QUOTE = '\'', DOUBLE_QUOTE = '"';
+    private static final String[] EMPTY_STRING_ARRAY = new String[0];
+
+    /**
+     * This method tokenizes a string by space characters, 
+     * but ignores spaces in quoted parts,that are parts in 
+     * '' or "". The method does allows the usage of "" in '' 
+     * and '' in "". The space character between tokens is not 
+     * returned. 
+     * 
+     * @param s the string to tokenize
+     * @return the tokens
+     */
+    public static String[] tokenizeUnquoted(String s) {
+        List tokens = new LinkedList();
+        int first = 0;
+        while (first < s.length()) {
+            first = skipWhitespace(s, first);
+            int last = scanToken(s, first);
+            if (first < last) {
+                tokens.add(s.substring(first, last));
+            }
+            first = last;
+        }
+        return (String[])tokens.toArray(EMPTY_STRING_ARRAY);
+    }
+
+    private static int scanToken(String s, int pos0) {
+        int pos = pos0;
+        while (pos < s.length()) {
+            char c = s.charAt(pos);
+            if (SPACE==c) break;
+            pos++;
+            if (SINGLE_QUOTE == c) {
+                pos = scanQuoted(s, pos, SINGLE_QUOTE);
+            } else if (DOUBLE_QUOTE == c) {
+                pos = scanQuoted(s, pos, DOUBLE_QUOTE);
+            }
+        }
+        return pos;
+    }
+
+    private static int scanQuoted(String s, int pos0, char quote) {
+        int pos = pos0;
+        while (pos < s.length()) {
+            char c = s.charAt(pos++);
+            if (quote == c) break;
+        }
+        return pos;
+    }
+
+    private static int skipWhitespace(String s, int pos0) {
+        int pos = pos0;
+        while (pos < s.length()) {
+            char c = s.charAt(pos);
+            if (SPACE!=c) break;
+            pos++;
+        }
+        return pos;
+    } 
+}
diff --git a/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformUtil.java b/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformUtil.java
index de50cb5..35bf848 100644
--- a/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformUtil.java
+++ b/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformUtil.java
@@ -1,184 +1,184 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.transform;
-
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.PropertyNode;
-import org.codehaus.groovy.ast.expr.BooleanExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.stmt.ExpressionStatement;
-import org.codehaus.groovy.ast.stmt.IfStatement;
-import org.codehaus.groovy.ast.stmt.Statement;
-import org.codehaus.groovy.ast.tools.GeneralUtils;
-import org.objectweb.asm.Opcodes;
-
-import java.util.List;
-
-/**
- * @deprecated use org.codehaus.groovy.ast.tools.GeneralUtils
- */
-@Deprecated
-public abstract class AbstractASTTransformUtil implements Opcodes {
-    @Deprecated
-    public static Statement assignStatement(Expression target, Expression value) {
-        return GeneralUtils.assignS(target, value);
-    }
-
-    @Deprecated
-    public static Statement createConstructorStatementDefault(FieldNode fNode) {
-        return GeneralUtils.createConstructorStatementDefault(fNode);
-    }
-
-    @Deprecated
-    public static ExpressionStatement declStatement(Expression result, Expression init) {
-        return (ExpressionStatement) GeneralUtils.declS(result, init);
-    }
-
-    @Deprecated
-    public static BooleanExpression differentExpr(Expression self, Expression other) {
-        return GeneralUtils.notX(GeneralUtils.sameX(self, other));
-    }
-
-    @Deprecated
-    public static BooleanExpression differentFieldExpr(FieldNode fNode, Expression other) {
-        return GeneralUtils.notX(GeneralUtils.hasSameFieldX(fNode, other));
-    }
-
-    @Deprecated
-    public static BooleanExpression differentPropertyExpr(PropertyNode pNode, Expression other) {
-        return GeneralUtils.notX(GeneralUtils.hasSamePropertyX(pNode, other));
-    }
-
-    @Deprecated
-    public static BooleanExpression equalsNullExpr(Expression argExpr) {
-        return GeneralUtils.equalsNullX(argExpr);
-    }
-
-    @Deprecated
-    public static Expression findArg(String argName) {
-        return GeneralUtils.findArg(argName);
-    }
-
-    @Deprecated
-    public static List<FieldNode> getInstanceNonPropertyFields(ClassNode cNode) {
-        return GeneralUtils.getInstanceNonPropertyFields(cNode);
-    }
-
-    @Deprecated
-    public static List<PropertyNode> getInstanceProperties(ClassNode cNode) {
-        return GeneralUtils.getInstanceProperties(cNode);
-    }
-
-    @Deprecated
-    public static List<FieldNode> getInstancePropertyFields(ClassNode cNode) {
-        return GeneralUtils.getInstancePropertyFields(cNode);
-    }
-
-    @Deprecated
-    public static List<FieldNode> getSuperNonPropertyFields(ClassNode cNode) {
-        return GeneralUtils.getSuperNonPropertyFields(cNode);
-    }
-
-    @Deprecated
-    public static List<FieldNode> getSuperPropertyFields(ClassNode cNode) {
-        return GeneralUtils.getSuperPropertyFields(cNode);
-    }
-
-    @Deprecated
-    public static boolean hasDeclaredMethod(ClassNode cNode, String name, int argsCount) {
-        return GeneralUtils.hasDeclaredMethod(cNode, name, argsCount);
-    }
-
-    @Deprecated
-    public static BooleanExpression identicalExpr(Expression self, Expression other) {
-        return GeneralUtils.sameX(self, other);
-    }
-
-    @Deprecated
-    public static BooleanExpression isInstanceOf(Expression objectExpression, ClassNode cNode) {
-        return GeneralUtils.isInstanceOfX(objectExpression, cNode);
-    }
-
-    @Deprecated
-    public static BooleanExpression isInstanceof(ClassNode cNode, Expression other) {
-        return GeneralUtils.isInstanceOfX(other, cNode);
-    }
-
-    @Deprecated
-    public static BooleanExpression isOneExpr(Expression expr) {
-        return GeneralUtils.isOneX(expr);
-    }
-
-    @Deprecated
-    public static boolean isOrImplements(ClassNode fieldType, ClassNode interfaceType) {
-        return GeneralUtils.isOrImplements(fieldType, interfaceType);
-    }
-
-    @Deprecated
-    public static BooleanExpression isTrueExpr(Expression argExpr) {
-        return GeneralUtils.isTrueX(argExpr);
-    }
-
-    @Deprecated
-    public static BooleanExpression isZeroExpr(Expression expr) {
-        return GeneralUtils.isZeroX(expr);
-    }
-
-    @Deprecated
-    public static BooleanExpression notNullExpr(Expression argExpr) {
-        return GeneralUtils.notNullX(argExpr);
-    }
-
-    @Deprecated
-    public static Statement returnFalseIfFieldNotEqual(FieldNode fNode, Expression other) {
-        return GeneralUtils.ifS(GeneralUtils.notX(GeneralUtils.hasEqualFieldX(fNode, other)), GeneralUtils.returnS(GeneralUtils.constX(Boolean.FALSE)));
-    }
-
-    @Deprecated
-    public static Statement returnFalseIfNotInstanceof(ClassNode cNode, Expression other) {
-        return GeneralUtils.ifS(GeneralUtils.notX(GeneralUtils.isInstanceOfX(other, cNode)), GeneralUtils.returnS(GeneralUtils.constX(Boolean.FALSE)));
-    }
-
-    @Deprecated
-    public static IfStatement returnFalseIfNull(Expression other) {
-        return (IfStatement) GeneralUtils.ifS(GeneralUtils.equalsNullX(other), GeneralUtils.returnS(GeneralUtils.constX(Boolean.FALSE)));
-    }
-
-    @Deprecated
-    public static Statement returnFalseIfPropertyNotEqual(PropertyNode pNode, Expression other) {
-        return GeneralUtils.ifS(GeneralUtils.notX(GeneralUtils.hasEqualPropertyX(pNode, other)), GeneralUtils.returnS(GeneralUtils.constX(Boolean.FALSE)));
-    }
-
-    @Deprecated
-    public static Statement returnFalseIfWrongType(ClassNode cNode, Expression other) {
-        return GeneralUtils.ifS(GeneralUtils.notX(GeneralUtils.hasClassX(other, cNode)), GeneralUtils.returnS(GeneralUtils.constX(Boolean.FALSE)));
-    }
-
-    @Deprecated
-    public static IfStatement returnTrueIfIdentical(Expression self, Expression other) {
-        return (IfStatement) GeneralUtils.ifS(GeneralUtils.sameX(self, other), GeneralUtils.returnS(GeneralUtils.constX(Boolean.TRUE)));
-    }
-
-    @Deprecated
-    public static Statement safeExpression(Expression fieldExpr, Expression expression) {
-        return GeneralUtils.safeExpression(fieldExpr, expression);
-    }
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.transform;
+
+import org.codehaus.groovy.ast.ClassNode;
+import org.codehaus.groovy.ast.FieldNode;
+import org.codehaus.groovy.ast.PropertyNode;
+import org.codehaus.groovy.ast.expr.BooleanExpression;
+import org.codehaus.groovy.ast.expr.Expression;
+import org.codehaus.groovy.ast.stmt.ExpressionStatement;
+import org.codehaus.groovy.ast.stmt.IfStatement;
+import org.codehaus.groovy.ast.stmt.Statement;
+import org.codehaus.groovy.ast.tools.GeneralUtils;
+import org.objectweb.asm.Opcodes;
+
+import java.util.List;
+
+/**
+ * @deprecated use org.codehaus.groovy.ast.tools.GeneralUtils
+ */
+@Deprecated
+public abstract class AbstractASTTransformUtil implements Opcodes {
+    @Deprecated
+    public static Statement assignStatement(Expression target, Expression value) {
+        return GeneralUtils.assignS(target, value);
+    }
+
+    @Deprecated
+    public static Statement createConstructorStatementDefault(FieldNode fNode) {
+        return GeneralUtils.createConstructorStatementDefault(fNode);
+    }
+
+    @Deprecated
+    public static ExpressionStatement declStatement(Expression result, Expression init) {
+        return (ExpressionStatement) GeneralUtils.declS(result, init);
+    }
+
+    @Deprecated
+    public static BooleanExpression differentExpr(Expression self, Expression other) {
+        return GeneralUtils.notX(GeneralUtils.sameX(self, other));
+    }
+
+    @Deprecated
+    public static BooleanExpression differentFieldExpr(FieldNode fNode, Expression other) {
+        return GeneralUtils.notX(GeneralUtils.hasSameFieldX(fNode, other));
+    }
+
+    @Deprecated
+    public static BooleanExpression differentPropertyExpr(PropertyNode pNode, Expression other) {
+        return GeneralUtils.notX(GeneralUtils.hasSamePropertyX(pNode, other));
+    }
+
+    @Deprecated
+    public static BooleanExpression equalsNullExpr(Expression argExpr) {
+        return GeneralUtils.equalsNullX(argExpr);
+    }
+
+    @Deprecated
+    public static Expression findArg(String argName) {
+        return GeneralUtils.findArg(argName);
+    }
+
+    @Deprecated
+    public static List<FieldNode> getInstanceNonPropertyFields(ClassNode cNode) {
+        return GeneralUtils.getInstanceNonPropertyFields(cNode);
+    }
+
+    @Deprecated
+    public static List<PropertyNode> getInstanceProperties(ClassNode cNode) {
+        return GeneralUtils.getInstanceProperties(cNode);
+    }
+
+    @Deprecated
+    public static List<FieldNode> getInstancePropertyFields(ClassNode cNode) {
+        return GeneralUtils.getInstancePropertyFields(cNode);
+    }
+
+    @Deprecated
+    public static List<FieldNode> getSuperNonPropertyFields(ClassNode cNode) {
+        return GeneralUtils.getSuperNonPropertyFields(cNode);
+    }
+
+    @Deprecated
+    public static List<FieldNode> getSuperPropertyFields(ClassNode cNode) {
+        return GeneralUtils.getSuperPropertyFields(cNode);
+    }
+
+    @Deprecated
+    public static boolean hasDeclaredMethod(ClassNode cNode, String name, int argsCount) {
+        return GeneralUtils.hasDeclaredMethod(cNode, name, argsCount);
+    }
+
+    @Deprecated
+    public static BooleanExpression identicalExpr(Expression self, Expression other) {
+        return GeneralUtils.sameX(self, other);
+    }
+
+    @Deprecated
+    public static BooleanExpression isInstanceOf(Expression objectExpression, ClassNode cNode) {
+        return GeneralUtils.isInstanceOfX(objectExpression, cNode);
+    }
+
+    @Deprecated
+    public static BooleanExpression isInstanceof(ClassNode cNode, Expression other) {
+        return GeneralUtils.isInstanceOfX(other, cNode);
+    }
+
+    @Deprecated
+    public static BooleanExpression isOneExpr(Expression expr) {
+        return GeneralUtils.isOneX(expr);
+    }
+
+    @Deprecated
+    public static boolean isOrImplements(ClassNode fieldType, ClassNode interfaceType) {
+        return GeneralUtils.isOrImplements(fieldType, interfaceType);
+    }
+
+    @Deprecated
+    public static BooleanExpression isTrueExpr(Expression argExpr) {
+        return GeneralUtils.isTrueX(argExpr);
+    }
+
+    @Deprecated
+    public static BooleanExpression isZeroExpr(Expression expr) {
+        return GeneralUtils.isZeroX(expr);
+    }
+
+    @Deprecated
+    public static BooleanExpression notNullExpr(Expression argExpr) {
+        return GeneralUtils.notNullX(argExpr);
+    }
+
+    @Deprecated
+    public static Statement returnFalseIfFieldNotEqual(FieldNode fNode, Expression other) {
+        return GeneralUtils.ifS(GeneralUtils.notX(GeneralUtils.hasEqualFieldX(fNode, other)), GeneralUtils.returnS(GeneralUtils.constX(Boolean.FALSE)));
+    }
+
+    @Deprecated
+    public static Statement returnFalseIfNotInstanceof(ClassNode cNode, Expression other) {
+        return GeneralUtils.ifS(GeneralUtils.notX(GeneralUtils.isInstanceOfX(other, cNode)), GeneralUtils.returnS(GeneralUtils.constX(Boolean.FALSE)));
+    }
+
+    @Deprecated
+    public static IfStatement returnFalseIfNull(Expression other) {
+        return (IfStatement) GeneralUtils.ifS(GeneralUtils.equalsNullX(other), GeneralUtils.returnS(GeneralUtils.constX(Boolean.FALSE)));
+    }
+
+    @Deprecated
+    public static Statement returnFalseIfPropertyNotEqual(PropertyNode pNode, Expression other) {
+        return GeneralUtils.ifS(GeneralUtils.notX(GeneralUtils.hasEqualPropertyX(pNode, other)), GeneralUtils.returnS(GeneralUtils.constX(Boolean.FALSE)));
+    }
+
+    @Deprecated
+    public static Statement returnFalseIfWrongType(ClassNode cNode, Expression other) {
+        return GeneralUtils.ifS(GeneralUtils.notX(GeneralUtils.hasClassX(other, cNode)), GeneralUtils.returnS(GeneralUtils.constX(Boolean.FALSE)));
+    }
+
+    @Deprecated
+    public static IfStatement returnTrueIfIdentical(Expression self, Expression other) {
+        return (IfStatement) GeneralUtils.ifS(GeneralUtils.sameX(self, other), GeneralUtils.returnS(GeneralUtils.constX(Boolean.TRUE)));
+    }
+
+    @Deprecated
+    public static Statement safeExpression(Expression fieldExpr, Expression expression) {
+        return GeneralUtils.safeExpression(fieldExpr, expression);
+    }
+
+}
diff --git a/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformation.java
index c13c8ef..4fc13d2 100644
--- a/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformation.java
@@ -1,494 +1,494 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.transform;
-
-import org.apache.groovy.ast.tools.AnnotatedNodeUtils;
-import org.apache.groovy.ast.tools.MethodNodeUtils;
-import org.codehaus.groovy.GroovyBugError;
-import org.codehaus.groovy.ast.ASTNode;
-import org.codehaus.groovy.ast.AnnotatedNode;
-import org.codehaus.groovy.ast.AnnotationNode;
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.MethodNode;
-import org.codehaus.groovy.ast.PropertyNode;
-import org.codehaus.groovy.ast.expr.ClassExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.ListExpression;
-import org.codehaus.groovy.ast.expr.VariableExpression;
-import org.codehaus.groovy.ast.tools.BeanUtils;
-import org.codehaus.groovy.ast.tools.GeneralUtils;
-import org.codehaus.groovy.ast.tools.GenericsUtils;
-import org.codehaus.groovy.control.SourceUnit;
-import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
-import org.codehaus.groovy.runtime.StringGroovyMethods;
-import org.codehaus.groovy.syntax.SyntaxException;
-import org.objectweb.asm.Opcodes;
-
-import java.lang.annotation.Retention;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import static groovy.transform.Undefined.isUndefined;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.getInstanceNonPropertyFieldNames;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.getSuperNonPropertyFields;
-
-public abstract class AbstractASTTransformation implements Opcodes, ASTTransformation, ErrorCollecting {
-    public static final ClassNode RETENTION_CLASSNODE = ClassHelper.makeWithoutCaching(Retention.class);
-
-    protected SourceUnit sourceUnit;
-
-    /**
-     * Copies all <tt>candidateAnnotations</tt> with retention policy {@link java.lang.annotation.RetentionPolicy#RUNTIME}
-     * and {@link java.lang.annotation.RetentionPolicy#CLASS}.
-     * <p>
-     * Annotations with {@link org.codehaus.groovy.runtime.GeneratedClosure} members are not supported for now.
-     */
-    protected List<AnnotationNode> copyAnnotatedNodeAnnotations(final AnnotatedNode annotatedNode, String myTypeName) {
-        final List<AnnotationNode> copiedAnnotations = new ArrayList<AnnotationNode>();
-        final List<AnnotationNode> notCopied = new ArrayList<AnnotationNode>();
-        GeneralUtils.copyAnnotatedNodeAnnotations(annotatedNode, copiedAnnotations, notCopied);
-        for (AnnotationNode annotation : notCopied) {
-            addError(myTypeName + " does not support keeping Closure annotation members.", annotation);
-        }
-        return copiedAnnotations;
-    }
-
-    /**
-     * If the transform is associated with a single annotation, returns a name suitable for displaying in error messages.
-     *
-     * @return The simple name of the annotation including the "@" or null if no such name is defined
-     */
-    public String getAnnotationName() {
-        return null;
-    }
-
-    protected void init(ASTNode[] nodes, SourceUnit sourceUnit) {
-        if (nodes == null || nodes.length != 2 || !(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) {
-            throw new GroovyBugError("Internal error: expecting [AnnotationNode, AnnotatedNode] but got: " + (nodes == null ? null : Arrays.asList(nodes)));
-        }
-        this.sourceUnit = sourceUnit;
-    }
-
-    public boolean memberHasValue(AnnotationNode node, String name, Object value) {
-        final Expression member = node.getMember(name);
-        return member instanceof ConstantExpression && ((ConstantExpression) member).getValue().equals(value);
-    }
-
-    public Object getMemberValue(AnnotationNode node, String name) {
-        final Expression member = node.getMember(name);
-        if (member instanceof ConstantExpression) return ((ConstantExpression) member).getValue();
-        return null;
-    }
-
-    public static String getMemberStringValue(AnnotationNode node, String name, String defaultValue) {
-        final Expression member = node.getMember(name);
-        if (member instanceof ConstantExpression) {
-            Object result = ((ConstantExpression) member).getValue();
-            if (result instanceof String && isUndefined((String) result)) result = null;
-            if (result != null) return result.toString();
-        }
-        return defaultValue;
-    }
-
-    public static String getMemberStringValue(AnnotationNode node, String name) {
-        return getMemberStringValue(node, name, null);
-    }
-
-    public int getMemberIntValue(AnnotationNode node, String name) {
-        Object value = getMemberValue(node, name);
-        if (value instanceof Integer) {
-            return (Integer) value;
-        }
-        return 0;
-    }
-
-    public ClassNode getMemberClassValue(AnnotationNode node, String name) {
-        return getMemberClassValue(node, name, null);
-    }
-
-    public ClassNode getMemberClassValue(AnnotationNode node, String name, ClassNode defaultValue) {
-        final Expression member = node.getMember(name);
-        if (member != null) {
-            if (member instanceof ClassExpression) {
-                if (!isUndefined(member.getType())) return member.getType();
-            } else if (member instanceof VariableExpression) {
-                addError("Error expecting to find class value for '" + name + "' but found variable: " + member.getText() + ". Missing import?", node);
-                return null;
-            } else if (member instanceof ConstantExpression) {
-                addError("Error expecting to find class value for '" + name + "' but found constant: " + member.getText() + "!", node);
-                return null;
-            }
-        }
-        return defaultValue;
-    }
-
-    public static List<String> getMemberStringList(AnnotationNode anno, String name) {
-        Expression expr = anno.getMember(name);
-        if (expr == null) {
-            return null;
-        }
-        if (expr instanceof ListExpression) {
-            final ListExpression listExpression = (ListExpression) expr;
-            if (isUndefinedMarkerList(listExpression)) {
-                return null;
-            }
-
-            return getValueStringList(listExpression);
-        }
-        return tokenize(getMemberStringValue(anno, name));
-    }
-
-    private static boolean isUndefinedMarkerList(ListExpression listExpression) {
-        if (listExpression.getExpressions().size() != 1) return false;
-        Expression itemExpr = listExpression.getExpression(0);
-        if (itemExpr == null) return false;
-        if (itemExpr instanceof ConstantExpression) {
-            Object value = ((ConstantExpression) itemExpr).getValue();
-            if (value instanceof String && isUndefined((String)value)) return true;
-        } else if (itemExpr instanceof ClassExpression && isUndefined(itemExpr.getType())) {
-            return true;
-        }
-        return false;
-    }
-
-    @Deprecated
-    public static List<String> getMemberList(AnnotationNode anno, String name) {
-        List<String> list;
-        Expression expr = anno.getMember(name);
-        if (expr instanceof ListExpression) {
-            final ListExpression listExpression = (ListExpression) expr;
-            list = getValueStringList(listExpression);
-        } else {
-            list = tokenize(getMemberStringValue(anno, name));
-        }
-        return list;
-    }
-
-    private static List<String> getValueStringList(ListExpression listExpression) {
-        List<String> list = new ArrayList<String>();
-        for (Expression itemExpr : listExpression.getExpressions()) {
-            if (itemExpr instanceof ConstantExpression) {
-                Object value = ((ConstantExpression) itemExpr).getValue();
-                if (value != null) list.add(value.toString());
-            }
-        }
-        return list;
-    }
-
-    @Deprecated
-    public List<ClassNode> getClassList(AnnotationNode anno, String name) {
-        List<ClassNode> list = new ArrayList<ClassNode>();
-        Expression expr = anno.getMember(name);
-        if (expr instanceof ListExpression) {
-            final ListExpression listExpression = (ListExpression) expr;
-            list = getTypeList(listExpression);
-        } else if (expr instanceof ClassExpression) {
-            ClassNode cn = expr.getType();
-            if (cn != null) list.add(cn);
-        }
-        return list;
-    }
-
-    public List<ClassNode> getMemberClassList(AnnotationNode anno, String name) {
-        List<ClassNode> list = new ArrayList<ClassNode>();
-        Expression expr = anno.getMember(name);
-        if (expr == null) {
-            return null;
-        }
-        if (expr instanceof ListExpression) {
-            final ListExpression listExpression = (ListExpression) expr;
-            if (isUndefinedMarkerList(listExpression)) {
-                return null;
-            }
-            list = getTypeList(listExpression);
-        } else if (expr instanceof ClassExpression) {
-            ClassNode cn = expr.getType();
-            if (isUndefined(cn)) return null;
-            if (cn != null) list.add(cn);
-        }
-        return list;
-    }
-
-    private static List<ClassNode> getTypeList(ListExpression listExpression) {
-        List<ClassNode> list = new ArrayList<ClassNode>();
-        for (Expression itemExpr : listExpression.getExpressions()) {
-            if (itemExpr instanceof ClassExpression) {
-                ClassNode cn = itemExpr.getType();
-                if (cn != null) list.add(cn);
-            }
-        }
-        return list;
-    }
-
-    public void addError(String msg, ASTNode expr) {
-        sourceUnit.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(
-                        new SyntaxException(msg + '\n', expr.getLineNumber(), expr.getColumnNumber(),
-                                expr.getLastLineNumber(), expr.getLastColumnNumber()),
-                        sourceUnit)
-        );
-    }
-
-    protected boolean checkNotInterface(ClassNode cNode, String annotationName) {
-        if (cNode.isInterface()) {
-            addError("Error processing interface '" + cNode.getName() + "'. " +
-                    annotationName + " not allowed for interfaces.", cNode);
-            return false;
-        }
-        return true;
-    }
-
-    public boolean hasAnnotation(ClassNode node, ClassNode annotation) {
-        return AnnotatedNodeUtils.hasAnnotation(node, annotation);
-    }
-
-    public static List<String> tokenize(String rawExcludes) {
-        return rawExcludes == null ? new ArrayList<String>() : StringGroovyMethods.tokenize(rawExcludes, ", ");
-    }
-
-    public static boolean deemedInternalName(String name) {
-        return name.contains("$");
-    }
-
-    public static boolean shouldSkipUndefinedAware(String name, List<String> excludes, List<String> includes) {
-        return shouldSkipUndefinedAware(name, excludes, includes, false);
-    }
-
-    public static boolean shouldSkipUndefinedAware(String name, List<String> excludes, List<String> includes, boolean allNames) {
-        return (excludes != null && excludes.contains(name)) ||
-            (!allNames && deemedInternalName(name)) ||
-            (includes != null && !includes.contains(name));
-    }
-
-    public static boolean shouldSkip(String name, List<String> excludes, List<String> includes) {
-        return shouldSkip(name, excludes, includes, false);
-    }
-
-    public static boolean shouldSkip(String name, List<String> excludes, List<String> includes, boolean allNames) {
-        return (excludes != null && excludes.contains(name)) ||
-            (!allNames && deemedInternalName(name)) ||
-            (includes != null && !includes.isEmpty() && !includes.contains(name));
-    }
-
-    @Deprecated
-    public static boolean shouldSkipOnDescriptor(boolean checkReturn, Map genericsSpec, MethodNode mNode, List<ClassNode> excludeTypes, List<ClassNode> includeTypes) {
-        String descriptor = mNode.getTypeDescriptor();
-        String descriptorNoReturn = MethodNodeUtils.methodDescriptorWithoutReturnType(mNode);
-        for (ClassNode cn : excludeTypes) {
-            List<ClassNode> remaining = new LinkedList<ClassNode>();
-            remaining.add(cn);
-            Map updatedGenericsSpec = new HashMap(genericsSpec);
-            while (!remaining.isEmpty()) {
-                ClassNode next = remaining.remove(0);
-                if (!next.equals(ClassHelper.OBJECT_TYPE)) {
-                    updatedGenericsSpec = GenericsUtils.createGenericsSpec(next, updatedGenericsSpec);
-                    for (MethodNode mn : next.getMethods()) {
-                        MethodNode correctedMethodNode = GenericsUtils.correctToGenericsSpec(updatedGenericsSpec, mn);
-                        if (checkReturn) {
-                            String md = correctedMethodNode.getTypeDescriptor();
-                            if (md.equals(descriptor)) return true;
-                        } else {
-                            String md = MethodNodeUtils.methodDescriptorWithoutReturnType(correctedMethodNode);
-                            if (md.equals(descriptorNoReturn)) return true;
-                        }
-                    }
-                    remaining.addAll(Arrays.asList(next.getInterfaces()));
-                }
-            }
-        }
-        if (includeTypes.isEmpty()) return false;
-        for (ClassNode cn : includeTypes) {
-            List<ClassNode> remaining = new LinkedList<ClassNode>();
-            remaining.add(cn);
-            Map updatedGenericsSpec = new HashMap(genericsSpec);
-            while (!remaining.isEmpty()) {
-                ClassNode next = remaining.remove(0);
-                if (!next.equals(ClassHelper.OBJECT_TYPE)) {
-                    updatedGenericsSpec = GenericsUtils.createGenericsSpec(next, updatedGenericsSpec);
-                    for (MethodNode mn : next.getMethods()) {
-                        MethodNode correctedMethodNode = GenericsUtils.correctToGenericsSpec(updatedGenericsSpec, mn);
-                        if (checkReturn) {
-                            String md = correctedMethodNode.getTypeDescriptor();
-                            if (md.equals(descriptor)) return false;
-                        } else {
-                            String md = MethodNodeUtils.methodDescriptorWithoutReturnType(correctedMethodNode);
-                            if (md.equals(descriptorNoReturn)) return false;
-                        }
-                    }
-                    remaining.addAll(Arrays.asList(next.getInterfaces()));
-                }
-            }
-        }
-        return true;
-    }
-    public static boolean shouldSkipOnDescriptorUndefinedAware(boolean checkReturn, Map genericsSpec, MethodNode mNode,
-                                                  List<ClassNode> excludeTypes, List<ClassNode> includeTypes) {
-        String descriptor = mNode.getTypeDescriptor();
-        String descriptorNoReturn = MethodNodeUtils.methodDescriptorWithoutReturnType(mNode);
-        if (excludeTypes != null) {
-            for (ClassNode cn : excludeTypes) {
-                List<ClassNode> remaining = new LinkedList<ClassNode>();
-                remaining.add(cn);
-                Map updatedGenericsSpec = new HashMap(genericsSpec);
-                while (!remaining.isEmpty()) {
-                    ClassNode next = remaining.remove(0);
-                    if (!next.equals(ClassHelper.OBJECT_TYPE)) {
-                        updatedGenericsSpec = GenericsUtils.createGenericsSpec(next, updatedGenericsSpec);
-                        for (MethodNode mn : next.getMethods()) {
-                            MethodNode correctedMethodNode = GenericsUtils.correctToGenericsSpec(updatedGenericsSpec, mn);
-                            if (checkReturn) {
-                                String md = correctedMethodNode.getTypeDescriptor();
-                                if (md.equals(descriptor)) return true;
-                            } else {
-                                String md = MethodNodeUtils.methodDescriptorWithoutReturnType(correctedMethodNode);
-                                if (md.equals(descriptorNoReturn)) return true;
-                            }
-                        }
-                        remaining.addAll(Arrays.asList(next.getInterfaces()));
-                    }
-                }
-            }
-        }
-        if (includeTypes == null) return false;
-        for (ClassNode cn : includeTypes) {
-            List<ClassNode> remaining = new LinkedList<ClassNode>();
-            remaining.add(cn);
-            Map updatedGenericsSpec = new HashMap(genericsSpec);
-            while (!remaining.isEmpty()) {
-                ClassNode next = remaining.remove(0);
-                if (!next.equals(ClassHelper.OBJECT_TYPE)) {
-                    updatedGenericsSpec = GenericsUtils.createGenericsSpec(next, updatedGenericsSpec);
-                    for (MethodNode mn : next.getMethods()) {
-                        MethodNode correctedMethodNode = GenericsUtils.correctToGenericsSpec(updatedGenericsSpec, mn);
-                        if (checkReturn) {
-                            String md = correctedMethodNode.getTypeDescriptor();
-                            if (md.equals(descriptor)) return false;
-                        } else {
-                            String md = MethodNodeUtils.methodDescriptorWithoutReturnType(correctedMethodNode);
-                            if (md.equals(descriptorNoReturn)) return false;
-                        }
-                    }
-                    remaining.addAll(Arrays.asList(next.getInterfaces()));
-                }
-            }
-        }
-        return true;
-    }
-
-    @Deprecated
-    protected boolean checkIncludeExclude(AnnotationNode node, List<String> excludes, List<String> includes, String typeName) {
-        if (includes != null && !includes.isEmpty() && excludes != null && !excludes.isEmpty()) {
-            addError("Error during " + typeName + " processing: Only one of 'includes' and 'excludes' should be supplied not both.", node);
-            return false;
-        }
-        return true;
-    }
-
-    protected boolean checkIncludeExcludeUndefinedAware(AnnotationNode node, List<String> excludes, List<String> includes, String typeName) {
-        if (includes != null && excludes != null && !excludes.isEmpty()) {
-            addError("Error during " + typeName + " processing: Only one of 'includes' and 'excludes' should be supplied not both.", node);
-            return false;
-        }
-        return true;
-    }
-
-    @Deprecated
-    protected void checkIncludeExclude(AnnotationNode node, List<String> excludes, List<String> includes, List<ClassNode> excludeTypes, List<ClassNode> includeTypes, String typeName) {
-        int found = 0;
-        if (includes != null && !includes.isEmpty()) found++;
-        if (excludes != null && !excludes.isEmpty()) found++;
-        if (includeTypes != null && !includeTypes.isEmpty()) found++;
-        if (excludeTypes != null && !excludeTypes.isEmpty()) found++;
-        if (found > 1) {
-            addError("Error during " + typeName + " processing: Only one of 'includes', 'excludes', 'includeTypes' and 'excludeTypes' should be supplied.", node);
-        }
-    }
-
-    protected void checkIncludeExcludeUndefinedAware(AnnotationNode node, List<String> excludes, List<String> includes,
-                                        List<ClassNode> excludeTypes, List<ClassNode> includeTypes, String typeName) {
-        int found = 0;
-        if (includes != null) found++;
-        if (excludes != null && !excludes.isEmpty()) found++;
-        if (includeTypes != null) found++;
-        if (excludeTypes != null && !excludeTypes.isEmpty()) found++;
-        if (found > 1) {
-            addError("Error during " + typeName + " processing: Only one of 'includes', 'excludes', 'includeTypes' and 'excludeTypes' should be supplied.", node);
-        }
-    }
-
-    public boolean checkPropertyList(ClassNode cNode, List<String> propertyNameList, String listName, AnnotationNode anno, String typeName, boolean includeFields) {
-        return checkPropertyList(cNode, propertyNameList, listName, anno, typeName, includeFields, false, false);
-    }
-
-    public boolean checkPropertyList(ClassNode cNode, List<String> propertyNameList, String listName, AnnotationNode anno, String typeName, boolean includeFields, boolean includeSuperProperties, boolean allProperties) {
-        return checkPropertyList(cNode, propertyNameList, listName, anno, typeName, includeFields, includeSuperProperties, allProperties, false, false);
-    }
-
-    public boolean checkPropertyList(ClassNode cNode, List<String> propertyNameList, String listName, AnnotationNode anno, String typeName, boolean includeFields, boolean includeSuperProperties, boolean allProperties, boolean includeSuperFields, boolean includeStatic) {
-        if (propertyNameList == null || propertyNameList.isEmpty()) {
-            return true;
-        }
-        final List<String> pNames = new ArrayList<String>();
-        for (PropertyNode pNode : BeanUtils.getAllProperties(cNode, includeSuperProperties, includeStatic, allProperties)) {
-            pNames.add(pNode.getField().getName());
-        }
-        boolean result = true;
-        if (includeFields || includeSuperFields) {
-            final List<String> fNames = new ArrayList<String>();
-            if (includeFields) {
-                fNames.addAll(getInstanceNonPropertyFieldNames(cNode));
-            }
-            if (includeSuperFields) {
-                List<FieldNode> superNonPropertyFields = getSuperNonPropertyFields(cNode.getSuperClass());
-                for (FieldNode fn : superNonPropertyFields) {
-                    fNames.add(fn.getName());
-                }
-            }
-            for (String pName : propertyNameList) {
-                if (!pNames.contains(pName) && !fNames.contains(pName)) {
-                    addError("Error during " + typeName + " processing: '" + listName + "' property or field '" + pName + "' does not exist.", anno);
-                    result = false;
-                }
-            }
-        } else {
-            for (String pName : propertyNameList) {
-                if (!pNames.contains(pName)) {
-                    addError("Error during " + typeName + " processing: '" + listName + "' property '" + pName + "' does not exist.", anno);
-                    result = false;
-                }
-            }
-        }
-        return result;
-    }
-
-    /**
-     * @deprecated use GenericsUtils#nonGeneric
-     */
-    @Deprecated
-    public static ClassNode nonGeneric(ClassNode type) {
-        return GenericsUtils.nonGeneric(type);
-    }
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.transform;
+
+import org.apache.groovy.ast.tools.AnnotatedNodeUtils;
+import org.apache.groovy.ast.tools.MethodNodeUtils;
+import org.codehaus.groovy.GroovyBugError;
+import org.codehaus.groovy.ast.ASTNode;
+import org.codehaus.groovy.ast.AnnotatedNode;
+import org.codehaus.groovy.ast.AnnotationNode;
+import org.codehaus.groovy.ast.ClassHelper;
+import org.codehaus.groovy.ast.ClassNode;
+import org.codehaus.groovy.ast.FieldNode;
+import org.codehaus.groovy.ast.MethodNode;
+import org.codehaus.groovy.ast.PropertyNode;
+import org.codehaus.groovy.ast.expr.ClassExpression;
+import org.codehaus.groovy.ast.expr.ConstantExpression;
+import org.codehaus.groovy.ast.expr.Expression;
+import org.codehaus.groovy.ast.expr.ListExpression;
+import org.codehaus.groovy.ast.expr.VariableExpression;
+import org.codehaus.groovy.ast.tools.BeanUtils;
+import org.codehaus.groovy.ast.tools.GeneralUtils;
+import org.codehaus.groovy.ast.tools.GenericsUtils;
+import org.codehaus.groovy.control.SourceUnit;
+import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
+import org.codehaus.groovy.runtime.StringGroovyMethods;
+import org.codehaus.groovy.syntax.SyntaxException;
+import org.objectweb.asm.Opcodes;
+
+import java.lang.annotation.Retention;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import static groovy.transform.Undefined.isUndefined;
+import static org.codehaus.groovy.ast.tools.GeneralUtils.getInstanceNonPropertyFieldNames;
+import static org.codehaus.groovy.ast.tools.GeneralUtils.getSuperNonPropertyFields;
+
+public abstract class AbstractASTTransformation implements Opcodes, ASTTransformation, ErrorCollecting {
+    public static final ClassNode RETENTION_CLASSNODE = ClassHelper.makeWithoutCaching(Retention.class);
+
+    protected SourceUnit sourceUnit;
+
+    /**
+     * Copies all <tt>candidateAnnotations</tt> with retention policy {@link java.lang.annotation.RetentionPolicy#RUNTIME}
+     * and {@link java.lang.annotation.RetentionPolicy#CLASS}.
+     * <p>
+     * Annotations with {@link org.codehaus.groovy.runtime.GeneratedClosure} members are not supported for now.
+     */
+    protected List<AnnotationNode> copyAnnotatedNodeAnnotations(final AnnotatedNode annotatedNode, String myTypeName) {
+        final List<AnnotationNode> copiedAnnotations = new ArrayList<AnnotationNode>();
+        final List<AnnotationNode> notCopied = new ArrayList<AnnotationNode>();
+        GeneralUtils.copyAnnotatedNodeAnnotations(annotatedNode, copiedAnnotations, notCopied);
+        for (AnnotationNode annotation : notCopied) {
+            addError(myTypeName + " does not support keeping Closure annotation members.", annotation);
+        }
+        return copiedAnnotations;
+    }
+
+    /**
+     * If the transform is associated with a single annotation, returns a name suitable for displaying in error messages.
+     *
+     * @return The simple name of the annotation including the "@" or null if no such name is defined
+     */
+    public String getAnnotationName() {
+        return null;
+    }
+
+    protected void init(ASTNode[] nodes, SourceUnit sourceUnit) {
+        if (nodes == null || nodes.length != 2 || !(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) {
+            throw new GroovyBugError("Internal error: expecting [AnnotationNode, AnnotatedNode] but got: " + (nodes == null ? null : Arrays.asList(nodes)));
+        }
+        this.sourceUnit = sourceUnit;
+    }
+
+    public boolean memberHasValue(AnnotationNode node, String name, Object value) {
+        final Expression member = node.getMember(name);
+        return member instanceof ConstantExpression && ((ConstantExpression) member).getValue().equals(value);
+    }
+
+    public Object getMemberValue(AnnotationNode node, String name) {
+        final Expression member = node.getMember(name);
+        if (member instanceof ConstantExpression) return ((ConstantExpression) member).getValue();
+        return null;
+    }
+
+    public static String getMemberStringValue(AnnotationNode node, String name, String defaultValue) {
+        final Expression member = node.getMember(name);
+        if (member instanceof ConstantExpression) {
+            Object result = ((ConstantExpression) member).getValue();
+            if (result instanceof String && isUndefined((String) result)) result = null;
+            if (result != null) return result.toString();
+        }
+        return defaultValue;
+    }
+
+    public static String getMemberStringValue(AnnotationNode node, String name) {
+        return getMemberStringValue(node, name, null);
+    }
+
+    public int getMemberIntValue(AnnotationNode node, String name) {
+        Object value = getMemberValue(node, name);
+        if (value instanceof Integer) {
+            return (Integer) value;
+        }
+        return 0;
+    }
+
+    public ClassNode getMemberClassValue(AnnotationNode node, String name) {
+        return getMemberClassValue(node, name, null);
+    }
+
+    public ClassNode getMemberClassValue(AnnotationNode node, String name, ClassNode defaultValue) {
+        final Expression member = node.getMember(name);
+        if (member != null) {
+            if (member instanceof ClassExpression) {
+                if (!isUndefined(member.getType())) return member.getType();
+            } else if (member instanceof VariableExpression) {
+                addError("Error expecting to find class value for '" + name + "' but found variable: " + member.getText() + ". Missing import?", node);
+                return null;
+            } else if (member instanceof ConstantExpression) {
+                addError("Error expecting to find class value for '" + name + "' but found constant: " + member.getText() + "!", node);
+                return null;
+            }
+        }
+        return defaultValue;
+    }
+
+    public static List<String> getMemberStringList(AnnotationNode anno, String name) {
+        Expression expr = anno.getMember(name);
+        if (expr == null) {
+            return null;
+        }
+        if (expr instanceof ListExpression) {
+            final ListExpression listExpression = (ListExpression) expr;
+            if (isUndefinedMarkerList(listExpression)) {
+                return null;
+            }
+
+            return getValueStringList(listExpression);
+        }
+        return tokenize(getMemberStringValue(anno, name));
+    }
+
+    private static boolean isUndefinedMarkerList(ListExpression listExpression) {
+        if (listExpression.getExpressions().size() != 1) return false;
+        Expression itemExpr = listExpression.getExpression(0);
+        if (itemExpr == null) return false;
+        if (itemExpr instanceof ConstantExpression) {
+            Object value = ((ConstantExpression) itemExpr).getValue();
+            if (value instanceof String && isUndefined((String)value)) return true;
+        } else if (itemExpr instanceof ClassExpression && isUndefined(itemExpr.getType())) {
+            return true;
+        }
+        return false;
+    }
+
+    @Deprecated
+    public static List<String> getMemberList(AnnotationNode anno, String name) {
+        List<String> list;
+        Expression expr = anno.getMember(name);
+        if (expr instanceof ListExpression) {
+            final ListExpression listExpression = (ListExpression) expr;
+            list = getValueStringList(listExpression);
+        } else {
+            list = tokenize(getMemberStringValue(anno, name));
+        }
+        return list;
+    }
+
+    private static List<String> getValueStringList(ListExpression listExpression) {
+        List<String> list = new ArrayList<String>();
+        for (Expression itemExpr : listExpression.getExpressions()) {
+            if (itemExpr instanceof ConstantExpression) {
+                Object value = ((ConstantExpression) itemExpr).getValue();
+                if (value != null) list.add(value.toString());
+            }
+        }
+        return list;
+    }
+
+    @Deprecated
+    public List<ClassNode> getClassList(AnnotationNode anno, String name) {
+        List<ClassNode> list = new ArrayList<ClassNode>();
+        Expression expr = anno.getMember(name);
+        if (expr instanceof ListExpression) {
+            final ListExpression listExpression = (ListExpression) expr;
+            list = getTypeList(listExpression);
+        } else if (expr instanceof ClassExpression) {
+            ClassNode cn = expr.getType();
+            if (cn != null) list.add(cn);
+        }
+        return list;
+    }
+
+    public List<ClassNode> getMemberClassList(AnnotationNode anno, String name) {
+        List<ClassNode> list = new ArrayList<ClassNode>();
+        Expression expr = anno.getMember(name);
+        if (expr == null) {
+            return null;
+        }
+        if (expr instanceof ListExpression) {
+            final ListExpression listExpression = (ListExpression) expr;
+            if (isUndefinedMarkerList(listExpression)) {
+                return null;
+            }
+            list = getTypeList(listExpression);
+        } else if (expr instanceof ClassExpression) {
+            ClassNode cn = expr.getType();
+            if (isUndefined(cn)) return null;
+            if (cn != null) list.add(cn);
+        }
+        return list;
+    }
+
+    private static List<ClassNode> getTypeList(ListExpression listExpression) {
+        List<ClassNode> list = new ArrayList<ClassNode>();
+        for (Expression itemExpr : listExpression.getExpressions()) {
+            if (itemExpr instanceof ClassExpression) {
+                ClassNode cn = itemExpr.getType();
+                if (cn != null) list.add(cn);
+            }
+        }
+        return list;
+    }
+
+    public void addError(String msg, ASTNode expr) {
+        sourceUnit.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(
+                        new SyntaxException(msg + '\n', expr.getLineNumber(), expr.getColumnNumber(),
+                                expr.getLastLineNumber(), expr.getLastColumnNumber()),
+                        sourceUnit)
+        );
+    }
+
+    protected boolean checkNotInterface(ClassNode cNode, String annotationName) {
+        if (cNode.isInterface()) {
+            addError("Error processing interface '" + cNode.getName() + "'. " +
+                    annotationName + " not allowed for interfaces.", cNode);
+            return false;
+        }
+        return true;
+    }
+
+    public boolean hasAnnotation(ClassNode node, ClassNode annotation) {
+        return AnnotatedNodeUtils.hasAnnotation(node, annotation);
+    }
+
+    public static List<String> tokenize(String rawExcludes) {
+        return rawExcludes == null ? new ArrayList<String>() : StringGroovyMethods.tokenize(rawExcludes, ", ");
+    }
+
+    public static boolean deemedInternalName(String name) {
+        return name.contains("$");
+    }
+
+    public static boolean shouldSkipUndefinedAware(String name, List<String> excludes, List<String> includes) {
+        return shouldSkipUndefinedAware(name, excludes, includes, false);
+    }
+
+    public static boolean shouldSkipUndefinedAware(String name, List<String> excludes, List<String> includes, boolean allNames) {
+        return (excludes != null && excludes.contains(name)) ||
+            (!allNames && deemedInternalName(name)) ||
+            (includes != null && !includes.contains(name));
+    }
+
+    public static boolean shouldSkip(String name, List<String> excludes, List<String> includes) {
+        return shouldSkip(name, excludes, includes, false);
+    }
+
+    public static boolean shouldSkip(String name, List<String> excludes, List<String> includes, boolean allNames) {
+        return (excludes != null && excludes.contains(name)) ||
+            (!allNames && deemedInternalName(name)) ||
+            (includes != null && !includes.isEmpty() && !includes.contains(name));
+    }
+
+    @Deprecated
+    public static boolean shouldSkipOnDescriptor(boolean checkReturn, Map genericsSpec, MethodNode mNode, List<ClassNode> excludeTypes, List<ClassNode> includeTypes) {
+        String descriptor = mNode.getTypeDescriptor();
+        String descriptorNoReturn = MethodNodeUtils.methodDescriptorWithoutReturnType(mNode);
+        for (ClassNode cn : excludeTypes) {
+            List<ClassNode> remaining = new LinkedList<ClassNode>();
+            remaining.add(cn);
+            Map updatedGenericsSpec = new HashMap(genericsSpec);
+            while (!remaining.isEmpty()) {
+                ClassNode next = remaining.remove(0);
+                if (!next.equals(ClassHelper.OBJECT_TYPE)) {
+                    updatedGenericsSpec = GenericsUtils.createGenericsSpec(next, updatedGenericsSpec);
+                    for (MethodNode mn : next.getMethods()) {
+                        MethodNode correctedMethodNode = GenericsUtils.correctToGenericsSpec(updatedGenericsSpec, mn);
+                        if (checkReturn) {
+                            String md = correctedMethodNode.getTypeDescriptor();
+                            if (md.equals(descriptor)) return true;
+                        } else {
+                            String md = MethodNodeUtils.methodDescriptorWithoutReturnType(correctedMethodNode);
+                            if (md.equals(descriptorNoReturn)) return true;
+                        }
+                    }
+                    remaining.addAll(Arrays.asList(next.getInterfaces()));
+                }
+            }
+        }
+        if (includeTypes.isEmpty()) return false;
+        for (ClassNode cn : includeTypes) {
+            List<ClassNode> remaining = new LinkedList<ClassNode>();
+            remaining.add(cn);
+            Map updatedGenericsSpec = new HashMap(genericsSpec);
+            while (!remaining.isEmpty()) {
+                ClassNode next = remaining.remove(0);
+                if (!next.equals(ClassHelper.OBJECT_TYPE)) {
+                    updatedGenericsSpec = GenericsUtils.createGenericsSpec(next, updatedGenericsSpec);
+                    for (MethodNode mn : next.getMethods()) {
+                        MethodNode correctedMethodNode = GenericsUtils.correctToGenericsSpec(updatedGenericsSpec, mn);
+                        if (checkReturn) {
+                            String md = correctedMethodNode.getTypeDescriptor();
+                            if (md.equals(descriptor)) return false;
+                        } else {
+                            String md = MethodNodeUtils.methodDescriptorWithoutReturnType(correctedMethodNode);
+                            if (md.equals(descriptorNoReturn)) return false;
+                        }
+                    }
+                    remaining.addAll(Arrays.asList(next.getInterfaces()));
+                }
+            }
+        }
+        return true;
+    }
+    public static boolean shouldSkipOnDescriptorUndefinedAware(boolean checkReturn, Map genericsSpec, MethodNode mNode,
+                                                  List<ClassNode> excludeTypes, List<ClassNode> includeTypes) {
+        String descriptor = mNode.getTypeDescriptor();
+        String descriptorNoReturn = MethodNodeUtils.methodDescriptorWithoutReturnType(mNode);
+        if (excludeTypes != null) {
+            for (ClassNode cn : excludeTypes) {
+                List<ClassNode> remaining = new LinkedList<ClassNode>();
+                remaining.add(cn);
+                Map updatedGenericsSpec = new HashMap(genericsSpec);
+                while (!remaining.isEmpty()) {
+                    ClassNode next = remaining.remove(0);
+                    if (!next.equals(ClassHelper.OBJECT_TYPE)) {
+                        updatedGenericsSpec = GenericsUtils.createGenericsSpec(next, updatedGenericsSpec);
+                        for (MethodNode mn : next.getMethods()) {
+                            MethodNode correctedMethodNode = GenericsUtils.correctToGenericsSpec(updatedGenericsSpec, mn);
+                            if (checkReturn) {
+                                String md = correctedMethodNode.getTypeDescriptor();
+                                if (md.equals(descriptor)) return true;
+                            } else {
+                                String md = MethodNodeUtils.methodDescriptorWithoutReturnType(correctedMethodNode);
+                                if (md.equals(descriptorNoReturn)) return true;
+                            }
+                        }
+                        remaining.addAll(Arrays.asList(next.getInterfaces()));
+                    }
+                }
+            }
+        }
+        if (includeTypes == null) return false;
+        for (ClassNode cn : includeTypes) {
+            List<ClassNode> remaining = new LinkedList<ClassNode>();
+            remaining.add(cn);
+            Map updatedGenericsSpec = new HashMap(genericsSpec);
+            while (!remaining.isEmpty()) {
+                ClassNode next = remaining.remove(0);
+                if (!next.equals(ClassHelper.OBJECT_TYPE)) {
+                    updatedGenericsSpec = GenericsUtils.createGenericsSpec(next, updatedGenericsSpec);
+                    for (MethodNode mn : next.getMethods()) {
+                        MethodNode correctedMethodNode = GenericsUtils.correctToGenericsSpec(updatedGenericsSpec, mn);
+                        if (checkReturn) {
+                            String md = correctedMethodNode.getTypeDescriptor();
+                            if (md.equals(descriptor)) return false;
+                        } else {
+                            String md = MethodNodeUtils.methodDescriptorWithoutReturnType(correctedMethodNode);
+                            if (md.equals(descriptorNoReturn)) return false;
+                        }
+                    }
+                    remaining.addAll(Arrays.asList(next.getInterfaces()));
+                }
+            }
+        }
+        return true;
+    }
+
+    @Deprecated
+    protected boolean checkIncludeExclude(AnnotationNode node, List<String> excludes, List<String> includes, String typeName) {
+        if (includes != null && !includes.isEmpty() && excludes != null && !excludes.isEmpty()) {
+            addError("Error during " + typeName + " processing: Only one of 'includes' and 'excludes' should be supplied not both.", node);
+            return false;
+        }
+        return true;
+    }
+
+    protected boolean checkIncludeExcludeUndefinedAware(AnnotationNode node, List<String> excludes, List<String> includes, String typeName) {
+        if (includes != null && excludes != null && !excludes.isEmpty()) {
+            addError("Error during " + typeName + " processing: Only one of 'includes' and 'excludes' should be supplied not both.", node);
+            return false;
+        }
+        return true;
+    }
+
+    @Deprecated
+    protected void checkIncludeExclude(AnnotationNode node, List<String> excludes, List<String> includes, List<ClassNode> excludeTypes, List<ClassNode> includeTypes, String typeName) {
+        int found = 0;
+        if (includes != null && !includes.isEmpty()) found++;
+        if (excludes != null && !excludes.isEmpty()) found++;
+        if (includeTypes != null && !includeTypes.isEmpty()) found++;
+        if (excludeTypes != null && !excludeTypes.isEmpty()) found++;
+        if (found > 1) {
+            addError("Error during " + typeName + " processing: Only one of 'includes', 'excludes', 'includeTypes' and 'excludeTypes' should be supplied.", node);
+        }
+    }
+
+    protected void checkIncludeExcludeUndefinedAware(AnnotationNode node, List<String> excludes, List<String> includes,
+                                        List<ClassNode> excludeTypes, List<ClassNode> includeTypes, String typeName) {
+        int found = 0;
+        if (includes != null) found++;
+        if (excludes != null && !excludes.isEmpty()) found++;
+        if (includeTypes != null) found++;
+        if (excludeTypes != null && !excludeTypes.isEmpty()) found++;
+        if (found > 1) {
+            addError("Error during " + typeName + " processing: Only one of 'includes', 'excludes', 'includeTypes' and 'excludeTypes' should be supplied.", node);
+        }
+    }
+
+    public boolean checkPropertyList(ClassNode cNode, List<String> propertyNameList, String listName, AnnotationNode anno, String typeName, boolean includeFields) {
+        return checkPropertyList(cNode, propertyNameList, listName, anno, typeName, includeFields, false, false);
+    }
+
+    public boolean checkPropertyList(ClassNode cNode, List<String> propertyNameList, String listName, AnnotationNode anno, String typeName, boolean includeFields, boolean includeSuperProperties, boolean allProperties) {
+        return checkPropertyList(cNode, propertyNameList, listName, anno, typeName, includeFields, includeSuperProperties, allProperties, false, false);
+    }
+
+    public boolean checkPropertyList(ClassNode cNode, List<String> propertyNameList, String listName, AnnotationNode anno, String typeName, boolean includeFields, boolean includeSuperProperties, boolean allProperties, boolean includeSuperFields, boolean includeStatic) {
+        if (propertyNameList == null || propertyNameList.isEmpty()) {
+            return true;
+        }
+        final List<String> pNames = new ArrayList<String>();
+        for (PropertyNode pNode : BeanUtils.getAllProperties(cNode, includeSuperProperties, includeStatic, allProperties)) {
+            pNames.add(pNode.getField().getName());
+        }
+        boolean result = true;
+        if (includeFields || includeSuperFields) {
+            final List<String> fNames = new ArrayList<String>();
+            if (includeFields) {
+                fNames.addAll(getInstanceNonPropertyFieldNames(cNode));
+            }
+            if (includeSuperFields) {
+                List<FieldNode> superNonPropertyFields = getSuperNonPropertyFields(cNode.getSuperClass());
+                for (FieldNode fn : superNonPropertyFields) {
+                    fNames.add(fn.getName());
+                }
+            }
+            for (String pName : propertyNameList) {
+                if (!pNames.contains(pName) && !fNames.contains(pName)) {
+                    addError("Error during " + typeName + " processing: '" + listName + "' property or field '" + pName + "' does not exist.", anno);
+                    result = false;
+                }
+            }
+        } else {
+            for (String pName : propertyNameList) {
+                if (!pNames.contains(pName)) {
+                    addError("Error during " + typeName + " processing: '" + listName + "' property '" + pName + "' does not exist.", anno);
+                    result = false;
+                }
+            }
+        }
+        return result;
+    }
+
+    /**
+     * @deprecated use GenericsUtils#nonGeneric
+     */
+    @Deprecated
+    public static ClassNode nonGeneric(ClassNode type) {
+        return GenericsUtils.nonGeneric(type);
+    }
+
+}
diff --git a/src/main/java/org/codehaus/groovy/transform/FieldASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/FieldASTTransformation.java
index 27f242b..0cb9515 100644
--- a/src/main/java/org/codehaus/groovy/transform/FieldASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/FieldASTTransformation.java
@@ -1,292 +1,292 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.transform;
-
-import groovy.cli.Option;
-import groovy.lang.Lazy;
-import groovy.transform.Field;
-import org.codehaus.groovy.GroovyBugError;
-import org.codehaus.groovy.ast.ASTNode;
-import org.codehaus.groovy.ast.AnnotatedNode;
-import org.codehaus.groovy.ast.AnnotationNode;
-import org.codehaus.groovy.ast.ClassCodeExpressionTransformer;
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.ConstructorNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.MethodNode;
-import org.codehaus.groovy.ast.Parameter;
-import org.codehaus.groovy.ast.Variable;
-import org.codehaus.groovy.ast.VariableScope;
-import org.codehaus.groovy.ast.expr.ArgumentListExpression;
-import org.codehaus.groovy.ast.expr.ClosureExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.ConstructorCallExpression;
-import org.codehaus.groovy.ast.expr.DeclarationExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.TupleExpression;
-import org.codehaus.groovy.ast.expr.VariableExpression;
-import org.codehaus.groovy.ast.stmt.ExpressionStatement;
-import org.codehaus.groovy.classgen.VariableScopeVisitor;
-import org.codehaus.groovy.control.CompilePhase;
-import org.codehaus.groovy.control.SourceUnit;
-import org.codehaus.groovy.runtime.MetaClassHelper;
-import org.objectweb.asm.Opcodes;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import static org.apache.groovy.ast.tools.ClassNodeUtils.addGeneratedConstructor;
-import static org.codehaus.groovy.ast.ClassHelper.make;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.assignX;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.block;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.param;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.params;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.propX;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.stmt;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.varX;
-
-/**
- * Handles transformation for the @Field annotation.
- */
-@GroovyASTTransformation(phase = CompilePhase.SEMANTIC_ANALYSIS)
-public class FieldASTTransformation extends ClassCodeExpressionTransformer implements ASTTransformation, Opcodes {
-
-    private static final Class MY_CLASS = Field.class;
-    private static final ClassNode MY_TYPE = make(MY_CLASS);
-    private static final ClassNode LAZY_TYPE = make(Lazy.class);
-    private static final String MY_TYPE_NAME = "@" + MY_TYPE.getNameWithoutPackage();
-    private static final ClassNode ASTTRANSFORMCLASS_TYPE = make(GroovyASTTransformationClass.class);
-    private static final ClassNode OPTION_TYPE = make(Option.class);
-    private SourceUnit sourceUnit;
-    private DeclarationExpression candidate;
-    private boolean insideScriptBody;
-    private String variableName;
-    private FieldNode fieldNode;
-    private ClosureExpression currentClosure;
-    private ConstructorCallExpression currentAIC;
-
-    public void visit(ASTNode[] nodes, SourceUnit source) {
-        sourceUnit = source;
-        if (nodes.length != 2 || !(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) {
-            throw new GroovyBugError("Internal error: expecting [AnnotationNode, AnnotatedNode] but got: " + Arrays.asList(nodes));
-        }
-
-        AnnotatedNode parent = (AnnotatedNode) nodes[1];
-        AnnotationNode node = (AnnotationNode) nodes[0];
-        if (!MY_TYPE.equals(node.getClassNode())) return;
-
-        if (parent instanceof DeclarationExpression) {
-            DeclarationExpression de = (DeclarationExpression) parent;
-            ClassNode cNode = de.getDeclaringClass();
-            if (!cNode.isScript()) {
-                addError("Annotation " + MY_TYPE_NAME + " can only be used within a Script.", parent);
-                return;
-            }
-            candidate = de;
-            // GROOVY-4548: temp fix to stop CCE until proper support is added
-            if (de.isMultipleAssignmentDeclaration()) {
-                addError("Annotation " + MY_TYPE_NAME + " not supported with multiple assignment notation.", parent);
-                return;
-            }
-            VariableExpression ve = de.getVariableExpression();
-            variableName = ve.getName();
-            // set owner null here, it will be updated by addField
-            fieldNode = new FieldNode(variableName, ve.getModifiers(), ve.getType(), null, de.getRightExpression());
-            fieldNode.setSourcePosition(de);
-            cNode.addField(fieldNode);
-            // provide setter for CLI Builder purposes unless final
-            if (fieldNode.isFinal()) {
-                if (!de.getAnnotations(OPTION_TYPE).isEmpty()) {
-                    addError("Can't have a final field also annotated with @" + OPTION_TYPE.getNameWithoutPackage(), de);
-                }
-            } else {
-                String setterName = "set" + MetaClassHelper.capitalize(variableName);
-                cNode.addMethod(setterName, ACC_PUBLIC | ACC_SYNTHETIC, ClassHelper.VOID_TYPE, params(param(ve.getType(), variableName)), ClassNode.EMPTY_ARRAY, block(
-                        stmt(assignX(propX(varX("this"), variableName), varX(variableName)))
-                ));
-            }
-
-            // GROOVY-4833 : annotations that are not Groovy transforms should be transferred to the generated field
-            // GROOVY-6112 : also copy acceptable Groovy transforms
-            final List<AnnotationNode> annotations = de.getAnnotations();
-            for (AnnotationNode annotation : annotations) {
-                // GROOVY-6337 HACK: in case newly created field is @Lazy
-                if (annotation.getClassNode().equals(LAZY_TYPE)) {
-                    LazyASTTransformation.visitField(this, annotation, fieldNode);
-                }
-                final ClassNode annotationClassNode = annotation.getClassNode();
-                if (notTransform(annotationClassNode) || acceptableTransform(annotation)) {
-                    fieldNode.addAnnotation(annotation);
-                }
-            }
-
-            super.visitClass(cNode);
-            // GROOVY-5207 So that Closures can see newly added fields
-            // (not super efficient for a very large class with many @Fields but we chose simplicity
-            // and understandability of this solution over more complex but efficient alternatives)
-            VariableScopeVisitor scopeVisitor = new VariableScopeVisitor(source);
-            scopeVisitor.visitClass(cNode);
-        }
-    }
-
-    private static boolean acceptableTransform(AnnotationNode annotation) {
-        // TODO also check for phase after sourceUnit.getPhase()? but will be ignored anyway?
-        // TODO we should only copy those annotations with FIELD_TARGET but haven't visited annotations
-        // and gathered target info at this phase, so we can't do this:
-        // return annotation.isTargetAllowed(AnnotationNode.FIELD_TARGET);
-        // instead just don't copy ourselves for now
-        return !annotation.getClassNode().equals(MY_TYPE);
-    }
-
-    private static boolean notTransform(ClassNode annotationClassNode) {
-        return annotationClassNode.getAnnotations(ASTTRANSFORMCLASS_TYPE).isEmpty();
-    }
-
-    @Override
-    public Expression transform(Expression expr) {
-        if (expr == null) return null;
-        if (expr instanceof DeclarationExpression) {
-            DeclarationExpression de = (DeclarationExpression) expr;
-            if (de.getLeftExpression() == candidate.getLeftExpression()) {
-                if (insideScriptBody) {
-                    // TODO make EmptyExpression work
-                    // partially works but not if only thing in script
-                    // return EmptyExpression.INSTANCE;
-                    return new ConstantExpression(null);
-                }
-                addError("Annotation " + MY_TYPE_NAME + " can only be used within a Script body.", expr);
-                return expr;
-            }
-        } else if (insideScriptBody && expr instanceof VariableExpression && currentClosure != null) {
-            VariableExpression ve = (VariableExpression) expr;
-            if (ve.getName().equals(variableName)) {
-                adjustToClassVar(ve);
-                return ve;
-            }
-        } else if (currentAIC != null && expr instanceof ArgumentListExpression) {
-            // if a match is found, the compiler will have already set up aic constructor to hav
-            // an argument which isn't needed since we'll be accessing the field; we must undo it
-            Expression skip = null;
-            List<Expression> origArgList = ((ArgumentListExpression) expr).getExpressions();
-            for (int i = 0; i < origArgList.size(); i++) {
-                Expression arg = origArgList.get(i);
-                if (matchesCandidate(arg)) {
-                    skip = arg;
-                    adjustConstructorAndFields(i, currentAIC.getType());
-                    break;
-                }
-            }
-            if (skip != null) {
-                return adjustedArgList(skip, origArgList);
-            }
-        }
-        return expr.transformExpression(this);
-    }
-
-    private boolean matchesCandidate(Expression arg) {
-        return arg instanceof VariableExpression && ((VariableExpression) arg).getAccessedVariable() == candidate.getVariableExpression().getAccessedVariable();
-    }
-
-    private Expression adjustedArgList(Expression skip, List<Expression> origArgs) {
-        List<Expression> newArgs = new ArrayList<Expression>(origArgs.size() - 1);
-        for (Expression origArg : origArgs) {
-            if (skip != origArg) {
-                newArgs.add(origArg);
-            }
-        }
-        return new ArgumentListExpression(newArgs);
-    }
-
-    private void adjustConstructorAndFields(int skipIndex, ClassNode type) {
-        List<ConstructorNode> constructors = type.getDeclaredConstructors();
-        if (constructors.size() == 1) {
-            ConstructorNode constructor = constructors.get(0);
-            Parameter[] params = constructor.getParameters();
-            Parameter[] newParams = new Parameter[params.length - 1];
-            int to = 0;
-            for (int from = 0; from < params.length; from++) {
-                if (from != skipIndex) {
-                    newParams[to++] = params[from];
-                }
-            }
-            type.removeConstructor(constructor);
-            // code doesn't mention the removed param at this point, okay to leave as is
-            addGeneratedConstructor(type, constructor.getModifiers(), newParams, constructor.getExceptions(), constructor.getCode());
-            type.removeField(variableName);
-        }
-    }
-
-    private void adjustToClassVar(VariableExpression expr) {
-        // we only need to check the variable name because the Groovy compiler
-        // already fails if a variable with the same name already exists in the scope.
-        // this means that a closure cannot shadow a class variable
-        expr.setAccessedVariable(fieldNode);
-        final VariableScope variableScope = currentClosure.getVariableScope();
-        final Iterator<Variable> iterator = variableScope.getReferencedLocalVariablesIterator();
-        while (iterator.hasNext()) {
-            Variable next = iterator.next();
-            if (next.getName().equals(variableName)) iterator.remove();
-        }
-        variableScope.putReferencedClassVariable(fieldNode);
-    }
-
-    @Override
-    public void visitClosureExpression(final ClosureExpression expression) {
-        ClosureExpression old = currentClosure;
-        currentClosure = expression;
-        super.visitClosureExpression(expression);
-        currentClosure = old;
-    }
-
-    @Override
-    public void visitConstructorCallExpression(final ConstructorCallExpression cce) {
-        if (!insideScriptBody || !cce.isUsingAnonymousInnerClass()) return;
-        ConstructorCallExpression old = currentAIC;
-        currentAIC = cce;
-        Expression newArgs = transform(cce.getArguments());
-        if (cce.getArguments() instanceof TupleExpression && newArgs instanceof TupleExpression) {
-            List<Expression> argList = ((TupleExpression) cce.getArguments()).getExpressions();
-            argList.clear();
-            argList.addAll(((TupleExpression) newArgs).getExpressions());
-        }
-        currentAIC = old;
-    }
-
-    @Override
-    public void visitMethod(MethodNode node) {
-        Boolean oldInsideScriptBody = insideScriptBody;
-        if (node.isScriptBody()) insideScriptBody = true;
-        super.visitMethod(node);
-        insideScriptBody = oldInsideScriptBody;
-    }
-
-    @Override
-    public void visitExpressionStatement(ExpressionStatement es) {
-        Expression exp = es.getExpression();
-        exp.visit(this);
-        super.visitExpressionStatement(es);
-    }
-
-    protected SourceUnit getSourceUnit() {
-        return sourceUnit;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.transform;
+
+import groovy.cli.Option;
+import groovy.lang.Lazy;
+import groovy.transform.Field;
+import org.codehaus.groovy.GroovyBugError;
+import org.codehaus.groovy.ast.ASTNode;
+import org.codehaus.groovy.ast.AnnotatedNode;
+import org.codehaus.groovy.ast.AnnotationNode;
+import org.codehaus.groovy.ast.ClassCodeExpressionTransformer;
+import org.codehaus.groovy.ast.ClassHelper;
+import org.codehaus.groovy.ast.ClassNode;
+import org.codehaus.groovy.ast.ConstructorNode;
+import org.codehaus.groovy.ast.FieldNode;
+import org.codehaus.groovy.ast.MethodNode;
+import org.codehaus.groovy.ast.Parameter;
+import org.codehaus.groovy.ast.Variable;
+import org.codehaus.groovy.ast.VariableScope;
+import org.codehaus.groovy.ast.expr.ArgumentListExpression;
+import org.codehaus.groovy.ast.expr.ClosureExpression;
+import org.codehaus.groovy.ast.expr.ConstantExpression;
+import org.codehaus.groovy.ast.expr.ConstructorCallExpression;
+import org.codehaus.groovy.ast.expr.DeclarationExpression;
+import org.codehaus.groovy.ast.expr.Expression;
+import org.codehaus.groovy.ast.expr.TupleExpression;
+import org.codehaus.groovy.ast.expr.VariableExpression;
+import org.codehaus.groovy.ast.stmt.ExpressionStatement;
+import org.codehaus.groovy.classgen.VariableScopeVisitor;
+import org.codehaus.groovy.control.CompilePhase;
+import org.codehaus.groovy.control.SourceUnit;
+import org.codehaus.groovy.runtime.MetaClassHelper;
+import org.objectweb.asm.Opcodes;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import static org.apache.groovy.ast.tools.ClassNodeUtils.addGeneratedConstructor;
+import static org.codehaus.groovy.ast.ClassHelper.make;
+import static org.codehaus.groovy.ast.tools.GeneralUtils.assignX;
+import static org.codehaus.groovy.ast.tools.GeneralUtils.block;
+import static org.codehaus.groovy.ast.tools.GeneralUtils.param;
+import static org.codehaus.groovy.ast.tools.GeneralUtils.params;
+import static org.codehaus.groovy.ast.tools.GeneralUtils.propX;
+import static org.codehaus.groovy.ast.tools.GeneralUtils.stmt;
+import static org.codehaus.groovy.ast.tools.GeneralUtils.varX;
+
+/**
+ * Handles transformation for the @Field annotation.
+ */
+@GroovyASTTransformation(phase = CompilePhase.SEMANTIC_ANALYSIS)
+public class FieldASTTransformation extends ClassCodeExpressionTransformer implements ASTTransformation, Opcodes {
+
+    private static final Class MY_CLASS = Field.class;
+    private static final ClassNode MY_TYPE = make(MY_CLASS);
+    private static final ClassNode LAZY_TYPE = make(Lazy.class);
+    private static final String MY_TYPE_NAME = "@" + MY_TYPE.getNameWithoutPackage();
+    private static final ClassNode ASTTRANSFORMCLASS_TYPE = make(GroovyASTTransformationClass.class);
+    private static final ClassNode OPTION_TYPE = make(Option.class);
+    private SourceUnit sourceUnit;
+    private DeclarationExpression candidate;
+    private boolean insideScriptBody;
+    private String variableName;
+    private FieldNode fieldNode;
+    private ClosureExpression currentClosure;
+    private ConstructorCallExpression currentAIC;
+
+    public void visit(ASTNode[] nodes, SourceUnit source) {
+        sourceUnit = source;
+        if (nodes.length != 2 || !(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) {
+            throw new GroovyBugError("Internal error: expecting [AnnotationNode, AnnotatedNode] but got: " + Arrays.asList(nodes));
+        }
+
+        AnnotatedNode parent = (AnnotatedNode) nodes[1];
+        AnnotationNode node = (AnnotationNode) nodes[0];
+        if (!MY_TYPE.equals(node.getClassNode())) return;
+
+        if (parent instanceof DeclarationExpression) {
+            DeclarationExpression de = (DeclarationExpression) parent;
+            ClassNode cNode = de.getDeclaringClass();
+            if (!cNode.isScript()) {
+                addError("Annotation " + MY_TYPE_NAME + " can only be used within a Script.", parent);
+                return;
+            }
+            candidate = de;
+            // GROOVY-4548: temp fix to stop CCE until proper support is added
+            if (de.isMultipleAssignmentDeclaration()) {
+                addError("Annotation " + MY_TYPE_NAME + " not supported with multiple assignment notation.", parent);
+                return;
+            }
+            VariableExpression ve = de.getVariableExpression();
+            variableName = ve.getName();
+            // set owner null here, it will be updated by addField
+            fieldNode = new FieldNode(variableName, ve.getModifiers(), ve.getType(), null, de.getRightExpression());
+            fieldNode.setSourcePosition(de);
+            cNode.addField(fieldNode);
+            // provide setter for CLI Builder purposes unless final
+            if (fieldNode.isFinal()) {
+                if (!de.getAnnotations(OPTION_TYPE).isEmpty()) {
+                    addError("Can't have a final field also annotated with @" + OPTION_TYPE.getNameWithoutPackage(), de);
+                }
+            } else {
+                String setterName = "set" + MetaClassHelper.capitalize(variableName);
+                cNode.addMethod(setterName, ACC_PUBLIC | ACC_SYNTHETIC, ClassHelper.VOID_TYPE, params(param(ve.getType(), variableName)), ClassNode.EMPTY_ARRAY, block(
+                        stmt(assignX(propX(varX("this"), variableName), varX(variableName)))
+                ));
+            }
+
+            // GROOVY-4833 : annotations that are not Groovy transforms should be transferred to the generated field
+            // GROOVY-6112 : also copy acceptable Groovy transforms
+            final List<AnnotationNode> annotations = de.getAnnotations();
+            for (AnnotationNode annotation : annotations) {
+                // GROOVY-6337 HACK: in case newly created field is @Lazy
+                if (annotation.getClassNode().equals(LAZY_TYPE)) {
+                    LazyASTTransformation.visitField(this, annotation, fieldNode);
+                }
+                final ClassNode annotationClassNode = annotation.getClassNode();
+                if (notTransform(annotationClassNode) || acceptableTransform(annotation)) {
+                    fieldNode.addAnnotation(annotation);
+                }
+            }
+
+            super.visitClass(cNode);
+            // GROOVY-5207 So that Closures can see newly added fields
+            // (not super efficient for a very large class with many @Fields but we chose simplicity
+            // and understandability of this solution over more complex but efficient alternatives)
+            VariableScopeVisitor scopeVisitor = new VariableScopeVisitor(source);
+            scopeVisitor.visitClass(cNode);
+        }
+    }
+
+    private static boolean acceptableTransform(AnnotationNode annotation) {
+        // TODO also check for phase after sourceUnit.getPhase()? but will be ignored anyway?
+        // TODO we should only copy those annotations with FIELD_TARGET but haven't visited annotations
+        // and gathered target info at this phase, so we can't do this:
+        // return annotation.isTargetAllowed(AnnotationNode.FIELD_TARGET);
+        // instead just don't copy ourselves for now
+        return !annotation.getClassNode().equals(MY_TYPE);
+    }
+
+    private static boolean notTransform(ClassNode annotationClassNode) {
+        return annotationClassNode.getAnnotations(ASTTRANSFORMCLASS_TYPE).isEmpty();
+    }
+
+    @Override
+    public Expression transform(Expression expr) {
+        if (expr == null) return null;
+        if (expr instanceof DeclarationExpression) {
+            DeclarationExpression de = (DeclarationExpression) expr;
+            if (de.getLeftExpression() == candidate.getLeftExpression()) {
+                if (insideScriptBody) {
+                    // TODO make EmptyExpression work
+                    // partially works but not if only thing in script
+                    // return EmptyExpression.INSTANCE;
+                    return new ConstantExpression(null);
+                }
+                addError("Annotation " + MY_TYPE_NAME + " can only be used within a Script body.", expr);
+                return expr;
+            }
+        } else if (insideScriptBody && expr instanceof VariableExpression && currentClosure != null) {
+            VariableExpression ve = (VariableExpression) expr;
+            if (ve.getName().equals(variableName)) {
+                adjustToClassVar(ve);
+                return ve;
+            }
+        } else if (currentAIC != null && expr instanceof ArgumentListExpression) {
+            // if a match is found, the compiler will have already set up aic constructor to hav
+            // an argument which isn't needed since we'll be accessing the field; we must undo it
+            Expression skip = null;
+            List<Expression> origArgList = ((ArgumentListExpression) expr).getExpressions();
+            for (int i = 0; i < origArgList.size(); i++) {
+                Expression arg = origArgList.get(i);
+                if (matchesCandidate(arg)) {
+                    skip = arg;
+                    adjustConstructorAndFields(i, currentAIC.getType());
+                    break;
+                }
+            }
+            if (skip != null) {
+                return adjustedArgList(skip, origArgList);
+            }
+        }
+        return expr.transformExpression(this);
+    }
+
+    private boolean matchesCandidate(Expression arg) {
+        return arg instanceof VariableExpression && ((VariableExpression) arg).getAccessedVariable() == candidate.getVariableExpression().getAccessedVariable();
+    }
+
+    private Expression adjustedArgList(Expression skip, List<Expression> origArgs) {
+        List<Expression> newArgs = new ArrayList<Expression>(origArgs.size() - 1);
+        for (Expression origArg : origArgs) {
+            if (skip != origArg) {
+                newArgs.add(origArg);
+            }
+        }
+        return new ArgumentListExpression(newArgs);
+    }
+
+    private void adjustConstructorAndFields(int skipIndex, ClassNode type) {
+        List<ConstructorNode> constructors = type.getDeclaredConstructors();
+        if (constructors.size() == 1) {
+            ConstructorNode constructor = constructors.get(0);
+            Parameter[] params = constructor.getParameters();
+            Parameter[] newParams = new Parameter[params.length - 1];
+            int to = 0;
+            for (int from = 0; from < params.length; from++) {
+                if (from != skipIndex) {
+                    newParams[to++] = params[from];
+                }
+            }
+            type.removeConstructor(constructor);
+            // code doesn't mention the removed param at this point, okay to leave as is
+            addGeneratedConstructor(type, constructor.getModifiers(), newParams, constructor.getExceptions(), constructor.getCode());
+            type.removeField(variableName);
+        }
+    }
+
+    private void adjustToClassVar(VariableExpression expr) {
+        // we only need to check the variable name because the Groovy compiler
+        // already fails if a variable with the same name already exists in the scope.
+        // this means that a closure cannot shadow a class variable
+        expr.setAccessedVariable(fieldNode);
+        final VariableScope variableScope = currentClosure.getVariableScope();
+        final Iterator<Variable> iterator = variableScope.getReferencedLocalVariablesIterator();
+        while (iterator.hasNext()) {
+            Variable next = iterator.next();
+            if (next.getName().equals(variableName)) iterator.remove();
+        }
+        variableScope.putReferencedClassVariable(fieldNode);
+    }
+
+    @Override
+    public void visitClosureExpression(final ClosureExpression expression) {
+        ClosureExpression old = currentClosure;
+        currentClosure = expression;
+        super.visitClosureExpression(expression);
+        currentClosure = old;
+    }
+
+    @Override
+    public void visitConstructorCallExpression(final ConstructorCallExpression cce) {
+        if (!insideScriptBody || !cce.isUsingAnonymousInnerClass()) return;
+        ConstructorCallExpression old = currentAIC;
+        currentAIC = cce;
+        Expression newArgs = transform(cce.getArguments());
+        if (cce.getArguments() instanceof TupleExpression && newArgs instanceof TupleExpression) {
+            List<Expression> argList = ((TupleExpression) cce.getArguments()).getExpressions();
+            argList.clear();
+            argList.addAll(((TupleExpression) newArgs).getExpressions());
+        }
+        currentAIC = old;
+    }
+
+    @Override
+    public void visitMethod(MethodNode node) {
+        Boolean oldInsideScriptBody = insideScriptBody;
+        if (node.isScriptBody()) insideScriptBody = true;
+        super.visitMethod(node);
+        insideScriptBody = oldInsideScriptBody;
+    }
+
+    @Override
+    public void visitExpressionStatement(ExpressionStatement es) {
+        Expression exp = es.getExpression();
+        exp.visit(this);
+        super.visitExpressionStatement(es);
+    }
+
+    protected SourceUnit getSourceUnit() {
+        return sourceUnit;
+    }
+}
diff --git a/src/main/java/org/codehaus/groovy/transform/TupleConstructorASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/TupleConstructorASTTransformation.java
index 1748eb6..8dd0f7a 100644
--- a/src/main/java/org/codehaus/groovy/transform/TupleConstructorASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/TupleConstructorASTTransformation.java
@@ -1,353 +1,353 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.transform;
-
-import groovy.lang.GroovyClassLoader;
-import groovy.transform.CompilationUnitAware;
-import groovy.transform.MapConstructor;
-import groovy.transform.TupleConstructor;
-import groovy.transform.options.PropertyHandler;
-import org.apache.groovy.ast.tools.AnnotatedNodeUtils;
-import org.codehaus.groovy.ast.ASTNode;
-import org.codehaus.groovy.ast.AnnotatedNode;
-import org.codehaus.groovy.ast.AnnotationNode;
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.ConstructorNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.Parameter;
-import org.codehaus.groovy.ast.PropertyNode;
-import org.codehaus.groovy.ast.expr.ClosureExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.VariableExpression;
-import org.codehaus.groovy.ast.stmt.BlockStatement;
-import org.codehaus.groovy.ast.stmt.EmptyStatement;
-import org.codehaus.groovy.ast.stmt.ExpressionStatement;
-import org.codehaus.groovy.ast.stmt.Statement;
-import org.codehaus.groovy.classgen.VariableScopeVisitor;
-import org.codehaus.groovy.control.CompilationUnit;
-import org.codehaus.groovy.control.CompilePhase;
-import org.codehaus.groovy.control.SourceUnit;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.apache.groovy.ast.tools.AnnotatedNodeUtils.markAsGenerated;
-import static org.apache.groovy.ast.tools.ClassNodeUtils.hasExplicitConstructor;
-import static org.apache.groovy.ast.tools.VisibilityUtils.getVisibility;
-import static org.codehaus.groovy.ast.ClassHelper.make;
-import static org.codehaus.groovy.ast.ClassHelper.makeWithoutCaching;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.args;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.assignS;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.block;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.callX;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.constX;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.copyStatementsWithSuperAdjustment;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.ctorX;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.equalsNullX;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.getAllProperties;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.ifElseS;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.ifS;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.params;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.propX;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.stmt;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.throwS;
-import static org.codehaus.groovy.ast.tools.GeneralUtils.varX;
-import static org.codehaus.groovy.transform.ImmutableASTTransformation.makeImmutable;
-
-/**
- * Handles generation of code for the @TupleConstructor annotation.
- */
-@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION)
-public class TupleConstructorASTTransformation extends AbstractASTTransformation implements CompilationUnitAware {
-
-    private CompilationUnit compilationUnit;
-    static final Class MY_CLASS = TupleConstructor.class;
-    static final ClassNode MY_TYPE = make(MY_CLASS);
-    static final String MY_TYPE_NAME = "@" + MY_TYPE.getNameWithoutPackage();
-    private static final ClassNode LHMAP_TYPE = makeWithoutCaching(LinkedHashMap.class, false);
-    private static final ClassNode CHECK_METHOD_TYPE = make(ImmutableASTTransformation.class);
-    private static final Class<? extends Annotation> MAP_CONSTRUCTOR_CLASS = MapConstructor.class;
-    private static final Map<Class<?>, Expression> primitivesInitialValues;
-
-    static {
-        final ConstantExpression zero = constX(0);
-        final ConstantExpression zeroDecimal = constX(.0);
-        primitivesInitialValues = new HashMap<Class<?>, Expression>();
-        primitivesInitialValues.put(int.class, zero);
-        primitivesInitialValues.put(long.class, zero);
-        primitivesInitialValues.put(short.class, zero);
-        primitivesInitialValues.put(byte.class, zero);
-        primitivesInitialValues.put(char.class, zero);
-        primitivesInitialValues.put(float.class, zeroDecimal);
-        primitivesInitialValues.put(double.class, zeroDecimal);
-        primitivesInitialValues.put(boolean.class, ConstantExpression.FALSE);
-    }
-
-    @Override
-    public String getAnnotationName() {
-        return MY_TYPE_NAME;
-    }
-
-    public void visit(ASTNode[] nodes, SourceUnit source) {
-        init(nodes, source);
-        AnnotatedNode parent = (AnnotatedNode) nodes[1];
-        AnnotationNode anno = (AnnotationNode) nodes[0];
-        if (!MY_TYPE.equals(anno.getClassNode())) return;
-
-        if (parent instanceof ClassNode) {
-            ClassNode cNode = (ClassNode) parent;
-            if (!checkNotInterface(cNode, MY_TYPE_NAME)) return;
-            boolean includeFields = memberHasValue(anno, "includeFields", true);
-            boolean includeProperties = !memberHasValue(anno, "includeProperties", false);
-            boolean includeSuperFields = memberHasValue(anno, "includeSuperFields", true);
-            boolean includeSuperProperties = memberHasValue(anno, "includeSuperProperties", true);
-            boolean allProperties = memberHasValue(anno, "allProperties", true);
-            List<String> excludes = getMemberStringList(anno, "excludes");
-            List<String> includes = getMemberStringList(anno, "includes");
-            boolean allNames = memberHasValue(anno, "allNames", true);
-            if (!checkIncludeExcludeUndefinedAware(anno, excludes, includes, MY_TYPE_NAME)) return;
-            if (!checkPropertyList(cNode, includes, "includes", anno, MY_TYPE_NAME, includeFields, includeSuperProperties, allProperties, includeSuperFields, false))
-                return;
-            if (!checkPropertyList(cNode, excludes, "excludes", anno, MY_TYPE_NAME, includeFields, includeSuperProperties, allProperties, includeSuperFields, false))
-                return;
-            final GroovyClassLoader classLoader = compilationUnit != null ? compilationUnit.getTransformLoader() : source.getClassLoader();
-            final PropertyHandler handler = PropertyHandler.createPropertyHandler(this, classLoader, cNode);
-            if (handler == null) return;
-            if (!handler.validateAttributes(this, anno)) return;
-
-            Expression pre = anno.getMember("pre");
-            if (pre != null && !(pre instanceof ClosureExpression)) {
-                addError("Expected closure value for annotation parameter 'pre'. Found " + pre, cNode);
-                return;
-            }
-            Expression post = anno.getMember("post");
-            if (post != null && !(post instanceof ClosureExpression)) {
-                addError("Expected closure value for annotation parameter 'post'. Found " + post, cNode);
-                return;
-            }
-
-            createConstructor(this, anno, cNode, includeFields, includeProperties, includeSuperFields, includeSuperProperties,
-                    excludes, includes, allNames, allProperties,
-                    sourceUnit, handler, (ClosureExpression) pre, (ClosureExpression) post);
-
-            if (pre != null) {
-                anno.setMember("pre", new ClosureExpression(Parameter.EMPTY_ARRAY, EmptyStatement.INSTANCE));
-            }
-            if (post != null) {
-                anno.setMember("post", new ClosureExpression(Parameter.EMPTY_ARRAY, EmptyStatement.INSTANCE));
-            }
-        }
-    }
-
-    private static void createConstructor(AbstractASTTransformation xform, AnnotationNode anno, ClassNode cNode, boolean includeFields,
-                                          boolean includeProperties, boolean includeSuperFields, boolean includeSuperProperties,
-                                          List<String> excludes, final List<String> includes, boolean allNames, boolean allProperties,
-                                          SourceUnit sourceUnit, PropertyHandler handler, ClosureExpression pre, ClosureExpression post) {
-        boolean callSuper = xform.memberHasValue(anno, "callSuper", true);
-        boolean force = xform.memberHasValue(anno, "force", true);
-        boolean defaults = !xform.memberHasValue(anno, "defaults", false);
-        Set<String> names = new HashSet<String>();
-        List<PropertyNode> superList;
-        if (includeSuperProperties || includeSuperFields) {
-            superList = getAllProperties(names, cNode.getSuperClass(), includeSuperProperties, includeSuperFields, false, allProperties, true, true);
-        } else {
-            superList = new ArrayList<PropertyNode>();
-        }
-
-        List<PropertyNode> list = getAllProperties(names, cNode, includeProperties, includeFields, false, allProperties, false, true);
-
-        boolean makeImmutable = makeImmutable(cNode);
-        boolean specialNamedArgCase = (ImmutableASTTransformation.isSpecialNamedArgCase(list, !defaults) && superList.isEmpty()) ||
-                (ImmutableASTTransformation.isSpecialNamedArgCase(superList, !defaults) && list.isEmpty());
-
-        // no processing if existing constructors found unless forced or ImmutableBase in play
-        if (hasExplicitConstructor(null, cNode) && !force && !makeImmutable) return;
-
-        final List<Parameter> params = new ArrayList<Parameter>();
-        final List<Expression> superParams = new ArrayList<Expression>();
-        final BlockStatement preBody = new BlockStatement();
-        boolean superInPre = false;
-        if (pre != null) {
-            superInPre = copyStatementsWithSuperAdjustment(pre, preBody);
-            if (superInPre && callSuper) {
-                xform.addError("Error during " + MY_TYPE_NAME + " processing, can't have a super call in 'pre' " +
-                        "closure and also 'callSuper' enabled", cNode);
-            }
-        }
-
-        final BlockStatement body = new BlockStatement();
-
-        List<PropertyNode> tempList = new ArrayList<PropertyNode>(list);
-        tempList.addAll(superList);
-        if (!handler.validateProperties(xform, body, cNode, tempList)) {
-            return;
-        }
-
-        for (PropertyNode pNode : superList) {
-            String name = pNode.getName();
-            FieldNode fNode = pNode.getField();
-            if (shouldSkipUndefinedAware(name, excludes, includes, allNames)) continue;
-            params.add(createParam(fNode, name, defaults, xform, makeImmutable));
-            if (callSuper) {
... 43622 lines suppressed ...


[groovy] 06/06: minor refactor: remove javadoc warnings (fix typo)

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 4230c1cdf7ac5e0982c004c4c6eef6f1f722fe3d
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Apr 27 19:50:38 2019 +1000

    minor refactor: remove javadoc warnings (fix typo)
---
 subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java b/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
index 0ea6b91..c067e25 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
@@ -53,7 +53,7 @@ import java.util.Set;
  * </pre>
  * You can write code like this:
  * <pre>
- * @{code
+ * {@code
  * def person = new DataSet(db, 'Person') // or db.dataSet('Person'), or db.dataSet(Person)
  * def janFrequentBuyers = person.findAll { it.purchaseCount > 10 && it.lastName == "January" }
  * def sortedPeopleOfInterest = janFrequentBuyers.


[groovy] 02/06: minor refactor: remove javadoc warnings and tidy up (cont'd)

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 77ee62f1979bd3a496c0a203b9f748191e8a22e8
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Apr 27 13:02:34 2019 +1000

    minor refactor: remove javadoc warnings and tidy up (cont'd)
---
 src/main/groovy/groovy/lang/Category.java          |   2 +-
 src/main/groovy/groovy/lang/Closure.java           |  46 +++---
 src/main/groovy/groovy/lang/ExpandoMetaClass.java  |  42 +++---
 src/main/groovy/groovy/lang/GrabConfig.java        |   8 +-
 src/main/groovy/groovy/lang/Range.java             |   2 +-
 .../transform/builder/InitializerStrategy.java     |   4 +-
 .../groovy/ast/expr/ClosureExpression.java         |   4 +-
 .../groovy/ast/expr/MethodPointerExpression.java   |   4 +-
 .../classgen/asm/MethodCallerMultiAdapter.java     | 164 ++++++++++-----------
 .../codehaus/groovy/control/GenericsVisitor.java   |   2 +-
 .../builder/InlinedASTCustomizerFactory.java       |   2 +-
 .../builder/SourceAwareCustomizerFactory.java      |   4 +-
 .../codehaus/groovy/runtime/ComposedClosure.java   |  24 +--
 .../codehaus/groovy/runtime/CurriedClosure.java    |   2 +-
 .../runtime/metaclass/MetaClassRegistryImpl.java   |   2 +-
 .../groovy/util/JavadocAssertionTestBuilder.groovy |   4 +-
 .../main/groovy/groovy/util/StringTestUtil.groovy  |  64 ++++----
 17 files changed, 193 insertions(+), 187 deletions(-)

diff --git a/src/main/groovy/groovy/lang/Category.java b/src/main/groovy/groovy/lang/Category.java
index f092068..bd6bf1d 100644
--- a/src/main/groovy/groovy/lang/Category.java
+++ b/src/main/groovy/groovy/lang/Category.java
@@ -91,7 +91,7 @@ import java.lang.annotation.Target;
  *
  * def words = ["The", "quick", "brown", "fox"]
  * println new Sentence(words).shuffle()
- * // => [quick, fox, The, brown]       (order will vary)
+ * // {@code =>} [quick, fox, The, brown]       (order will vary)
  * </pre>
  */
 @java.lang.annotation.Documented
diff --git a/src/main/groovy/groovy/lang/Closure.java b/src/main/groovy/groovy/lang/Closure.java
index 7a0ee4d..d59744d 100644
--- a/src/main/groovy/groovy/lang/Closure.java
+++ b/src/main/groovy/groovy/lang/Closure.java
@@ -491,7 +491,7 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
      * <p>
      * Typical usage:
      * <pre class="groovyTestCase">
-     * def multiply = { a, b -> a * b }
+     * def multiply = { a, b {@code ->} a * b }
      * def doubler = multiply.curry(2)
      * assert doubler(4) == 8
      * </pre>
@@ -499,7 +499,7 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
      * If you curry a vararg parameter, you don't consume the entire vararg array
      * but instead the first parameter of the vararg array as the following example shows:
      * <pre class="groovyTestCase">
-     * def a = { one, two, Object[] others -> one + two + others.sum() }
+     * def a = { one, two, Object[] others {@code ->} one + two + others.sum() }
      * assert a.parameterTypes.name == ['java.lang.Object', 'java.lang.Object', '[Ljava.lang.Object;']
      * assert a(1,2,3,4) == 10
      * def b = a.curry(1)
@@ -541,7 +541,7 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
      * Parameters are supplied on the right rather than left as per the normal curry() method.
      * Typical usage:
      * <pre class="groovyTestCase">
-     * def divide = { a, b -> a / b }
+     * def divide = { a, b {@code ->} a / b }
      * def halver = divide.rcurry(2)
      * assert halver(8) == 4
      * </pre>
@@ -574,20 +574,20 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
      * Parameters are supplied from index position "n".
      * Typical usage:
      * <pre>
-     * def caseInsensitive = { a, b -> a.toLowerCase() <=> b.toLowerCase() } as Comparator
-     * def caseSensitive = { a, b -> a <=> b } as Comparator
+     * def caseInsensitive = { a, b {@code ->} a.toLowerCase() {@code <=>} b.toLowerCase() } as Comparator
+     * def caseSensitive = { a, b {@code ->} a {@code <=>} b } as Comparator
      * def animals1 = ['ant', 'dog', 'BEE']
      * def animals2 = animals1 + ['Cat']
      * // curry middle param of this utility method:
      * // Collections#binarySearch(List list, Object key, Comparator c)
-     * def catSearcher = Collections.&binarySearch.ncurry(1, "cat")
-     * [[animals1, animals2], [caseInsensitive, caseSensitive]].combinations().each{ a, c ->
+     * {@code def catSearcher = Collections.&binarySearch.ncurry(1, "cat")}
+     * [[animals1, animals2], [caseInsensitive, caseSensitive]].combinations().each{ a, c {@code ->}
      *   def idx = catSearcher(a.sort(c), c)
      *   print a.sort(c).toString().padRight(22)
-     *   if (idx < 0) println "Not found but would belong in position ${-idx - 1}"
+     *   {@code if (idx < 0) println "Not found but would belong in position ${-idx - 1}"}
      *   else println "Found at index $idx"
      * }
-     * // =>
+     * // {@code =>}
      * // [ant, BEE, dog]       Not found but would belong in position 2
      * // [ant, BEE, Cat, dog]  Found at index 2
      * // [BEE, ant, dog]       Not found but would belong in position 2
@@ -623,10 +623,10 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
      * <p>
      * Typical usage:
      * <pre class="groovyTestCase">
-     * def times2 = { a -> a * 2 }
-     * def add3 = { a -> a + 3 }
-     * def timesThenAdd = times2 >> add3
-     * // equivalent: timesThenAdd = { a -> add3(times2(a)) }
+     * def times2 = { a {@code ->} a * 2 }
+     * def add3 = { a {@code ->} a + 3 }
+     * def timesThenAdd = times2 {@code >>} add3
+     * // equivalent: timesThenAdd = { a {@code ->} add3(times2(a)) }
      * assert timesThenAdd(3) == 9
      * </pre>
      *
@@ -642,10 +642,10 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
      * <p>
      * Typical usage:
      * <pre class="groovyTestCase">
-     * def times2 = { a -> a * 2 }
-     * def add3 = { a -> a + 3 }
-     * def addThenTimes = times2 << add3
-     * // equivalent: addThenTimes = { a -> times2(add3(a)) }
+     * def times2 = { a {@code ->} a * 2 }
+     * def add3 = { a {@code ->} a + 3 }
+     * def addThenTimes = times2 {@code <<} add3
+     * // equivalent: addThenTimes = { a {@code ->} times2(add3(a)) }
      * assert addThenTimes(3) == 12
      * </pre>
      *
@@ -661,9 +661,9 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
      * <p>
      * Typical usage:
      * <pre class="groovyTestCase">
-     * def times2 = { a -> a * 2 }
-     * def add3 = { a -> a * 3 }
-     * assert add3 << times2 << 3 == 9
+     * def times2 = { a {@code ->} a * 2 }
+     * def add3 = { a {@code ->} a * 3 }
+     * assert add3 {@code <<} times2 {@code <<} 3 == 9
      * </pre>
      *
      * @param arg the argument to call the closure with
@@ -782,11 +782,11 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
      * Here is an example:
      * <pre>
      * def fact
-     * fact = { n, total ->
+     * fact = { n, total {@code ->}
      *     n == 0 ? total : fact.trampoline(n - 1, n * total)
      * }.trampoline()
-     * def factorial = { n -> fact(n, 1G)}
-     * println factorial(20) // => 2432902008176640000
+     * def factorial = { n {@code ->} fact(n, 1G)}
+     * println factorial(20) // {@code =>} 2432902008176640000
      * </pre>
      *
      * @param args Parameters to the closure, so as the trampoline mechanism can call it
diff --git a/src/main/groovy/groovy/lang/ExpandoMetaClass.java b/src/main/groovy/groovy/lang/ExpandoMetaClass.java
index 63dba12..a4482c2 100644
--- a/src/main/groovy/groovy/lang/ExpandoMetaClass.java
+++ b/src/main/groovy/groovy/lang/ExpandoMetaClass.java
@@ -63,25 +63,25 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
  * Some examples of usage:
  * <pre>
  * // defines or replaces instance method:
- * metaClass.myMethod = { args -> }
+ * metaClass.myMethod = { args {@code ->} }
  *
  * // defines a new instance method
- * metaClass.myMethod << { args -> }
+ * metaClass.myMethod {@code <<} { args {@code ->} }
  *
  * // creates multiple overloaded methods of the same name
- * metaClass.myMethod << { String s -> } << { Integer i -> }
+ * metaClass.myMethod {@code <<} { String s {@code ->} } {@code <<} { Integer i {@code ->} }
  *
  * // defines or replaces a static method with the 'static' qualifier
- * metaClass.'static'.myMethod = { args ->  }
+ * metaClass.'static'.myMethod = { args {@code ->}  }
  *
  * // defines a new static method with the 'static' qualifier
- * metaClass.'static'.myMethod << { args ->  }
+ * metaClass.'static'.myMethod {@code <<} { args {@code ->}  }
  *
  * // defines a new constructor
- * metaClass.constructor << { String arg -> }
+ * metaClass.constructor {@code <<} { String arg {@code ->} }
  *
  * // defines or replaces a constructor
- * metaClass.constructor = { String arg -> }
+ * metaClass.constructor = { String arg {@code ->} }
  *
  * // defines a new property with an initial value of "blah"
  * metaClass.myProperty = "blah"
@@ -89,14 +89,14 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
  * <p>
  * ExpandoMetaClass also supports a DSL/builder like notation to combine multiple definitions together. So instead of this:
  * <pre>
- * Number.metaClass.multiply = { Amount amount -> amount.times(delegate) }
- * Number.metaClass.div =      { Amount amount -> amount.inverse().times(delegate) }
+ * Number.metaClass.multiply = { Amount amount {@code ->} amount.times(delegate) }
+ * Number.metaClass.div =      { Amount amount {@code ->} amount.inverse().times(delegate) }
  * </pre>
  * You can also now do this:
  * <pre>
  * Number.metaClass {
- *     multiply { Amount amount -> amount.times(delegate) }
- *     div      { Amount amount -> amount.inverse().times(delegate) }
+ *     multiply { Amount amount {@code ->} amount.times(delegate) }
+ *     div      { Amount amount {@code ->} amount.inverse().times(delegate) }
  * }
  * </pre>
  * <p>
@@ -138,12 +138,12 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
  * <pre>
  * class Student {
  *     List<String> schedule = []
- *     def addLecture(String lecture) { schedule << lecture }
+ *     def addLecture(String lecture) { schedule {@code <<} lecture }
  * }
  *
  * class Worker {
  *     List<String> schedule = []
- *     def addMeeting(String meeting) { schedule << meeting }
+ *     def addMeeting(String meeting) { schedule {@code <<} meeting }
  * }
  * </pre>
  * We can mimic a form of multiple inheritance as follows:
@@ -198,16 +198,16 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
  * ndq.metaClass {
  *     mixin ArrayDeque
  *     mixin HashSet
- *     leftShift = { Object o ->
+ *     leftShift = { Object o  {@code ->} 
  *         if (!mixedIn[Set].contains(o)) {
  *             mixedIn[Queue].push(o)
  *             mixedIn[Set].add(o)
  *         }
  *     }
  * }
- * ndq << 1
- * ndq << 2
- * ndq << 1
+ * ndq {@code <<} 1
+ * ndq {@code <<} 2
+ * ndq {@code <<} 1
  * assert ndq.size() == 2
  * </pre>
  * As a final example, we sometimes need to pass such mixed in classes or objects
@@ -232,8 +232,8 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
  * o.metaClass.mixin CustomComparator, CustomCloseable
  * def items = ['a', 'bbb', 'cc']
  * sort(items, o as Comparator)
- * println items                // => [a, cc, bbb]
- * closeQuietly(o as Closeable) // => Lights out - I am closing
+ * println items                // {@code =>} [a, cc, bbb]
+ * closeQuietly(o as Closeable) // {@code =>} Lights out - I am closing
  * </pre>
  * <p>
  * <b>Further details</b>
@@ -559,11 +559,11 @@ public class ExpandoMetaClass extends MetaClassImpl implements GroovyObject {
     }
 
     /**
-     * Instances of this class are returned when using the << left shift operator.
+     * Instances of this class are returned when using the {@code <<} left shift operator.
      * <p>
      * Example:
      * <p>
-     * metaClass.myMethod << { String args -> }
+     * metaClass.myMethod {@code <<} { String args {@code ->} }
      * <p>
      * This allows callbacks to the ExpandoMetaClass for registering appending methods
      */
diff --git a/src/main/groovy/groovy/lang/GrabConfig.java b/src/main/groovy/groovy/lang/GrabConfig.java
index e6b8980..015dd96 100644
--- a/src/main/groovy/groovy/lang/GrabConfig.java
+++ b/src/main/groovy/groovy/lang/GrabConfig.java
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
  * <p>
  * An example involving databases:
  * <pre>
- * {@code @Grab}('mysql:mysql-connector-java:5.1.6'),
+ * {@code @Grab}('mysql:mysql-connector-java:5.1.6')
  * {@code @GrabConfig}(systemClassLoader=true)
  * import groovy.sql.Sql
  *
@@ -37,9 +37,10 @@ import java.lang.annotation.Target;
  * </pre>
  * Another example involving XStream:
  * <pre>
- * {@code @Grab}('com.thoughtworks.xstream:xstream:1.4.9'),
- * {@code @Grab}('xpp3:xpp3_min:1.1.4c'),
+ * {@code @Grab}('com.thoughtworks.xstream:xstream:1.4.9')
+ * {@code @Grab}('xpp3:xpp3_min:1.1.4c')
  * {@code @GrabConfig}(systemClassLoader=true, initContextClassLoader=true)
+ * {@code
  * import com.thoughtworks.xstream.*
  *
  * class Staff {
@@ -63,6 +64,7 @@ import java.lang.annotation.Target;
  * }
  *
  * println john2.dump()
+ * }
  * </pre>
  * <p>
  * Further information about customising grape behavior can be found on the Grape documentation page:
diff --git a/src/main/groovy/groovy/lang/Range.java b/src/main/groovy/groovy/lang/Range.java
index 99f30de..0273341 100644
--- a/src/main/groovy/groovy/lang/Range.java
+++ b/src/main/groovy/groovy/lang/Range.java
@@ -33,7 +33,7 @@ import java.util.List;
  *
  * Particular range implementations may also support the notion of inclusivity
  * and exclusivity with respect to the ending value in the range.
- * E.g. <code>1..3 == [1, 2, 3]</code>; but <code>1..<3 == [1, 2]</code>.
+ * E.g. {@code 1..3 == [1, 2, 3]}; but {@code 1..<3 == [1, 2]}.
  *
  * In general, the second boundary may not be contained in the range,
  * and <code>a..b</code> may produce a different set of elements than <code>(b..a).reversed()</code>.
diff --git a/src/main/groovy/groovy/transform/builder/InitializerStrategy.java b/src/main/groovy/groovy/transform/builder/InitializerStrategy.java
index 6cd72bd..cedd884 100644
--- a/src/main/groovy/groovy/transform/builder/InitializerStrategy.java
+++ b/src/main/groovy/groovy/transform/builder/InitializerStrategy.java
@@ -106,7 +106,9 @@ import static org.objectweb.asm.Opcodes.ACC_SYNTHETIC;
  * </pre>
  * then the following compile-time error would result:
  * <pre>
- * [Static type checking] - Cannot find matching method Person#<init>(Person$PersonInitializer <groovy.transform.builder.InitializerStrategy$SET, groovy.transform.builder.InitializerStrategy$SET, groovy.transform.builder.InitializerStrategy$UNSET>). Please check if the declared type is right and if the method exists.
+ * {@code
+ * [Static type checking] - Cannot find matching method Person#<init>(Person$PersonInitializer <groovy.transform.builder.InitializerStrategy$SET, groovy.transform.builder.InitializerStrategy$SET, groovy.transform.builder.InitializerStrategy$UNSET>). Please check if the declared type is correct and if the method exists.
+ * }
  * </pre>
  * The message is a little cryptic, but it is basically the static compiler telling us that the third parameter, {@code age} in our case, is unset.
  *
diff --git a/src/main/java/org/codehaus/groovy/ast/expr/ClosureExpression.java b/src/main/java/org/codehaus/groovy/ast/expr/ClosureExpression.java
index e2b2aee..5960e00 100644
--- a/src/main/java/org/codehaus/groovy/ast/expr/ClosureExpression.java
+++ b/src/main/java/org/codehaus/groovy/ast/expr/ClosureExpression.java
@@ -27,8 +27,8 @@ import org.codehaus.groovy.ast.stmt.Statement;
 import org.codehaus.groovy.runtime.InvokerHelper;
 
 /**
- * Represents a closure expression such as { statement }
- * or { i -> statement } or { i, x, String y ->  statement }
+ * Represents a closure expression such as <pre>{ statement }</pre>
+ * or { i {@code ->} statement } or { i, x, String y {@code ->}  statement }
  */
 public class ClosureExpression extends Expression {
     
diff --git a/src/main/java/org/codehaus/groovy/ast/expr/MethodPointerExpression.java b/src/main/java/org/codehaus/groovy/ast/expr/MethodPointerExpression.java
index f4d2422..c5f4fb9 100644
--- a/src/main/java/org/codehaus/groovy/ast/expr/MethodPointerExpression.java
+++ b/src/main/java/org/codehaus/groovy/ast/expr/MethodPointerExpression.java
@@ -25,8 +25,8 @@ import org.codehaus.groovy.ast.GroovyCodeVisitor;
 
 /**
  * Represents a method pointer on an object such as
- * foo.&bar which means find the method pointer on foo for the method called "bar"
- * which is equivalent to
+ * {@code foo.&bar} which means find the method pointer for the {@code bar} method on the {@code foo} instance.
+ * This is equivalent to:
  * <code>
  * foo.metaClass.getMethodPointer(foo, "bar")
  * </code>
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/MethodCallerMultiAdapter.java b/src/main/java/org/codehaus/groovy/classgen/asm/MethodCallerMultiAdapter.java
index 1802028..608e737 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/MethodCallerMultiAdapter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/MethodCallerMultiAdapter.java
@@ -1,83 +1,83 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.codehaus.groovy.classgen.asm;
-
-import org.objectweb.asm.MethodVisitor;
-
-public class MethodCallerMultiAdapter {
-    private MethodCaller[] methods;
-    boolean skipSpreadSafeAndSafe;
-
-    public static final int MAX_ARGS = 0;
-
-    public static MethodCallerMultiAdapter newStatic(Class theClass, String baseName, boolean createNArgs, boolean skipSpreadSafeAndSafe) {
-        MethodCallerMultiAdapter mcma = new MethodCallerMultiAdapter();
-        mcma.skipSpreadSafeAndSafe = skipSpreadSafeAndSafe;
-        if (createNArgs) {
-            int numberOfBaseMethods = mcma.numberOfBaseMethods();
-            mcma.methods = new MethodCaller[(MAX_ARGS + 2) * numberOfBaseMethods];
-            for (int i = 0; i <= MAX_ARGS; i++) {
-                mcma.methods[i * numberOfBaseMethods] = MethodCaller.newStatic(theClass, baseName + i);
-                if (skipSpreadSafeAndSafe) continue;
-                mcma.methods[i * numberOfBaseMethods + 1] = MethodCaller.newStatic(theClass, baseName + i + "Safe");
-                mcma.methods[i * numberOfBaseMethods + 2] = MethodCaller.newStatic(theClass, baseName + i + "SpreadSafe");
-            }
-            mcma.methods[(MAX_ARGS + 1) * numberOfBaseMethods] = MethodCaller.newStatic(theClass, baseName + "N");
-            if (!skipSpreadSafeAndSafe) {
-                mcma.methods[(MAX_ARGS + 1) * numberOfBaseMethods + 1] = MethodCaller.newStatic(theClass, baseName + "N" + "Safe");
-                mcma.methods[(MAX_ARGS + 1) * numberOfBaseMethods + 2] = MethodCaller.newStatic(theClass, baseName + "N" + "SpreadSafe");
-            }
-
-        } else if (!skipSpreadSafeAndSafe) {
-            mcma.methods = new MethodCaller[]{
-                    MethodCaller.newStatic(theClass, baseName),
-                    MethodCaller.newStatic(theClass, baseName + "Safe"),
-                    MethodCaller.newStatic(theClass, baseName + "SpreadSafe")
-            };
-        } else {
-            mcma.methods = new MethodCaller[]{
-                    MethodCaller.newStatic(theClass, baseName)
-            };
-        }
-        return mcma;
-    }
-
-    /**
-     * @param methodVisitor
-     * @param numberOfArguments a value >0 describing how many arguments are additionally used for the method call
-     * @param safe
-     * @param spreadSafe
-     */
-    public void call(MethodVisitor methodVisitor, int numberOfArguments, boolean safe, boolean spreadSafe) {
-        int offset = 0;
-        if (safe && !skipSpreadSafeAndSafe) offset = 1;
-        if (spreadSafe && !skipSpreadSafeAndSafe) offset = 2;
-        if (numberOfArguments > MAX_ARGS || numberOfArguments < 0) {
-            offset += (MAX_ARGS + 1) * numberOfBaseMethods();
-        } else {
-            offset += numberOfArguments * numberOfBaseMethods();
-        }
-        methods[offset].call(methodVisitor);
-    }
-
-    private int numberOfBaseMethods() {
-        if (skipSpreadSafeAndSafe) return 1;
-        return 3;
-    }
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.codehaus.groovy.classgen.asm;
+
+import org.objectweb.asm.MethodVisitor;
+
+public class MethodCallerMultiAdapter {
+    private MethodCaller[] methods;
+    boolean skipSpreadSafeAndSafe;
+
+    public static final int MAX_ARGS = 0;
+
+    public static MethodCallerMultiAdapter newStatic(Class theClass, String baseName, boolean createNArgs, boolean skipSpreadSafeAndSafe) {
+        MethodCallerMultiAdapter mcma = new MethodCallerMultiAdapter();
+        mcma.skipSpreadSafeAndSafe = skipSpreadSafeAndSafe;
+        if (createNArgs) {
+            int numberOfBaseMethods = mcma.numberOfBaseMethods();
+            mcma.methods = new MethodCaller[(MAX_ARGS + 2) * numberOfBaseMethods];
+            for (int i = 0; i <= MAX_ARGS; i++) {
+                mcma.methods[i * numberOfBaseMethods] = MethodCaller.newStatic(theClass, baseName + i);
+                if (skipSpreadSafeAndSafe) continue;
+                mcma.methods[i * numberOfBaseMethods + 1] = MethodCaller.newStatic(theClass, baseName + i + "Safe");
+                mcma.methods[i * numberOfBaseMethods + 2] = MethodCaller.newStatic(theClass, baseName + i + "SpreadSafe");
+            }
+            mcma.methods[(MAX_ARGS + 1) * numberOfBaseMethods] = MethodCaller.newStatic(theClass, baseName + "N");
+            if (!skipSpreadSafeAndSafe) {
+                mcma.methods[(MAX_ARGS + 1) * numberOfBaseMethods + 1] = MethodCaller.newStatic(theClass, baseName + "N" + "Safe");
+                mcma.methods[(MAX_ARGS + 1) * numberOfBaseMethods + 2] = MethodCaller.newStatic(theClass, baseName + "N" + "SpreadSafe");
+            }
+
+        } else if (!skipSpreadSafeAndSafe) {
+            mcma.methods = new MethodCaller[]{
+                    MethodCaller.newStatic(theClass, baseName),
+                    MethodCaller.newStatic(theClass, baseName + "Safe"),
+                    MethodCaller.newStatic(theClass, baseName + "SpreadSafe")
+            };
+        } else {
+            mcma.methods = new MethodCaller[]{
+                    MethodCaller.newStatic(theClass, baseName)
+            };
+        }
+        return mcma;
+    }
+
+    /**
+     * @param methodVisitor
+     * @param numberOfArguments a value &gt; 0 describing how many arguments are additionally used for the method call
+     * @param safe
+     * @param spreadSafe
+     */
+    public void call(MethodVisitor methodVisitor, int numberOfArguments, boolean safe, boolean spreadSafe) {
+        int offset = 0;
+        if (safe && !skipSpreadSafeAndSafe) offset = 1;
+        if (spreadSafe && !skipSpreadSafeAndSafe) offset = 2;
+        if (numberOfArguments > MAX_ARGS || numberOfArguments < 0) {
+            offset += (MAX_ARGS + 1) * numberOfBaseMethods();
+        } else {
+            offset += numberOfArguments * numberOfBaseMethods();
+        }
+        methods[offset].call(methodVisitor);
+    }
+
+    private int numberOfBaseMethods() {
+        if (skipSpreadSafeAndSafe) return 1;
+        return 3;
+    }
 }
\ No newline at end of file
diff --git a/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java b/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
index e623b18..022cbff 100644
--- a/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
@@ -36,7 +36,7 @@ import org.codehaus.groovy.ast.expr.TupleExpression;
  * <ul>
  * <li>class header (class and superclass declaration)</li>
  * <li>arity of type parameters for fields, parameters, local variables</li>
- * <li>invalid diamond &;t;&gt; usage</li>
+ * <li>invalid diamond {@code <>} usage</li>
  * </ul>
  */
 public class GenericsVisitor extends ClassCodeVisitorSupport {
diff --git a/src/main/java/org/codehaus/groovy/control/customizers/builder/InlinedASTCustomizerFactory.java b/src/main/java/org/codehaus/groovy/control/customizers/builder/InlinedASTCustomizerFactory.java
index 66b4f41..9f6afc2 100644
--- a/src/main/java/org/codehaus/groovy/control/customizers/builder/InlinedASTCustomizerFactory.java
+++ b/src/main/java/org/codehaus/groovy/control/customizers/builder/InlinedASTCustomizerFactory.java
@@ -34,7 +34,7 @@ import java.util.Map;
  * <p>
  * Here is an example, which only logs the class name during compilation:
  * <pre>
- * inline(phase:'CONVERSION') { source, context, classNode ->
+ * inline(phase:'CONVERSION') { source, context, classNode {@code ->}
  *     println "visiting $classNode"
  * }
  * </pre>
diff --git a/src/main/java/org/codehaus/groovy/control/customizers/builder/SourceAwareCustomizerFactory.java b/src/main/java/org/codehaus/groovy/control/customizers/builder/SourceAwareCustomizerFactory.java
index e1a4df7..cb02d8a 100644
--- a/src/main/java/org/codehaus/groovy/control/customizers/builder/SourceAwareCustomizerFactory.java
+++ b/src/main/java/org/codehaus/groovy/control/customizers/builder/SourceAwareCustomizerFactory.java
@@ -67,12 +67,12 @@ import java.util.Map;
  *     }
  *
  *     // apply CompileStatic AST annotation on files that do not contain a class named 'Baz'
- *     builder.source(unitValidator: { unit -> !unit.AST.classes.any { it.name == 'Baz' } }) {
+ *     builder.source(unitValidator: { unit {@code ->} !unit.AST.classes.any { it.name == 'Baz' } }) {
  *         ast(CompileStatic)
  *     }
  *
  *     // apply CompileStatic AST annotation on class nodes that end with 'CS'
- *     builder.source(classValidator: { cn -> cn.name.endsWith('CS') }) {
+ *     builder.source(classValidator: { cn {@code ->} cn.name.endsWith('CS') }) {
  *         ast(CompileStatic)
  *     }
  * </code></pre>
diff --git a/src/main/java/org/codehaus/groovy/runtime/ComposedClosure.java b/src/main/java/org/codehaus/groovy/runtime/ComposedClosure.java
index 52f52cb..588d846 100644
--- a/src/main/java/org/codehaus/groovy/runtime/ComposedClosure.java
+++ b/src/main/java/org/codehaus/groovy/runtime/ComposedClosure.java
@@ -29,29 +29,29 @@ import java.util.List;
  * <p>
  * Typical usages:
  * <pre class="groovyTestCase">
- * def twice = { a -> a * 2 }
- * def inc = { b -> b + 1 }
- * def f = { x -> twice(inc(x)) } // longhand
- * def g = inc >> twice
- * def h = twice << inc
+ * def twice = { a {@code ->} a * 2 }
+ * def inc = { b {@code ->} b + 1 }
+ * def f = { x {@code ->} twice(inc(x)) } // longhand
+ * def g = inc {@code >>} twice
+ * def h = twice {@code <<} inc
  * assert f(10) == 22
  * assert g(10) == 22
  * assert h(10) == 22
  *
  * def s2c = { it.chars[0] }
- * def p = Integer.&toHexString >> s2c >> Character.&toUpperCase
+ * {@code def p = Integer.&toHexString >> s2c >> Character.&toUpperCase}
  * assert p(15) == 'F'
  *
- * def multiply = { a, b -> a * b }
- * def identity = { a -> [a, a] }
- * def sq = identity >> multiply
+ * def multiply = { a, b {@code ->} a * b }
+ * def identity = { a {@code ->} [a, a] }
+ * def sq = identity {@code >>} multiply
  * assert (1..5).collect{ sq(it) } == [1, 4, 9, 16, 25]
  *
- * def add3 = { a, b, c -> a + b + c }
+ * def add3 = { a, b, c {@code ->} a + b + c }
  * def add2plus10 = add3.curry(10)
- * def multBoth = { a, b, c -> [a*c, b*c] }
+ * def multBoth = { a, b, c {@code ->} [a*c, b*c] }
  * def twiceBoth = multBoth.rcurry(2)
- * def twiceBothPlus10 = twiceBoth >> add2plus10
+ * def twiceBothPlus10 = twiceBoth {@code >>} add2plus10
  * assert twiceBothPlus10(5, 10) == 40
  * </pre>
  */
diff --git a/src/main/java/org/codehaus/groovy/runtime/CurriedClosure.java b/src/main/java/org/codehaus/groovy/runtime/CurriedClosure.java
index e9365be..48cbe61 100644
--- a/src/main/java/org/codehaus/groovy/runtime/CurriedClosure.java
+++ b/src/main/java/org/codehaus/groovy/runtime/CurriedClosure.java
@@ -27,7 +27,7 @@ import groovy.lang.Closure;
  * Typical usages:
  * <pre class="groovyTestCase">
  * // normal usage
- * def unitAdder = { first, second, unit -> "${first + second} $unit" }
+ * def unitAdder = { first, second, unit {@code ->} "${first + second} $unit" }
  * assert unitAdder(10, 15, "minutes") == "25 minutes"
  * assert unitAdder.curry(60)(15, "minutes") == "75 minutes"
  * def minuteAdder = unitAdder.rcurry("minutes")
diff --git a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
index 8b59d40..1c6cc65 100644
--- a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
+++ b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
@@ -53,7 +53,7 @@ import java.util.Map;
 import java.util.Properties;
 
 /**
- * A registry of MetaClass instances which caches introspection &
+ * A registry of MetaClass instances which caches introspection and
  * reflection information and allows methods to be dynamically added to
  * existing classes at runtime
  */
diff --git a/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy b/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy
index 8fa5546..54900a2 100644
--- a/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy
+++ b/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy
@@ -25,6 +25,8 @@ import java.util.regex.Pattern
  * the Javadoc comments of a source file. Assertions should be placed within an html tag with a <code>class="groovyTestCase"</code>
  * attribute assignment. Example:
  * <pre>&lt;pre class="groovyTestCase"&gt; assert "example".size() == 7 &lt;/pre&gt;</pre>
+ * When extracting the code for the test, single-line snippets of code without braces within a {{@code @code} ...}
+ * tag will have the javadoc {@code code} tag stripped.
  */
 class JavadocAssertionTestBuilder {
     // TODO write tests for this classes functionality
@@ -36,7 +38,7 @@ class JavadocAssertionTestBuilder {
     Class buildTest(String filename, String code) {
         Class test = null
         
-        List assertionTags = getAssertionTags(code);
+        List assertionTags = getAssertionTags(code)
         if (assertionTags) {
             String testName = getTestName(filename)
 
diff --git a/subprojects/groovy-test/src/main/groovy/groovy/util/StringTestUtil.groovy b/subprojects/groovy-test/src/main/groovy/groovy/util/StringTestUtil.groovy
index b9bb855..0a575c4 100644
--- a/subprojects/groovy-test/src/main/groovy/groovy/util/StringTestUtil.groovy
+++ b/subprojects/groovy-test/src/main/groovy/groovy/util/StringTestUtil.groovy
@@ -1,32 +1,32 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util
-
-import org.junit.Assert
-
-class StringTestUtil {
-    static void assertMultilineStringsEqual(String a, String b) {
-        def aLines = a.trim().replaceAll('\r','').split('\n')
-        def bLines = b.trim().replaceAll('\r','').split('\n')
-        assert aLines.size() == bLines.size()
-        for (i in 0..<aLines.size()) {
-            Assert.assertEquals(aLines[i].trim(), bLines[i].trim())
-        }
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.util
+
+import org.junit.Assert
+
+class StringTestUtil {
+    static void assertMultilineStringsEqual(String a, String b) {
+        def aLines = a.trim().replaceAll('\r','').split('\n')
+        def bLines = b.trim().replaceAll('\r','').split('\n')
+        assert aLines.size() == bLines.size()
+        for (i in 0..<aLines.size()) {
+            Assert.assertEquals(aLines[i].trim(), bLines[i].trim())
+        }
+    }
+}


[groovy] 05/06: minor refactor: remove javadoc warnings (cont'd 2)

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit b64ff97ffd0a12b3a66f66e6d9213d28f0da1656
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Apr 27 17:15:53 2019 +1000

    minor refactor: remove javadoc warnings (cont'd 2)
---
 gradle/docs.gradle                                 |   5 +
 src/main/groovy/groovy/transform/AutoFinal.java    |   4 +-
 .../groovy/groovy/transform/EqualsAndHashCode.java |  16 +-
 src/main/groovy/groovy/transform/Memoized.java     |   2 +-
 .../groovy/transform/stc/MapEntryOrKeyValue.java   |   6 +-
 .../groovy/transform/stc/PickAnyArgumentHint.java  |   2 +-
 src/main/groovy/groovy/util/IndentPrinter.java     |   2 +-
 .../groovy/ast/tools/WideningCategories.java       |   2 +-
 .../groovy/runtime/DefaultGroovyMethods.java       | 356 +++++++++++----------
 .../codehaus/groovy/runtime/IOGroovyMethods.java   |   4 +-
 .../groovy/runtime/ResourceGroovyMethods.java      |  16 +-
 .../groovy/runtime/StringGroovyMethods.java        |  44 +--
 .../java/org/codehaus/groovy/tools/RootLoader.java |  15 +-
 .../transform/stc/StaticTypeCheckingSupport.java   |   2 +-
 14 files changed, 247 insertions(+), 229 deletions(-)

diff --git a/gradle/docs.gradle b/gradle/docs.gradle
index d8d3c66..1e1c260 100644
--- a/gradle/docs.gradle
+++ b/gradle/docs.gradle
@@ -76,6 +76,10 @@ allprojects {
     groovydoc groovydocSpec
 }
 
+javadoc {
+    exclude '**/GroovyRecognizer.java' // generated file
+}
+
 evaluationDependsOn('groovy-jaxb')
 
 // Root project has an extra 'all' javadoc task
@@ -88,6 +92,7 @@ javadocAll {
         source += sp.javadoc.source
         classpath += sp.javadoc.classpath
     }
+    exclude '**/GroovyRecognizer.java' // generated file
 }
 javadocAll javadocSpec
 
diff --git a/src/main/groovy/groovy/transform/AutoFinal.java b/src/main/groovy/groovy/transform/AutoFinal.java
index 58ce3ba..cd1d9c8 100644
--- a/src/main/groovy/groovy/transform/AutoFinal.java
+++ b/src/main/groovy/groovy/transform/AutoFinal.java
@@ -53,7 +53,7 @@ import java.lang.annotation.Target;
  *         this.last = last
  *     }
  *     String fullName(boolean reversed = false, String separator = ' ') {
- *         final concatCls = { String n0, String n1 -> "$n0$separator$n1" }
+ *         final concatCls = { String n0, String n1 {@code ->} "$n0$separator$n1" }
  *         concatCls(reversed ? last : first, reversed ? first : last)
  *     }
  * }
@@ -77,7 +77,7 @@ import java.lang.annotation.Target;
  * </pre>
  * and the closure will have become:
  * <pre>
- * { final String n0, final String n1 -> "$n0$separator$n1" }
+ * { final String n0, final String n1 {@code ->} "$n0$separator$n1" }
  * </pre>
  *
  * @since 2.5.0
diff --git a/src/main/groovy/groovy/transform/EqualsAndHashCode.java b/src/main/groovy/groovy/transform/EqualsAndHashCode.java
index 51e480d..20e0783 100644
--- a/src/main/groovy/groovy/transform/EqualsAndHashCode.java
+++ b/src/main/groovy/groovy/transform/EqualsAndHashCode.java
@@ -99,9 +99,9 @@ import java.lang.annotation.Target;
  *
  * def p3 = new IntPairWithSum(1, 2)
  *
- * assert p1 == p2 && p2 == p1
- * assert p1 == p3 && p3 == p1
- * assert p3 == p2 && p2 == p3
+ * assert p1 == p2 {@code &&} p2 == p1
+ * assert p1 == p3 {@code &&} p3 == p1
+ * assert p3 == p2 {@code &&} p2 == p3
  * </pre>
  * Note that if you create any domain classes which don't have exactly the
  * same contract as <code>IntPair</code> then you should provide an appropriate
@@ -113,7 +113,7 @@ import java.lang.annotation.Target;
  * {@code @TupleConstructor(includeSuperProperties=true)}
  * class IntTriple extends IntPair { int z }
  * def t1 = new IntTriple(1, 2, 3)
- * assert p1 != t1 && p2 != t1 && t1 != p3
+ * assert p1 != t1 {@code &&} p2 != t1 {@code &&} t1 != p3
  * </pre>
  *
  * The alternative supported style regards any kind of inheritance as creation of
@@ -150,13 +150,13 @@ import java.lang.annotation.Target;
  * e.g. for comparing instances of the <code>IntPair</code> and <code>IntTriple</code> classes
  * discussed earlier, you could provide the following method in <code>IntPair</code>:
  * <pre>
- * boolean hasEqualXY(other) { other.x == getX() && other.y == getY() }
+ * boolean hasEqualXY(other) { other.x == getX() {@code &&} other.y == getY() }
  * </pre>
  * Then for the objects defined earlier, the following would be true:
  * <pre>
- * assert p1.hasEqualXY(t1) && t1.hasEqualXY(p1)
- * assert p2.hasEqualXY(t1) && t1.hasEqualXY(p2)
- * assert p3.hasEqualXY(t1) && t1.hasEqualXY(p3)
+ * assert p1.hasEqualXY(t1) {@code &&} t1.hasEqualXY(p1)
+ * assert p2.hasEqualXY(t1) {@code &&} t1.hasEqualXY(p2)
+ * assert p3.hasEqualXY(t1) {@code &&} t1.hasEqualXY(p3)
  * </pre>
  * There is also support for including or excluding fields/properties by name when constructing
  * the equals and hashCode methods as shown here:
diff --git a/src/main/groovy/groovy/transform/Memoized.java b/src/main/groovy/groovy/transform/Memoized.java
index 5bd1dc1..051cd81 100644
--- a/src/main/groovy/groovy/transform/Memoized.java
+++ b/src/main/groovy/groovy/transform/Memoized.java
@@ -49,7 +49,7 @@ import java.lang.annotation.Target;
  * <pre>
  * class MemoizedExample {
  * 
- *     private final Closure memoizedSum = { int n1, int n2 ->
+ *     private final Closure memoizedSum = { int n1, int n2 {@code ->}
  *         private$method$memoizedSum(n1,n2)
  *     }.memoize()
  * 
diff --git a/src/main/groovy/groovy/transform/stc/MapEntryOrKeyValue.java b/src/main/groovy/groovy/transform/stc/MapEntryOrKeyValue.java
index 9316ef8..a53d14e 100644
--- a/src/main/groovy/groovy/transform/stc/MapEntryOrKeyValue.java
+++ b/src/main/groovy/groovy/transform/stc/MapEntryOrKeyValue.java
@@ -37,9 +37,9 @@ import java.util.Map;
  * or on a key,value pair.</p>
  * <p>The result is a closure which can have the following forms:</p>
  * <ul>
- *     <li><code>{ key, value -> ...}</code> where key is the key of a map entry, and value the corresponding value</li>
- *     <li><code>{ entry -> ... }</code> where entry is a {@link java.util.Map.Entry} map entry</li>
- *     <li><code>{ ...}</code> where <i>it</i> is an implicit {@link java.util.Map.Entry} map entry</li>
+ *     <li><code>{ key, value {@code ->} ... }</code> where key is the key of a map entry, and value the corresponding value</li>
+ *     <li><code>{ entry {@code ->} ... }</code> where entry is a {@link java.util.Map.Entry} map entry</li>
+ *     <li><code>{ ... }</code> where <i>it</i> is an implicit {@link java.util.Map.Entry} map entry</li>
  * </ul>
  * <p>This hint handles all those cases by picking the generics from the first argument of the method (by default).</p>
  * <p>The options array is used to modify the behavior of this hint. Each string in the option array consists of
diff --git a/src/main/groovy/groovy/transform/stc/PickAnyArgumentHint.java b/src/main/groovy/groovy/transform/stc/PickAnyArgumentHint.java
index 0f4d92f..34b58f0 100644
--- a/src/main/groovy/groovy/transform/stc/PickAnyArgumentHint.java
+++ b/src/main/groovy/groovy/transform/stc/PickAnyArgumentHint.java
@@ -29,7 +29,7 @@ import org.codehaus.groovy.control.SourceUnit;
  * This can optionally use a generic type of the selected parameter as the hint. For example, imagine the following
  * method:</p>
  * <code>void foo(A firstArg, B secondArg, Closure c) {...}</code>
- * <p>If the <i>c</i> closure should be <code>{ B it -> ...}</code>, then we can see that the parameter type
+ * <p>If the <i>c</i> closure should be <code>{ B it {@code ->} ...}</code>, then we can see that the parameter type
  * should be picked from the second parameter of the foo method, which is what {@link groovy.transform.stc.PickAnyArgumentHint}
  * lets you do.</p>
  * <p>Alternatively, the method may look like this:</p>
diff --git a/src/main/groovy/groovy/util/IndentPrinter.java b/src/main/groovy/groovy/util/IndentPrinter.java
index ccbec0f..e79d4bb 100644
--- a/src/main/groovy/groovy/util/IndentPrinter.java
+++ b/src/main/groovy/groovy/util/IndentPrinter.java
@@ -36,7 +36,7 @@ import java.io.Writer;
  * The following is an example usage. Note that within a "with" block you need to
  * specify a parameter name so that this.println is not called instead of IndentPrinter.println:
  * <pre>
- * new IndentPrinter(new PrintWriter(out)).with { p ->
+ * new IndentPrinter(new PrintWriter(out)).with { p {@code ->}
  *     p.printIndent()
  *     p.println('parent1')
  *     p.incrementIndent()
diff --git a/src/main/java/org/codehaus/groovy/ast/tools/WideningCategories.java b/src/main/java/org/codehaus/groovy/ast/tools/WideningCategories.java
index 2e4f71d..4f3bba6 100644
--- a/src/main/java/org/codehaus/groovy/ast/tools/WideningCategories.java
+++ b/src/main/java/org/codehaus/groovy/ast/tools/WideningCategories.java
@@ -583,7 +583,7 @@ public class WideningCategories {
     /**
      * This {@link ClassNode} specialization is used when the lowest upper bound of two types
      * cannot be represented by an existing type. For example, if B extends A,  C extends A
-     * and both C & B implement a common interface not implemented by A, then we use this class
+     * and both C and B implement a common interface not implemented by A, then we use this class
      * to represent the bound.
      *
      * At compile time, some classes like {@link org.codehaus.groovy.classgen.AsmClassGenerator} need
diff --git a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
index 8d6097f..a86a819 100644
--- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@@ -1061,7 +1061,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * @param self any Object
      * @return a String that matches what would be typed into a terminal to
-     *         create this object. e.g. [1, 'hello'].inspect() -> [1, "hello"]
+     *         create this object. e.g. [1, 'hello'].inspect() {@code ->} [1, "hello"]
      * @since 1.0
      */
     public static String inspect(Object self) {
@@ -1375,7 +1375,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * will be passed as arguments, and the closure should return an
      * int value (with 0 indicating the items are not unique).
      * <pre class="groovyTestCase">assert [1,4] == [1,3,4,5].unique { it % 2 }</pre>
-     * <pre class="groovyTestCase">assert [2,3,4] == [2,3,3,4].unique { a, b -> a <=> b }</pre>
+     * <pre class="groovyTestCase">assert [2,3,4] == [2,3,3,4].unique { a, b {@code ->} a {@code <=>} b }</pre>
      *
      * @param self    a Collection
      * @param closure a 1 or 2 arg Closure used to determine unique items
@@ -1399,7 +1399,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * will be passed as arguments, and the closure should return an
      * int value (with 0 indicating the items are not unique).
      * <pre class="groovyTestCase">assert [1,4] == [1,3,4,5].unique { it % 2 }</pre>
-     * <pre class="groovyTestCase">assert [2,3,4] == [2,3,3,4].unique { a, b -> a <=> b }</pre>
+     * <pre class="groovyTestCase">assert [2,3,4] == [2,3,3,4].unique { a, b {@code ->} a {@code <=>} b }</pre>
      *
      * @param self    a List
      * @param closure a 1 or 2 arg Closure used to determine unique items
@@ -1427,7 +1427,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * </pre>
      * <pre class="groovyTestCase">
      * def orig = [2, 3, 3, 4]
-     * def uniq = orig.unique(false) { a, b -> a <=> b }
+     * def uniq = orig.unique(false) { a, b {@code ->} a {@code <=>} b }
      * assert orig == [2, 3, 3, 4]
      * assert uniq == [2, 3, 4]
      * </pre>
@@ -1465,7 +1465,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * </pre>
      * <pre class="groovyTestCase">
      * def orig = [2, 3, 3, 4]
-     * def uniq = orig.unique(false) { a, b -> a <=> b }
+     * def uniq = orig.unique(false) { a, b {@code ->} a {@code <=>} b }
      * assert orig == [2, 3, 3, 4]
      * assert uniq == [2, 3, 4]
      * </pre>
@@ -1545,7 +1545,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * def list = [a, b, c, d]
      * List list2 = list.unique(new PersonComparator())
-     * assert( list2 == list && list == [a, b, c] )
+     * assert( list2 == list {@code &&} list == [a, b, c] )
      * </pre>
      *
      * @param self       a Collection
@@ -1596,7 +1596,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * def list = [a, b, c, d]
      * List list2 = list.unique(new PersonComparator())
-     * assert( list2 == list && list == [a, b, c] )
+     * assert( list2 == list {@code &&} list == [a, b, c] )
      * </pre>
      *
      * @param self       a List
@@ -1647,7 +1647,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * def list = [a, b, c, d]
      * List list2 = list.unique(false, new PersonComparator())
-     * assert( list2 != list && list2 == [a, b, c] )
+     * assert( list2 != list {@code &&} list2 == [a, b, c] )
      * </pre>
      *
      * @param self       a Collection
@@ -1719,7 +1719,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * def list = [a, b, c, d]
      * List list2 = list.unique(false, new PersonComparator())
-     * assert( list2 != list && list2 == [a, b, c] )
+     * assert( list2 != list {@code &&} list2 == [a, b, c] )
      * </pre>
      *
      * @param self       a List
@@ -1749,7 +1749,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * assert noDups == ['H', 'e', 'l', 'o', null, 't', 'r']
      * </pre>
      * <pre class="groovyTestCase">assert [1,4] == [1,3,4,5].toUnique { it % 2 }</pre>
-     * <pre class="groovyTestCase">assert [2,3,4] == [2,3,3,4].toUnique { a, b -> a <=> b }</pre>
+     * <pre class="groovyTestCase">assert [2,3,4] == [2,3,3,4].toUnique { a, b {@code ->} a {@code <=>} b }</pre>
      *
      * @param self an Iterator
      * @param condition a Closure used to determine unique items
@@ -1864,7 +1864,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * def list = [a, b, c, d]
      * List list2 = list.toUnique(new PersonComparator())
-     * assert list2 == [a, b, c] && list == [a, b, c, d]
+     * assert list2 == [a, b, c] {@code &&} list == [a, b, c, d]
      * </pre>
      *
      * @param self       an Iterable
@@ -1915,7 +1915,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * def list = [a, b, c, d]
      * List list2 = list.toUnique(new PersonComparator())
-     * assert list2 == [a, b, c] && list == [a, b, c, d]
+     * assert list2 == [a, b, c] {@code &&} list == [a, b, c, d]
      * </pre>
      *
      * @param self       a List
@@ -1989,10 +1989,10 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Person d = new Person(fname:"Clark", lname:"Taylor")
      *
      * def list = [a, b, c, d]
-     * def list2 = list.toUnique{ p1, p2 -> p1.lname != p2.lname ? p1.lname &lt;=&gt; p2.lname : p1.fname &lt;=&gt; p2.fname }
-     * assert( list2 == [a, b, c] && list == [a, b, c, d] )
+     * def list2 = list.toUnique{ p1, p2 {@code ->} p1.lname != p2.lname ? p1.lname &lt;=&gt; p2.lname : p1.fname &lt;=&gt; p2.fname }
+     * assert( list2 == [a, b, c] {@code &&} list == [a, b, c, d] )
      * def list3 = list.toUnique{ it.toString() }
-     * assert( list3 == [a, b, c] && list == [a, b, c, d] )
+     * assert( list3 == [a, b, c] {@code &&} list == [a, b, c, d] )
      * </pre>
      *
      * @param self      an Iterable
@@ -2033,10 +2033,10 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Person d = new Person(fname:"Clark", lname:"Taylor")
      *
      * def list = [a, b, c, d]
-     * def list2 = list.toUnique{ p1, p2 -> p1.lname != p2.lname ? p1.lname &lt;=&gt; p2.lname : p1.fname &lt;=&gt; p2.fname }
-     * assert( list2 == [a, b, c] && list == [a, b, c, d] )
+     * def list2 = list.toUnique{ p1, p2 {@code ->} p1.lname != p2.lname ? p1.lname &lt;=&gt; p2.lname : p1.fname &lt;=&gt; p2.fname }
+     * assert( list2 == [a, b, c] {@code &&} list == [a, b, c, d] )
      * def list3 = list.toUnique{ it.toString() }
-     * assert( list3 == [a, b, c] && list == [a, b, c, d] )
+     * assert( list3 == [a, b, c] {@code &&} list == [a, b, c, d] )
      * </pre>
      *
      * @param self      a List
@@ -2057,7 +2057,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * String[] letters = ['c', 'a', 't', 's', 'A', 't', 'h', 'a', 'T']
      * String[] lower = ['c', 'a', 't', 's', 'h']
      * class LowerComparator implements Comparator {
-     *     int compare(let1, let2) { let1.toLowerCase() <=> let2.toLowerCase() }
+     *     int compare(let1, let2) { let1.toLowerCase() {@code <=>} let2.toLowerCase() }
      * }
      * assert letters.toUnique(new LowerComparator()) == lower
      * </pre>
@@ -2101,7 +2101,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre class="groovyTestCase">
      * String[] letters = ['c', 'a', 't', 's', 'A', 't', 'h', 'a', 'T']
      * String[] expected = ['c', 'a', 't', 's', 'h']
-     * assert letters.toUnique{ p1, p2 -> p1.toLowerCase() <=> p2.toLowerCase() } == expected
+     * assert letters.toUnique{ p1, p2 {@code ->} p1.toLowerCase() {@code <=>} p2.toLowerCase() } == expected
      * assert letters.toUnique{ it.toLowerCase() } == expected
      * </pre>
      *
@@ -2166,7 +2166,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre class="groovyTestCase">
      * String[] letters = ['a', 'b', 'c']
      * String result = ''
-     * letters.eachWithIndex{ letter, index -> result += "$index:$letter" }
+     * letters.eachWithIndex{ letter, index {@code ->} result += "$index:$letter" }
      * assert result == '0:a1:b2:c'
      * </pre>
      *
@@ -2192,7 +2192,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * zero) to the given closure.
      * <pre class="groovyTestCase">
      * String result = ''
-     * ['a', 'b', 'c'].eachWithIndex{ letter, index -> result += "$index:$letter" }
+     * ['a', 'b', 'c'].eachWithIndex{ letter, index {@code ->} result += "$index:$letter" }
      * assert result == '0:a1:b2:c'
      * </pre>
      *
@@ -2386,10 +2386,10 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * otherwise if the closure takes two parameters then it will be
      * passed the key and the value.
      * <pre class="groovyTestCase">def result = ""
-     * [a:1, b:3].each { key, value -> result += "$key$value" }
+     * [a:1, b:3].each { key, value {@code ->} result += "$key$value" }
      * assert result == "a1b3"</pre>
      * <pre class="groovyTestCase">def result = ""
-     * [a:1, b:3].each { entry -> result += entry }
+     * [a:1, b:3].each { entry {@code ->} result += entry }
      * assert result == "a=1b=3"</pre>
      *
      * In general, the order in which the map contents are processed
@@ -2438,10 +2438,10 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * takes three parameters then it will be passed the key, the value, and
      * the index.
      * <pre class="groovyTestCase">def result = ""
-     * [a:1, b:3].eachWithIndex { key, value, index -> result += "$index($key$value)" }
+     * [a:1, b:3].eachWithIndex { key, value, index {@code ->} result += "$index($key$value)" }
      * assert result == "0(a1)1(b3)"</pre>
      * <pre class="groovyTestCase">def result = ""
-     * [a:1, b:3].eachWithIndex { entry, index -> result += "$index($entry)" }
+     * [a:1, b:3].eachWithIndex { entry, index {@code ->} result += "$index($entry)" }
      * assert result == "0(a=1)1(b=3)"</pre>
      *
      * @param self    the map over which we iterate
@@ -2491,7 +2491,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <code>true</code> for all items in this data structure).
      * A simple example for a list:
      * <pre>def list = [3,4,5]
-     * def greaterThanTwo = list.every { it > 2 }
+     * def greaterThanTwo = list.every { it {@code >} 2 }
      * </pre>
      *
      * @param self      the object over which we iterate
@@ -2508,7 +2508,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <code>true</code> for all items in this iterator).
      * A simple example for a list:
      * <pre>def list = [3,4,5]
-     * def greaterThanTwo = list.iterator().every { it > 2 }
+     * def greaterThanTwo = list.iterator().every { it {@code >} 2 }
      * </pre>
      *
      * @param self      the iterator over which we iterate
@@ -2544,7 +2544,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <code>true</code> for all items in this iterable).
      * A simple example for a list:
      * <pre>def list = [3,4,5]
-     * def greaterThanTwo = list.every { it > 2 }
+     * def greaterThanTwo = list.every { it {@code >} 2 }
      * </pre>
      *
      * @param self      the iterable over which we iterate
@@ -2563,8 +2563,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * otherwise if the closure takes two parameters then it will be
      * passed the key and the value.
      * <pre class="groovyTestCase">def map = [a:1, b:2.0, c:2L]
-     * assert !map.every { key, value -> value instanceof Integer }
-     * assert map.every { entry -> entry.value instanceof Number }</pre>
+     * assert !map.every { key, value {@code ->} value instanceof Integer }
+     * assert map.every { entry {@code ->} entry.value instanceof Number }</pre>
      *
      * @param self      the map over which we iterate
      * @param predicate the 1 or 2 arg Closure predicate used for matching
@@ -2584,7 +2584,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
     /**
      * Iterates over every element of a collection, and checks whether all
      * elements are <code>true</code> according to the Groovy Truth.
-     * Equivalent to <code>self.every({element -> element})</code>
+     * Equivalent to <code>self.every({element {@code ->} element})</code>
      * <pre class="groovyTestCase">
      * assert [true, true].every()
      * assert [1, 1].every()
@@ -2610,7 +2610,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * predicate is valid for at least one element.
      * <pre class="groovyTestCase">
      * assert [1, 2, 3].any { it == 2 }
-     * assert ![1, 2, 3].any { it > 3 }
+     * assert ![1, 2, 3].any { it {@code >} 3 }
      * </pre>
      *
      * @param self      the object over which we iterate
@@ -2627,7 +2627,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * predicate is valid for at least one element.
      * <pre class="groovyTestCase">
      * assert [1, 2, 3].iterator().any { it == 2 }
-     * assert ![1, 2, 3].iterator().any { it > 3 }
+     * assert ![1, 2, 3].iterator().any { it {@code >} 3 }
      * </pre>
      *
      * @param self      the iterator over which we iterate
@@ -2648,7 +2648,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * predicate is valid for at least one element.
      * <pre class="groovyTestCase">
      * assert [1, 2, 3].any { it == 2 }
-     * assert ![1, 2, 3].any { it > 3 }
+     * assert ![1, 2, 3].any { it {@code >} 3 }
      * </pre>
      *
      * @param self      the iterable over which we iterate
@@ -2680,8 +2680,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * otherwise if the closure takes two parameters then it will be
      * passed the key and the value.
      * <pre class="groovyTestCase">
-     * assert [2:3, 4:5, 5:10].any { key, value -> key * 2 == value }
-     * assert ![2:3, 4:5, 5:10].any { entry -> entry.key == entry.value * 2 }
+     * assert [2:3, 4:5, 5:10].any { key, value {@code ->} key * 2 == value }
+     * assert ![2:3, 4:5, 5:10].any { entry {@code ->} entry.key == entry.value * 2 }
      * </pre>
      *
      * @param self      the map over which we iterate
@@ -2702,7 +2702,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
     /**
      * Iterates over the elements of a collection, and checks whether at least
      * one element is true according to the Groovy Truth.
-     * Equivalent to self.any({element -> element})
+     * Equivalent to self.any({element {@code ->} element})
      * <pre class="groovyTestCase">
      * assert [false, true].any()
      * assert [0, 1].any()
@@ -3062,7 +3062,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Otherwise, the closure should take two parameters and will be passed the key and value.
      * <p>
      * Example usage:
-     * <pre class="groovyTestCase">assert [a:1, b:1, c:2, d:2].count{ k,v -> k == 'a' || v == 2 } == 3</pre>
+     * <pre class="groovyTestCase">assert [a:1, b:1, c:2, d:2].count{ k,v {@code ->} k == 'a' {@code ||} v == 2 } == 3</pre>
      *
      * @param self  the map within which we count the number of occurrences
      * @param closure a 1 or 2 arg Closure condition applying on the entries
@@ -3806,7 +3806,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * assert squaresAndCubesOfEvens == [4, 8, 16, 64, 36, 216, 64, 512, 100, 1000]
      *
      * def animals = ['CAT', 'DOG', 'ELEPHANT'] as Set
-     * def smallAnimals = animals.collectMany{ it.size() > 3 ? [] : [it.toLowerCase()] }
+     * def smallAnimals = animals.collectMany{ it.size() {@code >} 3 ? [] : [it.toLowerCase()] }
      * assert smallAnimals == ['cat', 'dog']
      *
      * def orig = nums as Set
@@ -3831,7 +3831,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <p>
      * <pre class="groovyTestCase">
      * def animals = ['CAT', 'DOG', 'ELEPHANT'] as Set
-     * def smallAnimals = animals.collectMany(['ant', 'bee']){ it.size() > 3 ? [] : [it.toLowerCase()] }
+     * def smallAnimals = animals.collectMany(['ant', 'bee']){ it.size() {@code >} 3 ? [] : [it.toLowerCase()] }
      * assert smallAnimals == ['ant', 'bee', 'cat', 'dog']
      *
      * def nums = 1..5
@@ -3858,7 +3858,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <p>
      * <pre class="groovyTestCase">
      * def map = [bread:3, milk:5, butter:2]
-     * def result = map.collectMany(['x']){ k, v -> k.startsWith('b') ? k.toList() : [] }
+     * def result = map.collectMany(['x']){ k, v {@code ->} k.startsWith('b') ? k.toList() : [] }
      * assert result == ['x', 'b', 'r', 'e', 'a', 'd', 'b', 'u', 't', 't', 'e', 'r']
      * </pre>
      *
@@ -3881,7 +3881,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <p>
      * <pre class="groovyTestCase">
      * def map = [bread:3, milk:5, butter:2]
-     * def result = map.collectMany{ k, v -> k.startsWith('b') ? k.toList() : [] }
+     * def result = map.collectMany{ k, v {@code ->} k.startsWith('b') ? k.toList() : [] }
      * assert result == ['b', 'r', 'e', 'a', 'd', 'b', 'u', 't', 't', 'e', 'r']
      * </pre>
      *
@@ -3937,8 +3937,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
     /**
      * Iterates through this Map transforming each map entry into a new value using the <code>transform</code> closure
      * returning the <code>collector</code> with all transformed values added to it.
-     * <pre class="groovyTestCase">assert [a:1, b:2].collect( [] as HashSet ) { key, value -> key*value } == ["a", "bb"] as Set
-     * assert [3:20, 2:30].collect( [] as HashSet ) { entry -> entry.key * entry.value } == [60] as Set</pre>
+     * <pre class="groovyTestCase">assert [a:1, b:2].collect( [] as HashSet ) { key, value {@code ->} key*value } == ["a", "bb"] as Set
+     * assert [3:20, 2:30].collect( [] as HashSet ) { entry {@code ->} entry.key * entry.value } == [60] as Set</pre>
      *
      * @param self      a Map
      * @param collector the Collection to which transformed values are added
@@ -3956,8 +3956,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
     /**
      * Iterates through this Map transforming each map entry into a new value using the <code>transform</code> closure
      * returning a list of transformed values.
-     * <pre class="groovyTestCase">assert [a:1, b:2].collect { key, value -> key*value } == ["a", "bb"]
-     * assert [3:20, 2:30].collect { entry -> entry.key * entry.value } == [60, 60]</pre>
+     * <pre class="groovyTestCase">assert [a:1, b:2].collect { key, value {@code ->} key*value } == ["a", "bb"]
+     * assert [3:20, 2:30].collect { entry {@code ->} entry.key * entry.value } == [60, 60]</pre>
      *
      * @param self    a Map
      * @param transform the transformation closure which can take one (Map.Entry) or two (key, value) parameters
@@ -3972,8 +3972,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Iterates through this Map transforming each map entry using the <code>transform</code> closure
      * returning a map of the transformed entries.
      * <pre class="groovyTestCase">
-     * assert [a:1, b:2].collectEntries( [:] ) { k, v -> [v, k] } == [1:'a', 2:'b']
-     * assert [a:1, b:2].collectEntries( [30:'C'] ) { key, value ->
+     * assert [a:1, b:2].collectEntries( [:] ) { k, v {@code ->} [v, k] } == [1:'a', 2:'b']
+     * assert [a:1, b:2].collectEntries( [30:'C'] ) { key, value {@code ->}
      *     [(value*10): key.toUpperCase()] } == [10:'A', 20:'B', 30:'C']
      * </pre>
      * Note: When using the list-style of result, the behavior is '<code>def (key, value) = listResultFromClosure</code>'.
@@ -4000,8 +4000,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Iterates through this Map transforming each entry using the <code>transform</code> closure
      * and returning a map of the transformed entries.
      * <pre class="groovyTestCase">
-     * assert [a:1, b:2].collectEntries { key, value -> [value, key] } == [1:'a', 2:'b']
-     * assert [a:1, b:2].collectEntries { key, value ->
+     * assert [a:1, b:2].collectEntries { key, value {@code ->} [value, key] } == [1:'a', 2:'b']
+     * assert [a:1, b:2].collectEntries { key, value {@code ->}
      *     [(value*10): key.toUpperCase()] } == [10:'A', 20:'B']
      * </pre>
      * Note: When using the list-style of result, the behavior is '<code>def (key, value) = listResultFromClosure</code>'.
@@ -4050,9 +4050,9 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre class="groovyTestCase">
      * def letters = "abc"
      * // collect letters with index using list style
-     * assert (0..2).collectEntries { index -> [index, letters[index]] } == [0:'a', 1:'b', 2:'c']
+     * assert (0..2).collectEntries { index {@code ->} [index, letters[index]] } == [0:'a', 1:'b', 2:'c']
      * // collect letters with index using map style
-     * assert (0..2).collectEntries { index -> [(index): letters[index]] } == [0:'a', 1:'b', 2:'c']
+     * assert (0..2).collectEntries { index {@code ->} [(index): letters[index]] } == [0:'a', 1:'b', 2:'c']
      * </pre>
      * Note: When using the list-style of result, the behavior is '<code>def (key, value) = listResultFromClosure</code>'.
      * While we strongly discourage using a list of size other than 2, Groovy's normal semantics apply in this case;
@@ -4145,8 +4145,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre class="groovyTestCase">
      * def letters = "abc"
      * // collect letters with index
-     * assert (0..2).collectEntries( [:] ) { index -> [index, letters[index]] } == [0:'a', 1:'b', 2:'c']
-     * assert (0..2).collectEntries( [4:'d'] ) { index ->
+     * assert (0..2).collectEntries( [:] ) { index {@code ->} [index, letters[index]] } == [0:'a', 1:'b', 2:'c']
+     * assert (0..2).collectEntries( [4:'d'] ) { index {@code ->}
      *     [(index+1): letters[index]] } == [1:'a', 2:'b', 3:'c', 4:'d']
      * </pre>
      * Note: When using the list-style of result, the behavior is '<code>def (key, value) = listResultFromClosure</code>'.
@@ -4211,8 +4211,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * def letters = "abc"
      * def nums = [0, 1, 2] as Integer[]
      * // collect letters with index
-     * assert nums.collectEntries( [:] ) { index -> [index, letters[index]] } == [0:'a', 1:'b', 2:'c']
-     * assert nums.collectEntries( [4:'d'] ) { index ->
+     * assert nums.collectEntries( [:] ) { index {@code ->} [index, letters[index]] } == [0:'a', 1:'b', 2:'c']
+     * assert nums.collectEntries( [4:'d'] ) { index {@code ->}
      *     [(index+1): letters[index]] } == [1:'a', 2:'b', 3:'c', 4:'d']
      * </pre>
      * Note: When using the list-style of result, the behavior is '<code>def (key, value) = listResultFromClosure</code>'.
@@ -4253,9 +4253,9 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * def letters = "abc"
      * def nums = [0, 1, 2] as Integer[]
      * // collect letters with index using list style
-     * assert nums.collectEntries { index -> [index, letters[index]] } == [0:'a', 1:'b', 2:'c']
+     * assert nums.collectEntries { index {@code ->} [index, letters[index]] } == [0:'a', 1:'b', 2:'c']
      * // collect letters with index using map style
-     * assert nums.collectEntries { index -> [(index): letters[index]] } == [0:'a', 1:'b', 2:'c']
+     * assert nums.collectEntries { index {@code ->} [(index): letters[index]] } == [0:'a', 1:'b', 2:'c']
      * </pre>
      * Note: When using the list-style of result, the behavior is '<code>def (key, value) = listResultFromClosure</code>'.
      * While we strongly discourage using a list of size other than 2, Groovy's normal semantics apply in this case;
@@ -4312,7 +4312,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * <pre class="groovyTestCase">
      * def numbers = [1, 2, 3]
-     * def result = numbers.find { it > 1}
+     * def result = numbers.find { it {@code >} 1}
      * assert result == 2
      * </pre>
      *
@@ -4353,7 +4353,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
     /**
      * Finds the first value matching the closure condition.  Example:
      * <pre class="groovyTestCase">def list = [1,2,3]
-     * assert 2 == list.find { it > 1 }
+     * assert 2 == list.find { it {@code >} 1 }
      * </pre>
      *
      * @param self    a Collection
@@ -4376,8 +4376,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example:
      * <pre class="groovyTestCase">
      * def list = [1,2,3] as Integer[]
-     * assert 2 == list.find { it > 1 }
-     * assert null == list.find { it > 5 }
+     * assert 2 == list.find { it {@code >} 1 }
+     * assert null == list.find { it {@code >} 5 }
      * </pre>
      *
      * @param self      an Array
@@ -4418,8 +4418,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <p>
      * <pre class="groovyTestCase">
      * int[] numbers = [1, 2, 3]
-     * assert numbers.findResult { if(it > 1) return it } == 2
-     * assert numbers.findResult { if(it > 4) return it } == null
+     * assert numbers.findResult { if(it {@code >} 1) return it } == 2
+     * assert numbers.findResult { if(it {@code >} 4) return it } == null
      * </pre>
      *
      * @param self      an Object with an iterator returning its values
@@ -4443,8 +4443,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <p>
      * <pre class="groovyTestCase">
      * int[] numbers = [1, 2, 3]
-     * assert numbers.findResult(5) { if(it > 1) return it } == 2
-     * assert numbers.findResult(5) { if(it > 4) return it } == 5
+     * assert numbers.findResult(5) { if(it {@code >} 1) return it } == 2
+     * assert numbers.findResult(5) { if(it {@code >} 4) return it } == 5
      * </pre>
      *
      * @param self          an Object with an iterator returning its values
@@ -4497,8 +4497,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Examples:
      * <pre class="groovyTestCase">
      * def iter = [1,2,3].iterator()
-     * assert "Found 2" == iter.findResult("default") { it > 1 ? "Found $it" : null }
-     * assert "default" == iter.findResult("default") { it > 3 ? "Found $it" : null }
+     * assert "Found 2" == iter.findResult("default") { it {@code >} 1 ? "Found $it" : null }
+     * assert "default" == iter.findResult("default") { it {@code >} 3 ? "Found $it" : null }
      * </pre>
      *
      * @param self          an Iterator
@@ -4540,8 +4540,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Examples:
      * <pre class="groovyTestCase">
      * def list = [1,2,3]
-     * assert "Found 2" == list.findResult("default") { it > 1 ? "Found $it" : null }
-     * assert "default" == list.findResult("default") { it > 3 ? "Found $it" : null }
+     * assert "Found 2" == list.findResult("default") { it {@code >} 1 ? "Found $it" : null }
+     * assert "default" == list.findResult("default") { it {@code >} 3 ? "Found $it" : null }
      * </pre>
      *
      * @param self          an Iterable
@@ -4603,7 +4603,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre class="groovyTestCase">
      * assert "Found b:3" == [a:1, b:3].findResult { if (it.value == 3) return "Found ${it.key}:${it.value}" }
      * assert null == [a:1, b:3].findResult { if (it.value == 9) return "Found ${it.key}:${it.value}" }
-     * assert "Found a:1" == [a:1, b:3].findResult { k, v -> if (k.size() + v == 2) return "Found $k:$v" }
+     * assert "Found a:1" == [a:1, b:3].findResult { k, v {@code ->} if (k.size() + v == 2) return "Found $k:$v" }
      * </pre>
      *
      * @param self      a Map
@@ -4628,7 +4628,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre class="groovyTestCase">
      * assert "Found b:3" == [a:1, b:3].findResult("default") { if (it.value == 3) return "Found ${it.key}:${it.value}" }
      * assert "default" == [a:1, b:3].findResult("default") { if (it.value == 9) return "Found ${it.key}:${it.value}" }
-     * assert "Found a:1" == [a:1, b:3].findResult("default") { k, v -> if (k.size() + v == 2) return "Found $k:$v" }
+     * assert "Found a:1" == [a:1, b:3].findResult("default") { k, v {@code ->} if (k.size() + v == 2) return "Found $k:$v" }
      * </pre>
      *
      * @param self          a Map
@@ -4660,7 +4660,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example:
      * <pre class="groovyTestCase">
      * def list = [1,2,3]
-     * def result = list.findResults { it > 1 ? "Found $it" : null }
+     * def result = list.findResults { it {@code >} 1 ? "Found $it" : null }
      * assert result == ["Found 2", "Found 3"]
      * </pre>
      *
@@ -4716,7 +4716,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example:
      * <pre class="groovyTestCase">
      * def map = [a:1, b:2, hi:2, cat:3, dog:2]
-     * def result = map.findResults { k, v -> k.size() == v ? "Found $k:$v" : null }
+     * def result = map.findResults { k, v {@code ->} k.size() == v ? "Found $k:$v" : null }
      * assert result == ["Found a:1", "Found hi:2", "Found cat:3"]
      * </pre>
      *
@@ -5052,7 +5052,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * take two parameters, which will be the key and the value.
      *
      * <pre class="groovyTestCase">def map = [a:1, b:2]
-     * map.retainAll { k,v -> k == 'b' }
+     * map.retainAll { k,v {@code ->} k == 'b' }
      * assert map == [b:2]</pre>
      *
      * See also <code>findAll</code> when wanting to produce a new map containing items
@@ -5115,7 +5115,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * will be the key and the value.
      *
      * <pre class="groovyTestCase">def map = [a:1, b:2]
-     * map.removeAll { k,v -> k == 'b' }
+     * map.removeAll { k,v {@code ->} k == 'b' }
      * assert map == [a:1]</pre>
      *
      * See also <code>findAll</code> when wanting to produce a new map containing items
@@ -5319,7 +5319,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Adds GroovyCollections#combinations(Iterable, Closure) as a method on collections.
      * <p>
      * Example usage:
-     * <pre class="groovyTestCase">assert [[2, 3],[4, 5, 6]].combinations {x,y -> x*y } == [8, 12, 10, 15, 12, 18]</pre>
+     * <pre class="groovyTestCase">assert [[2, 3],[4, 5, 6]].combinations {x,y {@code ->} x*y } == [8, 12, 10, 15, 12, 18]</pre>
      *
      * @param self a Collection of lists
      * @param function a closure to be called on each combination
@@ -5396,7 +5396,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * into a list.
      * <p>
      * Example usage:
-     * <pre class="groovyTestCase">Set result = [1, 2, 3].permutations { it.collect { v -> 2*v }}
+     * <pre class="groovyTestCase">Set result = [1, 2, 3].permutations { it.collect { v {@code ->} 2*v }}
      * assert result == [[6, 4, 2], [6, 2, 4], [2, 6, 4], [4, 6, 2], [4, 2, 6], [2, 4, 6]] as Set</pre>
      *
      * @param self the Iterable of items
@@ -5579,7 +5579,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * of items for that 'group path'.
      *
      * Example usage:
-     * <pre class="groovyTestCase">def result = [1,2,3,4,5,6].groupBy({ it % 2 }, { it < 4 })
+     * <pre class="groovyTestCase">def result = [1,2,3,4,5,6].groupBy({ it % 2 }, { it {@code <} 4 })
      * assert result == [1:[(true):[1, 3], (false):[5]], 0:[(true):[2], (false):[4, 6]]]</pre>
      *
      * Another example:
@@ -5612,7 +5612,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
         final Object[] tail = new Object[closures.length - 1];
         System.arraycopy(closures, 1, tail, 0, closures.length - 1); // Arrays.copyOfRange only since JDK 1.6
 
-        // inject([:]) { a,e -> a << [(e.key): e.value.groupBy(tail)] }
+        // inject([:]) { a,e {@code ->} a {@code <<} [(e.key): e.value.groupBy(tail)] }
         Map<Object, Map> acc = new LinkedHashMap<Object, Map>();
         for (Map.Entry<Object, List> item : first.entrySet()) {
             acc.put(item.getKey(), groupBy((Iterable)item.getValue(), tail));
@@ -5655,7 +5655,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * Example usage:
      * <pre class="groovyTestCase">
-     * def result = [1,2,3,4,5,6].groupBy([{ it % 2 }, { it < 4 }])
+     * def result = [1,2,3,4,5,6].groupBy([{ it % 2 }, { it {@code <} 4 }])
      * assert result == [1:[(true):[1, 3], (false):[5]], 0:[(true):[2], (false):[4, 6]]]
      * </pre>
      *
@@ -5987,10 +5987,10 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Performs the same function as the version of inject that takes an initial value, but
      * uses the head of the Collection as the initial value, and iterates over the tail.
      * <pre class="groovyTestCase">
-     * assert 1 * 2 * 3 * 4 == [ 1, 2, 3, 4 ].inject { acc, val -> acc * val }
-     * assert ['b'] == [['a','b'], ['b','c'], ['d','b']].inject { acc, val -> acc.intersect( val ) }
+     * assert 1 * 2 * 3 * 4 == [ 1, 2, 3, 4 ].inject { acc, val {@code ->} acc * val }
+     * assert ['b'] == [['a','b'], ['b','c'], ['d','b']].inject { acc, val {@code ->} acc.intersect( val ) }
      * LinkedHashSet set = [ 't', 'i', 'm' ]
-     * assert 'tim' == set.inject { a, b -> a + b }
+     * assert 'tim' == set.inject { a, b {@code ->} a + b }
      * </pre>
      *
      * @param self         a Collection
@@ -6023,17 +6023,17 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *
      * Examples:
      * <pre class="groovyTestCase">
-     * assert 1*1*2*3*4 == [1,2,3,4].inject(1) { acc, val -> acc * val }
+     * assert 1*1*2*3*4 == [1,2,3,4].inject(1) { acc, val {@code ->} acc * val }
      *
-     * assert 0+1+2+3+4 == [1,2,3,4].inject(0) { acc, val -> acc + val }
+     * assert 0+1+2+3+4 == [1,2,3,4].inject(0) { acc, val {@code ->} acc + val }
      *
      * assert 'The quick brown fox' ==
-     *     ['quick', 'brown', 'fox'].inject('The') { acc, val -> acc + ' ' + val }
+     *     ['quick', 'brown', 'fox'].inject('The') { acc, val {@code ->} acc + ' ' + val }
      *
      * assert 'bat' ==
-     *     ['rat', 'bat', 'cat'].inject('zzz') { min, next -> next < min ? next : min }
+     *     ['rat', 'bat', 'cat'].inject('zzz') { min, next {@code ->} next {@code <} min ? next : min }
      *
-     * def max = { a, b -> [a, b].max() }
+     * def max = { a, b {@code ->} [a, b].max() }
      * def animals = ['bat', 'rat', 'cat']
      * assert 'rat' == animals.inject('aaa', max)
      * </pre>
@@ -6041,11 +6041,11 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre>
      *    initVal  animals[0]
      *       v        v
-     * max('aaa',   'bat')  =>  'bat'  animals[1]
+     * max('aaa',   'bat')  {@code =>}  'bat'  animals[1]
      *                            v       v
-     *                      max('bat',  'rat')  =>  'rat'  animals[2]
+     *                      max('bat',  'rat')  {@code =>}  'rat'  animals[2]
      *                                                v       v
-     *                                          max('rat',  'cat')  =>  'rat'
+     *                                          max('rat',  'cat')  {@code =>}  'rat'
      * </pre>
      *
      * @param self         a Collection
@@ -6070,7 +6070,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Examples:
      * <pre class="groovyTestCase">
      * def map = [a:1, b:2, c:3]
-     * assert map.inject([]) { list, k, v ->
+     * assert map.inject([]) { list, k, v {@code ->}
      *   list + [k] * v
      * } == ['a', 'b', 'b', 'c', 'c', 'c']
      * </pre>
@@ -7013,7 +7013,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
 
     /**
      * Selects the minimum value found in the Iterable using the given comparator.
-     * <pre class="groovyTestCase">assert "hi" == ["hello","hi","hey"].min( { a, b -> a.length() <=> b.length() } as Comparator )</pre>
+     * <pre class="groovyTestCase">assert "hi" == ["hello","hi","hey"].min( { a, b {@code ->} a.length() {@code <=>} b.length() } as Comparator )</pre>
      *
      * @param self       an Iterable
      * @param comparator a Comparator
@@ -7087,7 +7087,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * assert "hi" == ["hello","hi","hey"].min { it.length() }
      * </pre>
      * <pre class="groovyTestCase">
-     * def lastDigit = { a, b -> a % 10 <=> b % 10 }
+     * def lastDigit = { a, b {@code ->} a % 10 {@code <=>} b % 10 }
      * assert [19, 55, 91].min(lastDigit) == 91
      * </pre>
      * <pre class="groovyTestCase">
@@ -7141,13 +7141,13 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * def zoo = [monkeys:6, lions:5, tigers:7]
      * def leastCommonEntry = zoo.min{ it.value }
      * assert leastCommonEntry.value == 5
-     * def mostCommonEntry = zoo.min{ a, b -> b.value <=> a.value } // double negative!
+     * def mostCommonEntry = zoo.min{ a, b {@code ->} b.value {@code <=>} a.value } // double negative!
      * assert mostCommonEntry.value == 7
      * </pre>
      * Edge case for multiple min values:
      * <pre class="groovyTestCase">
      * def zoo = [monkeys:6, lions:5, tigers:7]
-     * def lastCharOfName = { e -> e.key[-1] }
+     * def lastCharOfName = { e {@code ->} e.key[-1] }
      * def ans = zoo.min(lastCharOfName) // some random entry
      * assert lastCharOfName(ans) == 's'
      * </pre>
@@ -7179,13 +7179,13 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * def zoo = [monkeys:6, lions:5, tigers:7]
      * def mostCommonEntry = zoo.max{ it.value }
      * assert mostCommonEntry.value == 7
-     * def leastCommonEntry = zoo.max{ a, b -> b.value <=> a.value } // double negative!
+     * def leastCommonEntry = zoo.max{ a, b {@code ->} b.value {@code <=>} a.value } // double negative!
      * assert leastCommonEntry.value == 5
      * </pre>
      * Edge case for multiple max values:
      * <pre class="groovyTestCase">
      * def zoo = [monkeys:6, lions:5, tigers:7]
-     * def lengthOfNamePlusNumber = { e -> e.key.size() + e.value }
+     * def lengthOfNamePlusNumber = { e {@code ->} e.key.size() + e.value }
      * def ans = zoo.max(lengthOfNamePlusNumber) // one of [monkeys:6, tigers:7]
      * assert lengthOfNamePlusNumber(ans) == 13
      * </pre>
@@ -7322,7 +7322,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Comparable (typically an Integer) which is then used for
      * further comparison.
      * <pre class="groovyTestCase">assert "hello" == ["hello","hi","hey"].max { it.length() }</pre>
-     * <pre class="groovyTestCase">assert "hello" == ["hello","hi","hey"].max { a, b -> a.length() <=> b.length() }</pre>
+     * <pre class="groovyTestCase">assert "hello" == ["hello","hi","hey"].max { a, b {@code ->} a.length() {@code <=>} b.length() }</pre>
      * <pre class="groovyTestCase">
      * def pets = ['dog', 'elephant', 'anaconda']
      * def longestName = pets.max{ it.size() } // one of 'elephant' or 'anaconda'
@@ -7416,7 +7416,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
     /**
      * Selects the maximum value found in the Iterable using the given comparator.
      * <pre class="groovyTestCase">
-     * assert "hello" == ["hello","hi","hey"].max( { a, b -> a.length() <=> b.length() } as Comparator )
+     * assert "hello" == ["hello","hi","hey"].max( { a, b {@code ->} a.length() {@code <=>} b.length() } as Comparator )
      * </pre>
      *
      * @param self       an Iterable
@@ -7484,7 +7484,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example:
      * <pre class="groovyTestCase">
      * String[] letters = ['a', 'b', 'c', 'd']
-     * assert 0..<4 == letters.indices
+     * {@code assert 0..<4 == letters.indices}
      * </pre>
      *
      * @param self an array
@@ -7641,8 +7641,10 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
 
     /**
      * Support the range subscript operator for an eager or lazy List.
-     * <pre class="groovyTestCase">def list = [true, 1, 3.4].withDefault{ 42 }
-     * assert list[0..<0] == []</pre>
+     * <pre class="groovyTestCase">
+     * def list = [true, 1, 3.4].withDefault{ 42 }
+     * {@code assert list[0..<0] == []}
+     * </pre>
      *
      * @param self  a ListWithDefault
      * @param range a Range indicating the items to get
@@ -7656,8 +7658,10 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
 
     /**
      * Support the range subscript operator for a List.
-     * <pre class="groovyTestCase">def list = [true, 1, 3.4]
-     * assert list[0..<0] == []</pre>
+     * <pre class="groovyTestCase">
+     * def list = [true, 1, 3.4]
+     * {@code assert list[0..<0] == []}
+     * </pre>
      *
      * @param self  a List
      * @param range a Range indicating the items to get
@@ -7985,9 +7989,11 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
 
     /**
      * A helper method to allow lists to work with subscript operators.
-     * <pre class="groovyTestCase">def list = ["a", true]
-     * list[1..<1] = 5
-     * assert list == ["a", 5, true]</pre>
+     * <pre class="groovyTestCase">
+     * def list = ["a", true]
+     * {@code list[1..<1] = 5}
+     * assert list == ["a", 5, true]
+     * </pre>
      *
      * @param self  a List
      * @param range the (in this case empty) subset of the list to set
@@ -8009,9 +8015,11 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
 
     /**
      * A helper method to allow lists to work with subscript operators.
-     * <pre class="groovyTestCase">def list = ["a", true]
-     * list[1..<1] = [4, 3, 2]
-     * assert list == ["a", 4, 3, 2, true]</pre>
+     * <pre class="groovyTestCase">
+     * def list = ["a", true]
+     * {@code list[1..<1] = [4, 3, 2]}
+     * assert list == ["a", 4, 3, 2, true]
+     * </pre>
      *
      * @param self  a List
      * @param range the (in this case empty) subset of the list to set
@@ -8598,9 +8606,9 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * result of calling the supplied Closure with the key as the parameter to the Closure.
      * Example usage:
      * <pre class="groovyTestCase">
-     * def map = [a:1, b:2].withDefault{ k -> k.toCharacter().isLowerCase() ? 10 : -10 }
+     * def map = [a:1, b:2].withDefault{ k {@code ->} k.toCharacter().isLowerCase() ? 10 : -10 }
      * def expected = [a:1, b:2, c:10, D:-10]
-     * assert expected.every{ e -> e.value == map[e.key] }
+     * assert expected.every{ e {@code ->} e.value == map[e.key] }
      *
      * def constMap = [:].withDefault{ 42 }
      * assert constMap.foo == 42
@@ -8662,7 +8670,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * assert list == [0, 1, null, 42] // gap filled with null
      *
      * // illustrate using the index when generating default values
-     * def list2 = [5].withLazyDefault{ index -> index * index }
+     * def list2 = [5].withLazyDefault{ index {@code ->} index * index }
      * assert list2[3] == 9
      * assert list2 == [5, null, null, 9]
      * assert list2[2] == 4
@@ -8708,7 +8716,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * assert list == [0, 1, 42, 42]   // gap filled with default value
      *
      * // illustrate using the index when generating default values
-     * def list2 = [5].withEagerDefault{ index -> index * index }
+     * def list2 = [5].withEagerDefault{ index {@code ->} index * index }
      * assert list2[3] == 9
      * assert list2 == [5, 1, 4, 9]
      *
@@ -8738,7 +8746,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example usage:
      * <pre class="groovyTestCase">
      * assert [["a", 0], ["b", 1]] == ["a", "b"].withIndex()
-     * assert ["0: a", "1: b"] == ["a", "b"].withIndex().collect { str, idx -> "$idx: $str" }
+     * assert ["0: a", "1: b"] == ["a", "b"].withIndex().collect { str, idx {@code ->} "$idx: $str" }
      * </pre>
      *
      * @param self an Iterable
@@ -8756,7 +8764,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example usage:
      * <pre class="groovyTestCase">
      * assert [0: "a", 1: "b"] == ["a", "b"].indexed()
-     * assert ["0: a", "1: b"] == ["a", "b"].indexed().collect { idx, str -> "$idx: $str" }
+     * assert ["0: a", "1: b"] == ["a", "b"].indexed().collect { idx, str {@code ->} "$idx: $str" }
      * </pre>
      *
      * @param self an Iterable
@@ -8774,7 +8782,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example usage:
      * <pre class="groovyTestCase">
      * assert [["a", 5], ["b", 6]] == ["a", "b"].withIndex(5)
-     * assert ["1: a", "2: b"] == ["a", "b"].withIndex(1).collect { str, idx -> "$idx: $str" }
+     * assert ["1: a", "2: b"] == ["a", "b"].withIndex(1).collect { str, idx {@code ->} "$idx: $str" }
      * </pre>
      *
      * @param self   an Iterable
@@ -8793,7 +8801,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example usage:
      * <pre class="groovyTestCase">
      * assert [5: "a", 6: "b"] == ["a", "b"].indexed(5)
-     * assert ["1: a", "2: b"] == ["a", "b"].indexed(1).collect { idx, str -> "$idx: $str" }
+     * assert ["1: a", "2: b"] == ["a", "b"].indexed(1).collect { idx, str {@code ->} "$idx: $str" }
      * </pre>
      *
      * @param self   an Iterable
@@ -8818,7 +8826,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example usage:
      * <pre class="groovyTestCase">
      * assert [["a", 0], ["b", 1]] == ["a", "b"].iterator().withIndex().toList()
-     * assert ["0: a", "1: b"] == ["a", "b"].iterator().withIndex().collect { str, idx -> "$idx: $str" }.toList()
+     * assert ["0: a", "1: b"] == ["a", "b"].iterator().withIndex().collect { str, idx {@code ->} "$idx: $str" }.toList()
      * </pre>
      *
      * @param self an iterator
@@ -8835,8 +8843,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <p/>
      * Example usage:
      * <pre class="groovyTestCase">
-     * assert [[0, "a"], [1, "b"]] == ["a", "b"].iterator().indexed().collect{ tuple -> [tuple.first, tuple.second] }
-     * assert ["0: a", "1: b"] == ["a", "b"].iterator().indexed().collect { idx, str -> "$idx: $str" }.toList()
+     * assert [[0, "a"], [1, "b"]] == ["a", "b"].iterator().indexed().collect{ tuple {@code ->} [tuple.first, tuple.second] }
+     * assert ["0: a", "1: b"] == ["a", "b"].iterator().indexed().collect { idx, str {@code ->} "$idx: $str" }.toList()
      * </pre>
      *
      * @param self an iterator
@@ -8854,7 +8862,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example usage:
      * <pre class="groovyTestCase">
      * assert [["a", 5], ["b", 6]] == ["a", "b"].iterator().withIndex(5).toList()
-     * assert ["1: a", "2: b"] == ["a", "b"].iterator().withIndex(1).collect { str, idx -> "$idx: $str" }.toList()
+     * assert ["1: a", "2: b"] == ["a", "b"].iterator().withIndex(1).collect { str, idx {@code ->} "$idx: $str" }.toList()
      * </pre>
      *
      * @param self   an iterator
@@ -8873,7 +8881,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Example usage:
      * <pre class="groovyTestCase">
      * assert [[5, "a"], [6, "b"]] == ["a", "b"].iterator().indexed(5).toList()
-     * assert ["a: 1", "b: 2"] == ["a", "b"].iterator().indexed(1).collect { idx, str -> "$str: $idx" }.toList()
+     * assert ["a: 1", "b: 2"] == ["a", "b"].iterator().indexed(1).collect { idx, str {@code ->} "$str: $idx" }.toList()
      * </pre>
      *
      * @param self   an iterator
@@ -8998,7 +9006,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Sorts the elements from the given map into a new ordered map using
      * the closure as a comparator to determine the ordering.
      * The original map is unchanged.
-     * <pre class="groovyTestCase">def map = [a:5, b:3, c:6, d:4].sort { a, b -> a.value <=> b.value }
+     * <pre class="groovyTestCase">def map = [a:5, b:3, c:6, d:4].sort { a, b {@code ->} a.value {@code <=>} b.value }
      * assert map == [b:3, d:4, a:5, c:6]</pre>
      *
      * @param self the original unsorted map
@@ -9020,7 +9028,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Sorts the elements from the given map into a new ordered Map using
      * the specified key comparator to determine the ordering.
      * The original map is unchanged.
-     * <pre class="groovyTestCase">def map = [ba:3, cz:6, ab:5].sort({ a, b -> a[-1] <=> b[-1] } as Comparator)
+     * <pre class="groovyTestCase">def map = [ba:3, cz:6, ab:5].sort({ a, b {@code ->} a[-1] {@code <=>} b[-1] } as Comparator)
      * assert map*.value == [3, 5, 6]</pre>
      *
      * @param self the original unsorted map
@@ -9141,7 +9149,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * is true, it is sorted in place and returned. Otherwise, the elements are first placed
      * into a new list which is then sorted and returned - leaving the original Iterable unchanged.
      * <pre class="groovyTestCase">
-     * assert ["hi","hey","hello"] == ["hello","hi","hey"].sort(false, { a, b -> a.length() <=> b.length() } as Comparator )
+     * assert ["hi","hey","hello"] == ["hello","hi","hey"].sort(false, { a, b {@code ->} a.length() {@code <=>} b.length() } as Comparator )
      * </pre>
      * <pre class="groovyTestCase">
      * def orig = ["hello","hi","Hey"]
@@ -9307,7 +9315,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Comparable (typically an Integer) which is then used for
      * further comparison.
      * <pre class="groovyTestCase">assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { it.length() }</pre>
-     * <pre class="groovyTestCase">assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b -> a.length() <=> b.length() }</pre>
+     * <pre class="groovyTestCase">assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b {@code ->} a.length() {@code <=>} b.length() }</pre>
      *
      * @param self    the Iterable to be sorted
      * @param closure a 1 or 2 arg Closure used to determine the correct ordering
@@ -9333,7 +9341,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Comparable (typically an Integer) which is then used for
      * further comparison.
      * <pre class="groovyTestCase">assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { it.length() }</pre>
-     * <pre class="groovyTestCase">assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b -> a.length() <=> b.length() }</pre>
+     * <pre class="groovyTestCase">assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b {@code ->} a.length() {@code <=>} b.length() }</pre>
      * <pre class="groovyTestCase">
      * def orig = ["hello","hi","Hey"]
      * def sorted = orig.sort(false) { it.toUpperCase() }
@@ -9437,7 +9445,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Comparable (typically an Integer) which is then used for
      * further comparison.
      * <pre class="groovyTestCase">assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { it.length() }</pre>
-     * <pre class="groovyTestCase">assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b -> a.length() <=> b.length() }</pre>
+     * <pre class="groovyTestCase">assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b {@code ->} a.length() {@code <=>} b.length() }</pre>
      *
      * @param self    the Iterable to be sorted
      * @param closure a 1 or 2 arg Closure used to determine the correct ordering
@@ -9517,7 +9525,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
     /**
      * Returns a sorted version of the given array using the supplied comparator to determine the resulting order.
      * <pre class="groovyTestCase">
-     * def sumDigitsComparator = [compare: { num1, num2 -> num1.toString().toList()*.toInteger().sum() <=> num2.toString().toList()*.toInteger().sum() }] as Comparator
+     * def sumDigitsComparator = [compare: { num1, num2 {@code ->} num1.toString().toList()*.toInteger().sum() {@code <=>} num2.toString().toList()*.toInteger().sum() }] as Comparator
      * Integer[] nums = [9, 44, 222, 7000]
      * def result = nums.toSorted(sumDigitsComparator)
      * assert result instanceof Integer[]
@@ -9587,8 +9595,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Sorts the elements from the given map into a new ordered map using
      * the supplied comparator to determine the ordering. The original map is unchanged.
      * <pre class="groovyTestCase">
-     * def keyComparator = [compare: { e1, e2 -> e1.key <=> e2.key }] as Comparator
-     * def valueComparator = [compare: { e1, e2 -> e1.value <=> e2.value }] as Comparator
+     * def keyComparator = [compare: { e1, e2 {@code ->} e1.key {@code <=>} e2.key }] as Comparator
+     * def valueComparator = [compare: { e1, e2 {@code ->} e1.value {@code <=>} e2.value }] as Comparator
      * def map1 = [a:5, b:3, d:4, c:6].toSorted(keyComparator)
      * assert map1.toString() == '[a:5, b:3, c:6, d:4]'
      * def map2 = [a:5, b:3, d:4, c:6].toSorted(valueComparator)
@@ -9619,7 +9627,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * the Closure is assumed to take a single entry parameter and return a Comparable (typically an Integer)
      * which is then used for further comparison.
      * <pre class="groovyTestCase">
-     * def map = [a:5, b:3, c:6, d:4].toSorted { a, b -> a.value <=> b.value }
+     * def map = [a:5, b:3, c:6, d:4].toSorted { a, b {@code ->} a.value {@code <=>} b.value }
      * assert map.toString() == '[b:3, d:4, a:5, c:6]'
      * </pre>
      *
@@ -10880,9 +10888,9 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * except that it attempts to preserve the type of the original list.
      * <pre class="groovyTestCase">
      * def nums = [ 1, 3, 2 ]
-     * assert nums.takeWhile{ it < 1 } == []
-     * assert nums.takeWhile{ it < 3 } == [ 1 ]
-     * assert nums.takeWhile{ it < 4 } == [ 1, 3, 2 ]
+     * assert nums.takeWhile{ it {@code <} 1 } == []
+     * assert nums.takeWhile{ it {@code <} 3 } == [ 1 ]
+     * assert nums.takeWhile{ it {@code <} 4 } == [ 1, 3, 2 ]
      * </pre>
      *
      * @param self      the original list
@@ -10913,8 +10921,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *     Iterator<String> iterator() { "abc".iterator() }
      * }
      * def abc = new AbcIterable()
-     * assert abc.takeWhile{ it < 'b' } == ['a']
-     * assert abc.takeWhile{ it <= 'b' } == ['a', 'b']
+     * assert abc.takeWhile{ it {@code <} 'b' } == ['a']
+     * assert abc.takeWhile{ it {@code <=} 'b' } == ['a', 'b']
      * </pre>
      *
      * @param self      an Iterable
@@ -10937,9 +10945,9 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * except that it attempts to preserve the type of the original SortedSet.
      * <pre class="groovyTestCase">
      * def nums = [ 1, 2, 3 ] as SortedSet
-     * assert nums.takeWhile{ it < 1 } == [] as SortedSet
-     * assert nums.takeWhile{ it < 2 } == [ 1 ] as SortedSet
-     * assert nums.takeWhile{ it < 4 } == [ 1, 2, 3 ] as SortedSet
+     * assert nums.takeWhile{ it {@code <} 1 } == [] as SortedSet
+     * assert nums.takeWhile{ it {@code <} 2 } == [ 1 ] as SortedSet
+     * assert nums.takeWhile{ it {@code <} 4 } == [ 1, 2, 3 ] as SortedSet
      * </pre>
      *
      * @param self      the original SortedSet
@@ -10958,9 +10966,9 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * passed to the given closure evaluates to true.
      * <pre class="groovyTestCase">
      * def shopping = [milk:1, bread:2, chocolate:3]
-     * assert shopping.takeWhile{ it.key.size() < 6 } == [milk:1, bread:2]
+     * assert shopping.takeWhile{ it.key.size() {@code <} 6 } == [milk:1, bread:2]
      * assert shopping.takeWhile{ it.value % 2 } == [milk:1]
-     * assert shopping.takeWhile{ k, v -> k.size() + v <= 7 } == [milk:1, bread:2]
+     * assert shopping.takeWhile{ k, v {@code ->} k.size() + v {@code <=} 7 } == [milk:1, bread:2]
      * </pre>
      * If the map instance does not have ordered keys, then this function could appear to take random
      * entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.
@@ -10990,9 +10998,9 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * passed to the given closure evaluates to true.
      * <pre class="groovyTestCase">
      * def nums = [ 1, 3, 2 ] as Integer[]
-     * assert nums.takeWhile{ it < 1 } == [] as Integer[]
-     * assert nums.takeWhile{ it < 3 } == [ 1 ] as Integer[]
-     * assert nums.takeWhile{ it < 4 } == [ 1, 3, 2 ] as Integer[]
+     * assert nums.takeWhile{ it {@code <} 1 } == [] as Integer[]
+     * assert nums.takeWhile{ it {@code <} 3 } == [ 1 ] as Integer[]
+     * assert nums.takeWhile{ it {@code <} 4 } == [ 1, 3, 2 ] as Integer[]
      * </pre>
      *
      * @param self      the original array
@@ -11024,9 +11032,9 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * def a = 0
      * def iter = [ hasNext:{ true }, next:{ a++ } ] as Iterator
      *
-     * assert [].iterator().takeWhile{ it < 3 }.toList() == []
-     * assert [1, 2, 3, 4, 5].iterator().takeWhile{ it < 3 }.toList() == [ 1, 2 ]
-     * assert iter.takeWhile{ it < 5 }.toList() == [ 0, 1, 2, 3, 4 ]
+     * assert [].iterator().takeWhile{ it {@code <} 3 }.toList() == []
+     * assert [1, 2, 3, 4, 5].iterator().takeWhile{ it {@code <} 3 }.toList() == [ 1, 2 ]
+     * assert iter.takeWhile{ it {@code <} 5 }.toList() == [ 0, 1, 2, 3, 4 ]
      * </pre>
      *
      * @param self      the Iterator
@@ -11087,8 +11095,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * except that it attempts to preserve the type of the original SortedSet.
      * <pre class="groovyTestCase">
      * def nums = [ 1, 2, 3 ] as SortedSet
-     * assert nums.dropWhile{ it < 4 } == [] as SortedSet
-     * assert nums.dropWhile{ it < 2 } == [ 2, 3 ] as SortedSet
+     * assert nums.dropWhile{ it {@code <} 4 } == [] as SortedSet
+     * assert nums.dropWhile{ it {@code <} 2 } == [ 2, 3 ] as SortedSet
      * assert nums.dropWhile{ it != 3 } == [ 3 ] as SortedSet
      * assert nums.dropWhile{ it == 0 } == [ 1, 2, 3 ] as SortedSet
      * </pre>
@@ -11110,8 +11118,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * except that it attempts to preserve the type of the original list.
      * <pre class="groovyTestCase">
      * def nums = [ 1, 3, 2 ]
-     * assert nums.dropWhile{ it < 4 } == []
-     * assert nums.dropWhile{ it < 3 } == [ 3, 2 ]
+     * assert nums.dropWhile{ it {@code <} 4 } == []
+     * assert nums.dropWhile{ it {@code <} 3 } == [ 3, 2 ]
      * assert nums.dropWhile{ it != 2 } == [ 2 ]
      * assert nums.dropWhile{ it == 0 } == [ 1, 3, 2 ]
      * </pre>
@@ -11143,8 +11151,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      *     Iterator<String> iterator() { "horse".iterator() }
      * }
      * def horse = new HorseIterable()
-     * assert horse.dropWhile{ it < 'r' } == ['r', 's', 'e']
-     * assert horse.dropWhile{ it <= 'r' } == ['s', 'e']
+     * assert horse.dropWhile{ it {@code <} 'r' } == ['r', 's', 'e']
+     * assert horse.dropWhile{ it {@code <=} 'r' } == ['s', 'e']
      * </pre>
      *
      * @param self      an Iterable
@@ -11166,9 +11174,9 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * true when passed each of the dropped entries (or key/value pairs).
      * <pre class="groovyTestCase">
      * def shopping = [milk:1, bread:2, chocolate:3]
-     * assert shopping.dropWhile{ it.key.size() < 6 } == [chocolate:3]
+     * assert shopping.dropWhile{ it.key.size() {@code <} 6 } == [chocolate:3]
      * assert shopping.dropWhile{ it.value % 2 } == [bread:2, chocolate:3]
-     * assert shopping.dropWhile{ k, v -> k.size() + v <= 7 } == [chocolate:3]
+     * assert shopping.dropWhile{ k, v {@code ->} k.size() + v {@code <=} 7 } == [chocolate:3]
      * </pre>
      * If the map instance does not have ordered keys, then this function could appear to drop random
      * entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.
@@ -11200,8 +11208,8 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * true when passed each of the dropped elements.
      * <pre class="groovyTestCase">
      * def nums = [ 1, 3, 2 ] as Integer[]
-     * assert nums.dropWhile{ it <= 3 } == [ ] as Integer[]
-     * assert nums.dropWhile{ it < 3 } == [ 3, 2 ] as Integer[]
+     * assert nums.dropWhile{ it {@code <=} 3 } == [ ] as Integer[]
+     * assert nums.dropWhile{ it {@code <} 3 } == [ 3, 2 ] as Integer[]
      * assert nums.dropWhile{ it != 2 } == [ 2 ] as Integer[]
      * assert nums.dropWhile{ it == 0 } == [ 1, 3, 2 ] as Integer[]
      * </pre>
@@ -11232,10 +11240,10 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * condition evaluates to true when passed each of the dropped elements.
      * <pre class="groovyTestCase">
      * def a = 0
-     * def iter = [ hasNext:{ a < 10 }, next:{ a++ } ] as Iterator
-     * assert [].iterator().dropWhile{ it < 3 }.toList() == []
-     * assert [1, 2, 3, 4, 5].iterator().dropWhile{ it < 3 }.toList() == [ 3, 4, 5 ]
-     * assert iter.dropWhile{ it < 5 }.toList() == [ 5, 6, 7, 8, 9 ]
+     * def iter = [ hasNext:{ a {@code <} 10 }, next:{ a++ } ] as Iterator
+     * assert [].iterator().dropWhile{ it {@code <} 3 }.toList() == []
+     * assert [1, 2, 3, 4, 5].iterator().dropWhile{ it {@code <} 3 }.toList() == [ 3, 4, 5 ]
+     * assert iter.dropWhile{ it {@code <} 5 }.toList() == [ 5, 6, 7, 8, 9 ]
      * </pre>
      *
      * @param self      the Iterator
@@ -12357,7 +12365,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre class="groovyTestCase">
      * def one = ['a', 'B', 'c', 'd']
      * def two = ['b', 'C', 'd', 'e']
-     * def compareIgnoreCase = { a, b -> a.toLowerCase() <=> b.toLowerCase() }
+     * def compareIgnoreCase = { a, b {@code ->} a.toLowerCase() {@code <=>} b.toLowerCase() }
      * assert one.intersect(two) == ['d']
      * assert two.intersect(one) == ['d']
      * assert one.intersect(two, compareIgnoreCase) == ['b', 'C', 'd']
@@ -13236,7 +13244,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * collections have their contents (recursively) added to the new SortedSet.
      * <pre class="groovyTestCase">
      * Set nested = [[0,1],[2],3,[4],5]
-     * SortedSet sorted = new TreeSet({ a, b -> (a instanceof List ? a[0] : a) <=> (b instanceof List ? b[0] : b) } as Comparator)
+     * SortedSet sorted = new TreeSet({ a, b {@code ->} (a instanceof List ? a[0] : a) {@code <=>} (b instanceof List ? b[0] : b) } as Comparator)
      * sorted.addAll(nested)
      * assert [0,1,2,3,4,5] as SortedSet == sorted.flatten()
      * </pre>
@@ -16008,9 +16016,11 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * Iterates from this number down to the given number, inclusive,
      * decrementing by one each time.  Each number is passed to the closure.
      * Example:
-     * <pre>10.5.downto(0) {
+     * <pre>
+     * 10.5.downto(0) {
      *   println it
-     * }</pre>
+     * }
+     * </pre>
      * Prints numbers 10.5, 9.5 ... to 0.5.
      *
      * @param self    a BigDecimal
@@ -16050,9 +16060,11 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
     /**
      * Iterates from this number up to the given number using a step increment.
      * Each intermediate number is passed to the given closure.  Example:
-     * <pre>0.step( 10, 2 ) {
+     * <pre>
+     * 0.step( 10, 2 ) {
      *   println it
-     * }</pre>
+     * }
+     * </pre>
      * Prints even numbers 0 through 8.
      *
      * @param self       a Number to start with
diff --git a/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
index 2ac7385..5a9754e 100644
--- a/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
@@ -478,7 +478,7 @@ public class IOGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre>
      * def s = 'The 3 quick\nbrown 4 fox'
      * def result = ''
-     * new StringReader(s).splitEachLine(/\d/){ parts ->
+     * new StringReader(s).splitEachLine(/\d/){ parts {@code ->}
      *     result += "${parts[0]}_${parts[1]}|"
      * }
      * assert result == 'The _ quick|brown _ fox|'
@@ -508,7 +508,7 @@ public class IOGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre>
      * def s = 'The 3 quick\nbrown 4 fox'
      * def result = ''
-     * new StringReader(s).splitEachLine(~/\d/){ parts ->
+     * new StringReader(s).splitEachLine(~/\d/){ parts {@code ->}
      *     result += "${parts[0]}_${parts[1]}|"
      * }
      * assert result == 'The _ quick|brown _ fox|'
diff --git a/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
index 3bdcb19..647f47d 100644
--- a/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
@@ -766,7 +766,7 @@ public class ResourceGroovyMethods extends DefaultGroovyMethodsSupport {
      * </pre>
      * or with some help from <code>ExpandoMetaClass</code>, you could do something like:
      * <pre>
-     * myFile.metaClass.setText = { String s -> delegate.setText(s, 'UTF-8') }
+     * myFile.metaClass.setText = { String s {@code ->} delegate.setText(s, 'UTF-8') }
      * myfile.text = 'some text'
      * </pre>
      *
@@ -1285,8 +1285,8 @@ public class ResourceGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre>
      * def totalSize = 0
      * def count = 0
-     * def sortByTypeThenName = { a, b ->
-     *     a.isFile() != b.isFile() ? a.isFile() <=> b.isFile() : a.name <=> b.name
+     * def sortByTypeThenName = { a, b {@code ->}
+     *     a.isFile() != b.isFile() ? a.isFile() {@code <=>} b.isFile() : a.name {@code <=>} b.name
      * }
      * rootDir.traverse(
      *         type         : FILES,
@@ -1296,7 +1296,7 @@ public class ResourceGroovyMethods extends DefaultGroovyMethodsSupport {
      *                         totalSize = 0; count = 0 },
      *         postRoot     : true
      *         sort         : sortByTypeThenName
-     * ) {it -> totalSize += it.size(); count++ }
+     * ) {it {@code ->} totalSize += it.size(); count++ }
      * </pre>
      *
      * @param self    a File (that happens to be a folder/directory)
@@ -1511,14 +1511,14 @@ public class ResourceGroovyMethods extends DefaultGroovyMethodsSupport {
      * // collect names of files in baseDir matching supplied regex pattern
      * import static groovy.io.FileType.*
      * def names = []
-     * baseDir.eachFileMatch FILES, ~/foo\d\.txt/, { names << it.name }
+     * baseDir.eachFileMatch FILES, ~/foo\d\.txt/, { names {@code <<} it.name }
      * assert names == ['foo1.txt', 'foo2.txt']
      *
      * // remove all *.bak files in baseDir
-     * baseDir.eachFileMatch FILES, ~/.*\.bak/, { File bak -> bak.delete() }
+     * baseDir.eachFileMatch FILES, ~/.*\.bak/, { File bak {@code ->} bak.delete() }
      *
-     * // print out files > 4K in size from baseDir
-     * baseDir.eachFileMatch FILES, { new File(baseDir, it).size() > 4096 }, { println "$it.name ${it.size()}" }
+     * // print out files &gt; 4K in size from baseDir
+     * baseDir.eachFileMatch FILES, { new File(baseDir, it).size() {@code >} 4096 }, { println "$it.name ${it.size()}" }
      * </pre>
      *
      * @param self       a File (that happens to be a folder/directory)
diff --git a/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
index 884f924..5040411 100644
--- a/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
@@ -537,7 +537,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * def text = "Groovy"
      * assert text.dropWhile{ false } == 'Groovy'
      * assert text.dropWhile{ true } == ''
-     * assert text.dropWhile{ it < 'Z' } == 'roovy'
+     * assert text.dropWhile{ it {@code <} 'Z' } == 'roovy'
      * assert text.dropWhile{ it != 'v' } == 'vy'
      * </pre>
      *
@@ -700,9 +700,9 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre class="groovyTestCase">
      * assert "Groovy".collectReplacements{ it == 'o' ? '_O_' : null } == 'Gr_O__O_vy'
      * assert "Groovy".collectReplacements{ it.equalsIgnoreCase('O') ? '_O_' : null } == 'Gr_O__O_vy'
-     * assert "Groovy".collectReplacements{ char c -> c == 'o' ? '_O_' : null } == 'Gr_O__O_vy'
-     * assert "Groovy".collectReplacements{ Character c -> c == 'o' ? '_O_' : null } == 'Gr_O__O_vy'
-     * assert "B&W".collectReplacements{ it == '&' ? '&amp;' : null } == 'B&amp;W'
+     * assert "Groovy".collectReplacements{ char c {@code ->} c == 'o' ? '_O_' : null } == 'Gr_O__O_vy'
+     * assert "Groovy".collectReplacements{ Character c {@code ->} c == 'o' ? '_O_' : null } == 'Gr_O__O_vy'
+     * assert "B&amp;W".collectReplacements{ {@code it == '&' ? '&' : null} } == 'B&amp;W'
      * </pre>
      *
      * @param orig the original String
@@ -972,19 +972,19 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * <p>
      * For example, if the pattern doesn't match, the result is null:
      * <pre class="groovyTestCase">
-     *     assert "New York, NY".find(~/\d{5}/) { match -> return "-$match-"} == null
+     *     assert "New York, NY".find(~/\d{5}/) { match {@code ->} return "-$match-"} == null
      * </pre>
      *
      * If it does match and we don't have any capture groups in our regex, there is a single parameter
      * on the closure that the match gets passed to:
      * <pre class="groovyTestCase">
-     *      assert "New York, NY 10292-0098".find(~/\d{5}/) { match -> return "-$match-"} == "-10292-"
+     *      assert "New York, NY 10292-0098".find(~/\d{5}/) { match {@code ->} return "-$match-"} == "-10292-"
      * </pre>
      *
      * If we have capture groups in our expression, our closure has one parameter for the match, followed by
      * one for each of the capture groups:
      * <pre class="groovyTestCase">
-     *      assert "New York, NY 10292-0098".find(~/(\d{5})-?(\d{4})/) { match, zip, plusFour ->
+     *      assert "New York, NY 10292-0098".find(~/(\d{5})-?(\d{4})/) { match, zip, plusFour {@code ->}
      *          assert match == "10292-0098"
      *          assert zip == "10292"
      *          assert plusFour == "0098"
@@ -995,7 +995,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * the closure will be passed an array with the first element corresponding to the whole match,
      * followed by an element for each of the capture groups:
      * <pre class="groovyTestCase">
-     *      assert "New York, NY 10292-0098".find(~/(\d{5})-?(\d{4})/) { array ->
+     *      assert "New York, NY 10292-0098".find(~/(\d{5})-?(\d{4})/) { array {@code ->}
      *          assert array[0] == "10292-0098"
      *          assert array[1] == "10292"
      *          assert array[2] == "0098"
@@ -1005,7 +1005,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * If a capture group is optional, and doesn't match, then the corresponding value
      * for that capture group passed to the closure will be null as illustrated here:
      * <pre class="groovyTestCase">
-     *      assert "adsf 233-9999 adsf".find(~/(\d{3})?-?(\d{3})-(\d{4})/) { match, areaCode, exchange, stationNumber ->
+     *      assert "adsf 233-9999 adsf".find(~/(\d{3})?-?(\d{3})-(\d{4})/) { match, areaCode, exchange, stationNumber {@code ->}
      *          assert "233-9999" == match
      *          assert null == areaCode
      *          assert "233" == exchange
@@ -1106,16 +1106,16 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * <p>
      * For example, if the regex doesn't match, it returns an empty list:
      * <pre class="groovyTestCase">
-     * assert "foo".findAll(/(\w*) Fish/) { match, firstWord -> return firstWord } == []
+     * assert "foo".findAll(/(\w*) Fish/) { match, firstWord {@code ->} return firstWord } == []
      * </pre>
      * Any regular expression matches are passed to the closure, if there are no capture groups, there will be one parameter for the match:
      * <pre class="groovyTestCase">
-     * assert "I could not, would not, with a fox.".findAll(/.ould/) { match -> "${match}n't"} == ["couldn't", "wouldn't"]
+     * assert "I could not, would not, with a fox.".findAll(/.ould/) { match {@code ->} "${match}n't"} == ["couldn't", "wouldn't"]
      * </pre>
      * If there are capture groups, the first parameter will be the match followed by one parameter for each capture group:
      * <pre class="groovyTestCase">
      * def orig = "There's a Wocket in my Pocket"
-     * assert orig.findAll(/(.)ocket/) { match, firstLetter -> "$firstLetter > $match" } == ["W > Wocket", "P > Pocket"]
+     * assert orig.findAll(/(.)ocket/) { match, firstLetter {@code ->} "$firstLetter {@code >} $match" } == ["W {@code >} Wocket", "P {@code >} Pocket"]
      * </pre>
      *
      * @param self    a CharSequence
@@ -1170,17 +1170,17 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * <p>
      * For example, if the pattern doesn't match, it returns an empty list:
      * <pre class="groovyTestCase">
-     * assert "foo".findAll(~/(\w*) Fish/) { match, firstWord -> return firstWord } == []
+     * assert "foo".findAll(~/(\w*) Fish/) { match, firstWord {@code ->} return firstWord } == []
      * </pre>
      * Any regular expression matches are passed to the closure, if there are no capture groups, there will be one
      * parameter for the match:
      * <pre class="groovyTestCase">
-     * assert "I could not, would not, with a fox.".findAll(~/.ould/) { match -> "${match}n't"} == ["couldn't", "wouldn't"]
+     * assert "I could not, would not, with a fox.".findAll(~/.ould/) { match {@code ->} "${match}n't"} == ["couldn't", "wouldn't"]
      * </pre>
      * If there are capture groups, the first parameter will be the match followed by one parameter for each capture group:
      * <pre class="groovyTestCase">
      * def orig = "There's a Wocket in my Pocket"
-     * assert orig.findAll(~/(.)ocket/) { match, firstLetter -> "$firstLetter > $match" } == ["W > Wocket", "P > Pocket"]
+     * assert orig.findAll(~/(.)ocket/) { match, firstLetter {@code ->} "$firstLetter {@code >} $match" } == ["W {@code >} Wocket", "P {@code >} Pocket"]
      * </pre>
      *
      * @param self    a CharSequence
@@ -2507,14 +2507,14 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre class="groovyTestCase">
      *     assert "hello world".replaceAll("(o)") { it[0].toUpperCase() } == "hellO wOrld"
      *
-     *     assert "foobar-FooBar-".replaceAll("(([fF][oO]{2})[bB]ar)", { Object[] it -> it[0].toUpperCase() }) == "FOOBAR-FOOBAR-"
+     *     assert "foobar-FooBar-".replaceAll("(([fF][oO]{2})[bB]ar)", { Object[] it {@code ->} it[0].toUpperCase() }) == "FOOBAR-FOOBAR-"
      *
      *     // Here,
      *     //   it[0] is the global string of the matched group
      *     //   it[1] is the first string in the matched group
      *     //   it[2] is the second string in the matched group
      *
-     *     assert "foobar-FooBar-".replaceAll("(([fF][oO]{2})[bB]ar)", { x, y, z -> z.toUpperCase() }) == "FOO-FOO-"
+     *     assert "foobar-FooBar-".replaceAll("(([fF][oO]{2})[bB]ar)", { x, y, z {@code ->} z.toUpperCase() }) == "FOO-FOO-"
      *
      *     // Here,
      *     //   x is the global string of the matched group
@@ -2576,14 +2576,14 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      *     //   it[1] is the first string in the matched group
      *     //   it[2] is the second string in the matched group
      *
-     *     assert "foobar-FooBar-".replaceAll(~"(([fF][oO]{2})[bB]ar)", { Object[] it -> it[0].toUpperCase() }) == "FOOBAR-FOOBAR-"
+     *     assert "foobar-FooBar-".replaceAll(~"(([fF][oO]{2})[bB]ar)", { Object[] it {@code ->} it[0].toUpperCase() }) == "FOOBAR-FOOBAR-"
      *
      *     // Here,
      *     //   it[0] is the global string of the matched group
      *     //   it[1] is the first string in the matched group
      *     //   it[2] is the second string in the matched group
      *
-     *     assert "foobar-FooBar-".replaceAll("(([fF][oO]{2})[bB]ar)", { x, y, z -> z.toUpperCase() }) == "FOO-FOO-"
+     *     assert "foobar-FooBar-".replaceAll("(([fF][oO]{2})[bB]ar)", { x, y, z {@code ->} z.toUpperCase() }) == "FOO-FOO-"
      *
      *     // Here,
      *     //   x is the global string of the matched group
@@ -3322,10 +3322,10 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * <p>
      * <pre class="groovyTestCase">
      * def text = "Groovy"
-     * assert text.takeWhile{ it < 'A' } == ''
-     * assert text.takeWhile{ it < 'Z' } == 'G'
+     * assert text.takeWhile{ it {@code <} 'A' } == ''
+     * assert text.takeWhile{ it {@code <} 'Z' } == 'G'
      * assert text.takeWhile{ it != 'v' } == 'Groo'
-     * assert text.takeWhile{ it < 'z' } == 'Groovy'
+     * assert text.takeWhile{ it {@code <} 'z' } == 'Groovy'
      * </pre>
      *
      * @param self      the original CharSequence
diff --git a/src/main/java/org/codehaus/groovy/tools/RootLoader.java b/src/main/java/org/codehaus/groovy/tools/RootLoader.java
index 84588da..46e0d5f 100644
--- a/src/main/java/org/codehaus/groovy/tools/RootLoader.java
+++ b/src/main/java/org/codehaus/groovy/tools/RootLoader.java
@@ -38,8 +38,7 @@ import java.util.Map;
  * classloaders. Normal is to first check parent and then look in
  * the resources you gave this classloader.
  * <p>
- * It's possible to add urls to the classpath at runtime through
- * {@link <a href="#addURL(URL)">addURL(URL)</a>}
+ * It's possible to add urls to the classpath at runtime through {@link #addURL(URL)}.
  * <p>
  * <b>Why using RootLoader?</b>
  * If you have to load classes with multiple classloaders and a
@@ -57,15 +56,17 @@ import java.util.Map;
  *           |
  *           |
  *       childLoader    (has classpath: a.jar;b.jar;c.jar)
- *       </pre>
+ * </pre>
  *
  * class C (from c.jar) extends B (from b.jar)
  *
  * childLoader.find("C")
- * --> parentLoader does know C.class, try to load it
- * --> to load C.class it has to load B.class
- * --> parentLoader is unable to find B.class in a.jar or c.jar
- * --> NoClassDefFoundException!
+ * <pre>
+ * --&gt; parentLoader does know C.class, try to load it
+ * --&gt; to load C.class it has to load B.class
+ * --&gt; parentLoader is unable to find B.class in a.jar or c.jar
+ * --&gt; NoClassDefFoundException!
+ * </pre>
  *
  * if childLoader had tried to load the class by itself, there
  * would be no problem. Changing childLoader to be a RootLoader
diff --git a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
index 55f22fb..ee0ce49 100644
--- a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
+++ b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
@@ -346,7 +346,7 @@ public abstract class StaticTypeCheckingSupport {
      *
      * @param params method parameters
      * @param args   type arguments
-     * @return -1 if arguments do not match, 0 if arguments are of the exact type and >0 when one or more argument is
+     * @return -1 if arguments do not match, 0 if arguments are of the exact type and &gt; 0 when one or more argument is
      * not of the exact type but still match
      */
     public static int allParametersAndArgumentsMatch(Parameter[] params, ClassNode[] args) {


[groovy] 04/06: minor refactor: remove javadoc warnings (cont'd)

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 9616f3c466503222a7fbb9bbdbacba8ac4b47f7d
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Apr 27 14:38:16 2019 +1000

    minor refactor: remove javadoc warnings (cont'd)
---
 .../groovy/jmx/builder/JmxBuilderModelMBean.java   |  5 +-
 .../src/main/java/groovy/json/JsonBuilder.java     |  4 +-
 .../src/main/java/groovy/json/JsonGenerator.java   |  2 +-
 .../java/groovy/json/StreamingJsonBuilder.java     | 36 ++++-----
 .../codehaus/groovy/runtime/NioGroovyMethods.java  | 16 ++--
 .../main/java/groovy/servlet/GroovyServlet.java    | 20 ++---
 .../src/main/java/groovy/sql/DataSet.java          |  4 +
 .../java/groovy/sql/ResultSetMetaDataWrapper.java  |  2 +-
 .../groovy-sql/src/main/java/groovy/sql/Sql.java   | 86 +++++++++++-----------
 .../groovy/text/StreamingTemplateEngine.java       | 30 ++++----
 .../main/groovy/groovy/text/XmlTemplateEngine.java |  4 +-
 .../groovy/util/JavadocAssertionTestBuilder.groovy |  3 +-
 .../groovy/util/slurpersupport/GPathResult.java    |  4 +-
 .../src/main/java/groovy/xml/MarkupBuilder.java    | 14 ++--
 14 files changed, 120 insertions(+), 110 deletions(-)

diff --git a/subprojects/groovy-jmx/src/main/java/groovy/jmx/builder/JmxBuilderModelMBean.java b/subprojects/groovy-jmx/src/main/java/groovy/jmx/builder/JmxBuilderModelMBean.java
index 8cd1f0f..2250e2a 100644
--- a/subprojects/groovy-jmx/src/main/java/groovy/jmx/builder/JmxBuilderModelMBean.java
+++ b/subprojects/groovy-jmx/src/main/java/groovy/jmx/builder/JmxBuilderModelMBean.java
@@ -72,7 +72,7 @@ public class JmxBuilderModelMBean extends RequiredModelMBean implements Notifica
     /**
      * Registers listeners for operation calls (i.e. method, getter, and setter calls) when
      * invoked on this bean from the MBeanServer.  Descriptor should contain a map with layout
-     * item -> [Map[methodListener:[target:"", tpe:"", callback:&amp;Closure], ... ,]]
+     * {@code item -> [Map[methodListener:[target:"", tpe:"", callback:&Closure], ... ,]]}
      *
      * @param descriptor MetaMap descriptor containing description of operation call listeners
      */
@@ -109,7 +109,8 @@ public class JmxBuilderModelMBean extends RequiredModelMBean implements Notifica
 
     /**
      * Sets up event listeners for this MBean as described in the descriptor.
-     * The descriptor contains a map with layout {item -> Map[event:"...", from:ObjectName, callback:&amp;Closure],...,}
+     * The descriptor contains a map with layout
+     * {item -&gt; Map[event:"...", from:ObjectName, callback:&amp;Closure],...,}
      *
      * @param server     the MBeanServer is to be registered.
      * @param descriptor a map containing info about the event
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/JsonBuilder.java b/subprojects/groovy-json/src/main/java/groovy/json/JsonBuilder.java
index 999d53a..6a1ca8e 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/JsonBuilder.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/JsonBuilder.java
@@ -193,7 +193,7 @@ public class JsonBuilder extends GroovyObjectSupport implements Writable {
      * def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
      *
      * def json = new groovy.json.JsonBuilder()
-     * json authors, { Author author ->
+     * json authors, { Author author {@code ->}
      *      name author.name
      * }
      *
@@ -400,7 +400,7 @@ public class JsonBuilder extends GroovyObjectSupport implements Writable {
      * json { temperature 37 }
      *
      * def out = new StringWriter()
-     * out << json
+     * out {@code <<} json
      *
      * assert out.toString() == '{"temperature":37}'
      * </code></pre>
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java b/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java
index be61d67..bd9e89a 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java
@@ -225,7 +225,7 @@ public interface JsonGenerator {
          * Example:
          * <pre><code class="groovyTestCase">
          *     def generator = new groovy.json.JsonGenerator.Options()
-         *                         .addConverter(URL) { URL u ->
+         *                         .addConverter(URL) { URL u {@code ->}
          *                             u.getHost()
          *                         }
          *                         .build()
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java b/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java
index 9dd6086..f69dd36 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java
@@ -48,7 +48,7 @@ import java.util.Map;
  * <p>
  * Example:
  * <pre class="groovyTestCase">
- *     new StringWriter().with { w ->
+ *     new StringWriter().with { w {@code ->}
  *         def builder = new groovy.json.StreamingJsonBuilder(w)
  *         builder.people {
  *             person {
@@ -135,7 +135,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *   def json = new groovy.json.StreamingJsonBuilder(w)
      *   json name: "Tim", age: 31
      *
@@ -155,7 +155,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
     /**
      * The empty args call will create a key whose value will be an empty JSON object:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person()
      *
@@ -175,7 +175,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *   def json = new groovy.json.StreamingJsonBuilder(w)
      *   def result = json([1, 2, 3])
      *
@@ -198,7 +198,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *   def json = new groovy.json.StreamingJsonBuilder(w)
      *   def result = json 1, 2, 3
      *
@@ -225,9 +225,9 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * }
      * def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
      *
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
-     *     json authors, { Author author ->
+     *     json authors, { Author author {@code ->}
      *         name author.name
      *     }
      *
@@ -253,7 +253,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *   def json = new groovy.json.StreamingJsonBuilder(w)
      *   json {
      *      name "Tim"
@@ -279,7 +279,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *   def json = new groovy.json.StreamingJsonBuilder(w)
      *   json.person {
      *      name "Tim"
@@ -312,9 +312,9 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * }
      * def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
      *
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
-     *     json.people authors, { Author author ->
+     *     json.people authors, { Author author {@code ->}
      *         name author.name
      *     }
      *
@@ -348,7 +348,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * in case the same key is used.
      *
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person(name: "Tim", age: 35) { town "Manchester" }
      *
@@ -403,7 +403,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example with a classical builder-style:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person {
      *         name "Tim"
@@ -416,7 +416,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      *
      * Or alternatively with a method call taking named arguments:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person name: "Tim", age: 32
      *
@@ -431,7 +431,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * the closure properties overriding the map key/values
      * in case the same key is used.
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person(name: "Tim", age: 35) { town "Manchester" }
      *
@@ -441,7 +441,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      *
      * The empty args call will create a key whose value will be an empty JSON object:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person()
      *
@@ -628,10 +628,10 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
          * }
          * def authorList = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
          *
-         * new StringWriter().with { w ->
+         * new StringWriter().with { w {@code ->}
          *     def json = new groovy.json.StreamingJsonBuilder(w)
          *     json.book {
-         *        authors authorList, { Author author ->
+         *        authors authorList, { Author author {@code ->}
          *         name author.name
          *       }
          *     }
diff --git a/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java b/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java
index e5234e9..947d28c 100644
--- a/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java
+++ b/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java
@@ -465,7 +465,7 @@ public class NioGroovyMethods extends DefaultGroovyMethodsSupport {
      * </pre>
      * or with some help from <code>ExpandoMetaClass</code>, you could do something like:
      * <pre>
-     * myFile.metaClass.setText = { String s -> delegate.setText(s, 'UTF-8') }
+     * myFile.metaClass.setText = { String s {@code ->} delegate.setText(s, 'UTF-8') }
      * myfile.text = 'some text'
      * </pre>
      *
@@ -965,8 +965,8 @@ public class NioGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre>
      * def totalSize = 0
      * def count = 0
-     * def sortByTypeThenName = { a, b ->
-     *     a.isFile() != b.isFile() ? a.isFile() <=> b.isFile() : a.name <=> b.name
+     * def sortByTypeThenName = { a, b {@code ->}
+     *     a.isFile() != b.isFile() ? a.isFile() {@code <=>} b.isFile() : a.name {@code <=>} b.name
      * }
      * rootDir.traverse(
      *         type         : FILES,
@@ -976,7 +976,7 @@ public class NioGroovyMethods extends DefaultGroovyMethodsSupport {
      *                         totalSize = 0; count = 0 },
      *         postRoot     : true
      *         sort         : sortByTypeThenName
-     * ) {it -> totalSize += it.size(); count++ }
+     * ) {it {@code ->} totalSize += it.size(); count++ }
      * </pre>
      *
      * @param self    a Path (that happens to be a folder/directory)
@@ -1197,14 +1197,14 @@ public class NioGroovyMethods extends DefaultGroovyMethodsSupport {
      * // collect names of files in baseDir matching supplied regex pattern
      * import static groovy.io.FileType.*
      * def names = []
-     * baseDir.eachFileMatch FILES, ~/foo\d\.txt/, { names << it.name }
+     * baseDir.eachFileMatch FILES, ~/foo\d\.txt/, { names {@code <<} it.name }
      * assert names == ['foo1.txt', 'foo2.txt']
      *
      * // remove all *.bak files in baseDir
-     * baseDir.eachFileMatch FILES, ~/.*\.bak/, { Path bak -> bak.delete() }
+     * baseDir.eachFileMatch FILES, ~/.*\.bak/, { Path bak {@code ->} bak.delete() }
      *
-     * // print out files > 4K in size from baseDir
-     * baseDir.eachFileMatch FILES, { new Path(baseDir, it).size() > 4096 }, { println "$it.name ${it.size()}" }
+     * // print out files &gt; 4K in size from baseDir
+     * baseDir.eachFileMatch FILES, { new Path(baseDir, it).size() {@code >} 4096 }, { println "$it.name ${it.size()}" }
      * </pre>
      *
      * @param self       a Path (that happens to be a folder/directory)
diff --git a/subprojects/groovy-servlet/src/main/java/groovy/servlet/GroovyServlet.java b/subprojects/groovy-servlet/src/main/java/groovy/servlet/GroovyServlet.java
index 73b044d..ea0ac9a 100644
--- a/subprojects/groovy-servlet/src/main/java/groovy/servlet/GroovyServlet.java
+++ b/subprojects/groovy-servlet/src/main/java/groovy/servlet/GroovyServlet.java
@@ -52,16 +52,18 @@ import java.io.IOException;
  * web.xml entry:
  *
  * <pre>
- *    &lt;servlet>
- *      &lt;servlet-name>Groovy&lt;/servlet-name>
- *      &lt;servlet-class>groovy.servlet.GroovyServlet&lt;/servlet-class>
- *    &lt;/servlet>
+ * {@code
+ *    <servlet>
+ *      <servlet-name>Groovy</servlet-name>
+ *      <servlet-class>groovy.servlet.GroovyServlet</servlet-class>
+ *    </servlet>
  *
- *    &lt;servlet-mapping>
- *      &lt;servlet-name>Groovy&lt;/servlet-name>
- *      &lt;url-pattern>*.groovy&lt;/url-pattern>
- *      &lt;url-pattern>*.gdo&lt;/url-pattern>
- *    &lt;/servlet-mapping>
+ *    <servlet-mapping>
+ *      <servlet-name>Groovy</servlet-name>
+ *      <url-pattern>*.groovy</url-pattern>
+ *      <url-pattern>*.gdo</url-pattern>
+ *    </servlet-mapping>
+ * }
  * </pre>
  *
  * <p>The URL pattern does not require the "*.groovy" mapping.  You can, for
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java b/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
index 7d3c922..0ea6b91 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
@@ -40,6 +40,7 @@ import java.util.Set;
  * and querying databases using POGO fields and operators rather than
  * JDBC-level API calls and RDBMS column names. So, instead of a query like:
  * <pre>
+ * {@code
  * def db = // an instance of groovy.sql.Sql
  * def sql = '''select * from Person
  *     where (purchaseCount > ? and birthMonth = ?)
@@ -48,9 +49,11 @@ import java.util.Set;
  *     order by firstName DESC, age'''
  * def params = [10, "January", "Zulu", "Alpha", 99, 5, "Bert"]
  * def sortedPeopleOfInterest = db.rows(sql, params)
+ * }
  * </pre>
  * You can write code like this:
  * <pre>
+ * @{code
  * def person = new DataSet(db, 'Person') // or db.dataSet('Person'), or db.dataSet(Person)
  * def janFrequentBuyers = person.findAll { it.purchaseCount > 10 && it.lastName == "January" }
  * def sortedPeopleOfInterest = janFrequentBuyers.
@@ -60,6 +63,7 @@ import java.util.Set;
  *     sort{ it.firstName }.reverse().
  *     findAll{ it.firstName != 'Bert' }.
  *     sort{ it.age }
+ * }
  * </pre>
  * Currently, the Groovy source code for any accessed POGO must be on the
  * classpath at runtime. Also, at the moment, the expressions (or nested expressions) can only contain
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/ResultSetMetaDataWrapper.java b/subprojects/groovy-sql/src/main/java/groovy/sql/ResultSetMetaDataWrapper.java
index 025d171..b73360f 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/ResultSetMetaDataWrapper.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/ResultSetMetaDataWrapper.java
@@ -29,7 +29,7 @@ import java.sql.ResultSetMetaData;
  * This class defines a wrapper for accessing a specific column in <code>ResultSetMetaData</code>.
  * This allows iteration over columns using idiomatic Groovy, e.g.:
  * <pre>
- * meta.each {col ->
+ * meta.each {col {@code ->}
  *   println col.columnName
  * }
  * </pre>
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
index cc521ef..0b891ec 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
@@ -111,7 +111,7 @@ import static org.apache.groovy.sql.extensions.SqlExtensions.toRowResult;
  * Now try a query using <code>eachRow</code>:
  * <pre>
  * println 'Some GR8 projects:'
- * sql.eachRow('select * from PROJECT') { row ->
+ * sql.eachRow('select * from PROJECT') { row {@code ->}
  *     println "${row.name.padRight(10)} ($row.url)"
  * }
  * </pre>
@@ -136,7 +136,7 @@ import static org.apache.groovy.sql.extensions.SqlExtensions.toRowResult;
  * </pre>
  * Also, <code>eachRow</code> and <code>rows</code> support paging.  Here's an example: 
  * <pre>
- * sql.eachRow('select * from PROJECT', 2, 2) { row ->
+ * sql.eachRow('select * from PROJECT', 2, 2) { row {@code ->}
  *     println "${row.name.padRight(10)} ($row.url)"
  * }
  * </pre>
@@ -888,7 +888,7 @@ public class Sql implements AutoCloseable {
      * def fieldName = 'firstname'
      * def fieldOp = Sql.expand('like')
      * def fieldVal = '%a%'
-     * sql.query "select * from PERSON where ${Sql.expand(fieldName)} $fieldOp ${fieldVal}", { ResultSet rs ->
+     * sql.query "select * from PERSON where ${Sql.expand(fieldName)} $fieldOp ${fieldVal}", { ResultSet rs {@code ->}
      *     while (rs.next()) println rs.getString('firstname')
      * }
      * // query will be 'select * from PERSON where firstname like ?'
@@ -959,11 +959,11 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usages:
      * <pre>
-     * sql.query("select * from PERSON where firstname like 'S%'") { ResultSet rs ->
+     * sql.query("select * from PERSON where firstname like 'S%'") { ResultSet rs {@code ->}
      *     while (rs.next()) println rs.getString('firstname') + ' ' + rs.getString(3)
      * }
      *
-     * sql.query("call get_people_places()") { ResultSet rs ->
+     * sql.query("call get_people_places()") { ResultSet rs {@code ->}
      *     while (rs.next()) println rs.toRowResult().firstname
      * }
      * </pre>
@@ -999,7 +999,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * sql.query('select * from PERSON where lastname like ?', ['%a%']) { ResultSet rs ->
+     * sql.query('select * from PERSON where lastname like ?', ['%a%']) { ResultSet rs {@code ->}
      *     while (rs.next()) println rs.getString('lastname')
      * }
      * </pre>
@@ -1074,7 +1074,7 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * sql.query "select * from PERSON where location_id < $location", { ResultSet rs ->
+     * sql.query "select * from PERSON where location_id {@code <} $location", { ResultSet rs {@code ->}
      *     while (rs.next()) println rs.getString('firstname')
      * }
      * </pre>
@@ -1100,7 +1100,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usages:
      * <pre>
-     * sql.eachRow("select * from PERSON where firstname like 'S%'") { row ->
+     * sql.eachRow("select * from PERSON where firstname like 'S%'") { row {@code ->}
      *    println "$row.firstname ${row[2]}}"
      * }
      *
@@ -1157,13 +1157,13 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * def printColNames = { meta ->
+     * def printColNames = { meta {@code ->}
      *     (1..meta.columnCount).each {
      *         print meta.getColumnLabel(it).padRight(20)
      *     }
      *     println()
      * }
-     * def printRow = { row ->
+     * def printRow = { row {@code ->}
      *     row.toRowResult().values().each{ print it.toString().padRight(20) }
      *     println()
      * }
@@ -1349,13 +1349,13 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * def printColNames = { meta ->
+     * def printColNames = { meta {@code ->}
      *     (1..meta.columnCount).each {
      *         print meta.getColumnLabel(it).padRight(20)
      *     }
      *     println()
      * }
-     * def printRow = { row ->
+     * def printRow = { row {@code ->}
      *     row.toRowResult().values().each{ print it.toString().padRight(20) }
      *     println()
      * }
@@ -1421,7 +1421,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * sql.eachRow("select * from PERSON where lastname like ?", ['%a%']) { row ->
+     * sql.eachRow("select * from PERSON where lastname like ?", ['%a%']) { row {@code ->}
      *     println "${row[1]} $row.lastname"
      * }
      * </pre>
@@ -1542,17 +1542,17 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * def printColNames = { meta ->
+     * def printColNames = { meta {@code ->}
      *     (1..meta.columnCount).each {
      *         print meta.getColumnLabel(it).padRight(20)
      *     }
      *     println()
      * }
-     * def printRow = { row ->
+     * def printRow = { row {@code ->}
      *     row.toRowResult().values().each{ print it.toString().padRight(20) }
      *     println()
      * }
-     * sql.eachRow("select * from PERSON where location_id < $location", printColNames, printRow)
+     * sql.eachRow("select * from PERSON where location_id {@code <} $location", printColNames, printRow)
      * </pre>
      * <p>
      * Resource handling is performed automatically where appropriate.
@@ -1641,7 +1641,7 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * sql.eachRow("select * from PERSON where location_id < $location") { row ->
+     * sql.eachRow("select * from PERSON where location_id {@code <} $location") { row {@code ->}
      *     println row.firstname
      * }
      * </pre>
@@ -1709,7 +1709,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * def printNumCols = { meta -> println "Found $meta.columnCount columns" }
+     * def printNumCols = { meta {@code ->} println "Found $meta.columnCount columns" }
      * def ans = sql.rows("select * from PERSON", printNumCols)
      * println "Found ${ans.size()} rows"
      * </pre>
@@ -1911,7 +1911,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * def printNumCols = { meta -> println "Found $meta.columnCount columns" }
+     * def printNumCols = { meta {@code ->} println "Found $meta.columnCount columns" }
      * def ans = sql.rows("select * from PERSON where lastname like ?", ['%a%'], printNumCols)
      * println "Found ${ans.size()} rows"
      * </pre>
@@ -1919,7 +1919,7 @@ public class Sql implements AutoCloseable {
      * This method supports named and named ordinal parameters by supplying such
      * parameters in the <code>params</code> list. Here is an example:
      * <pre>
-     * def printNumCols = { meta -> println "Found $meta.columnCount columns" }
+     * def printNumCols = { meta {@code ->} println "Found $meta.columnCount columns" }
      *
      * def mapParam = [foo: 'Smith']
      * def domainParam = new MyDomainClass(bar: 'John')
@@ -2088,7 +2088,7 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * def ans = sql.rows("select * from PERSON where location_id < $location")
+     * def ans = sql.rows("select * from PERSON where location_id {@code <} $location")
      * println "Found ${ans.size()} rows"
      * </pre>
      * <p>
@@ -2112,8 +2112,8 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * def printNumCols = { meta -> println "Found $meta.columnCount columns" }
-     * def ans = sql.rows("select * from PERSON where location_id < $location", printNumCols)
+     * def printNumCols = { meta {@code ->} println "Found $meta.columnCount columns" }
+     * def ans = sql.rows("select * from PERSON where location_id {@code <} $location", printNumCols)
      * println "Found ${ans.size()} rows"
      * </pre>
      * <p>
@@ -2200,7 +2200,7 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * def ans = sql.firstRow("select * from PERSON where location_id < $location")
+     * def ans = sql.firstRow("select * from PERSON where location_id {@code <} $location")
      * println ans.firstname
      * </pre>
      * <p>
@@ -2349,12 +2349,12 @@ public class Sql implements AutoCloseable {
      * Example usages:
      * <pre>
      * boolean first = true
-     * sql.execute "{call FindAllByFirst('J')}", { isResultSet, result ->
+     * sql.execute "{call FindAllByFirst('J')}", { isResultSet, result {@code ->}
      *   if (first) {
      *     first = false
-     *     assert !isResultSet && result == 0
+     *     assert !isResultSet {@code &&} result == 0
      *   } else {
-     *     assert isResultSet && result == [[ID:1, FIRSTNAME:'James', LASTNAME:'Strachan'], [ID:4, FIRSTNAME:'Jean', LASTNAME:'Gabin']]
+     *     assert isResultSet {@code &&} result == [[ID:1, FIRSTNAME:'James', LASTNAME:'Strachan'], [ID:4, FIRSTNAME:'Jean', LASTNAME:'Gabin']]
      *   }
      * }
      * </pre>
@@ -3116,7 +3116,7 @@ public class Sql implements AutoCloseable {
      * </pre>
      * we can now call the stored procedure as follows:
      * <pre>
-     * sql.call '{call Hemisphere(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells ->
+     * sql.call '{call Hemisphere(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3158,7 +3158,7 @@ public class Sql implements AutoCloseable {
      * </pre>
      * and here is how you access the stored function for all databases:
      * <pre>
-     * sql.call("{? = call FullName(?)}", [Sql.VARCHAR, 'Sam']) { name ->
+     * sql.call("{? = call FullName(?)}", [Sql.VARCHAR, 'Sam']) { name {@code ->}
      *     assert name == 'Sam Pullara'
      * }
      * </pre>
@@ -3184,7 +3184,7 @@ public class Sql implements AutoCloseable {
      * <pre>
      * def first = 'Scott'
      * def last = 'Davis'
-     * sql.call "{call Hemisphere($first, $last, ${Sql.VARCHAR})}", { dwells ->
+     * sql.call "{call Hemisphere($first, $last, ${Sql.VARCHAR})}", { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3194,7 +3194,7 @@ public class Sql implements AutoCloseable {
      * Once created, it can be called like this:
      * <pre>
      * def first = 'Sam'
-     * sql.call("{$Sql.VARCHAR = call FullName($first)}") { name ->
+     * sql.call("{$Sql.VARCHAR = call FullName($first)}") { name {@code ->}
      *     assert name == 'Sam Pullara'
      * }
      * </pre>
@@ -3225,7 +3225,7 @@ public class Sql implements AutoCloseable {
      * <pre>
      * def first = 'Jeff'
      * def last = 'Sheets'
-     * def rows = sql.callWithRows "{call Hemisphere2($first, $last, ${Sql.VARCHAR})}", { dwells ->
+     * def rows = sql.callWithRows "{call Hemisphere2($first, $last, ${Sql.VARCHAR})}", { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3254,7 +3254,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Once created, the stored procedure can be called like this:
      * <pre>
-     * def rows = sql.callWithRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells ->
+     * def rows = sql.callWithRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3284,7 +3284,7 @@ public class Sql implements AutoCloseable {
      * <pre>
      * def first = 'Jeff'
      * def last = 'Sheets'
-     * def rowsList = sql.callWithAllRows "{call Hemisphere2($first, $last, ${Sql.VARCHAR})}", { dwells ->
+     * def rowsList = sql.callWithAllRows "{call Hemisphere2($first, $last, ${Sql.VARCHAR})}", { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3313,7 +3313,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Once created, the stored procedure can be called like this:
      * <pre>
-     * def rowsList = sql.callWithAllRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells ->
+     * def rowsList = sql.callWithAllRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3506,7 +3506,7 @@ public class Sql implements AutoCloseable {
      * configured using this closure. The statement being configured is passed into the closure
      * as its single argument, e.g.:
      * <pre>
-     * sql.withStatement{ stmt -> stmt.maxRows = 10 }
+     * sql.withStatement{ stmt {@code ->} stmt.maxRows = 10 }
      * def firstTenRows = sql.rows("select * from table")
      * </pre>
      *
@@ -3629,7 +3629,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Use it like this:
      * <pre>
-     * def updateCounts = sql.withBatch { stmt ->
+     * def updateCounts = sql.withBatch { stmt {@code ->}
      *     stmt.addBatch("insert into TABLENAME ...")
      *     stmt.addBatch("insert into TABLENAME ...")
      *     stmt.addBatch("insert into TABLENAME ...")
@@ -3673,7 +3673,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Use it like this for batchSize of 20:
      * <pre>
-     * def updateCounts = sql.withBatch(20) { stmt ->
+     * def updateCounts = sql.withBatch(20) { stmt {@code ->}
      *     stmt.addBatch("insert into TABLENAME ...")
      *     stmt.addBatch("insert into TABLENAME ...")
      *     stmt.addBatch("insert into TABLENAME ...")
@@ -3737,7 +3737,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * An example:
      * <pre>
-     * def updateCounts = sql.withBatch('insert into TABLENAME(a, b, c) values (?, ?, ?)') { ps ->
+     * def updateCounts = sql.withBatch('insert into TABLENAME(a, b, c) values (?, ?, ?)') { ps {@code ->}
      *     ps.addBatch([10, 12, 5])
      *     ps.addBatch([7, 3, 98])
      *     ps.addBatch(22, 67, 11)
@@ -3787,7 +3787,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Below is an example using a batchSize of 20:
      * <pre>
-     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (?, ?, ?)') { ps ->
+     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (?, ?, ?)') { ps {@code ->}
      *     ps.addBatch(10, 12, 5)      // varargs style
      *     ps.addBatch([7, 3, 98])     // list
      *     ps.addBatch([22, 67, 11])
@@ -3796,7 +3796,7 @@ public class Sql implements AutoCloseable {
      * </pre>
      * Named parameters (into maps or domain objects) are also supported:
      * <pre>
-     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (:foo, :bar, :baz)') { ps ->
+     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (:foo, :bar, :baz)') { ps {@code ->}
      *     ps.addBatch([foo:10, bar:12, baz:5])  // map
      *     ps.addBatch(foo:7, bar:3, baz:98)     // Groovy named args allow outer brackets to be dropped
      *     ...
@@ -3804,7 +3804,7 @@ public class Sql implements AutoCloseable {
      * </pre>
      * Named ordinal parameters (into maps or domain objects) are also supported:
      * <pre>
-     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (?1.foo, ?2.bar, ?2.baz)') { ps ->
+     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (?1.foo, ?2.bar, ?2.baz)') { ps {@code ->}
      *     ps.addBatch([[foo:22], [bar:67, baz:11]])  // list of maps or domain objects
      *     ps.addBatch([foo:10], [bar:12, baz:5])     // varargs allows outer brackets to be dropped
      *     ps.addBatch([foo:7], [bar:3, baz:98])
@@ -3812,7 +3812,7 @@ public class Sql implements AutoCloseable {
      * }
      * // swap to batch size of 5 and illustrate simple and domain object cases ...
      * class Person { String first, last }
-     * def updateCounts2 = sql.withBatch(5, 'insert into PERSON(id, first, last) values (?1, ?2.first, ?2.last)') { ps ->
+     * def updateCounts2 = sql.withBatch(5, 'insert into PERSON(id, first, last) values (?1, ?2.first, ?2.last)') { ps {@code ->}
      *     ps.addBatch(1, new Person(first:'Peter', last:'Pan'))
      *     ps.addBatch(2, new Person(first:'Snow', last:'White'))
      *     ...
diff --git a/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java b/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java
index a902404..8be0abc 100644
--- a/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java
+++ b/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java
@@ -69,9 +69,9 @@ import java.util.Map;
  *   title     : 'Groovy for COBOL programmers'
  * ]
  * def text = '''\
- * Dear <% out.print firstname %> ${lastname},
+ * Dear {@code <%} out.print firstname {@code %>} ${lastname},
  *
- * We <% if (accepted) out.print 'are pleased' else out.print 'regret' %> \
+ * We {@code <%} if (accepted) out.print 'are pleased' else out.print 'regret' {@code %>} \
  * to inform you that your paper entitled
  * '$title' was ${ accepted ? 'accepted' : 'rejected' }.
  *
@@ -119,8 +119,8 @@ import java.util.Map;
  * context lines, ie:
  * <pre>
  *  groovy.text.TemplateExecutionException: Template parse error at line 4:
- *           3: We <% if (accepted) out.print 'are pleased' else out.print 'regret' %> to inform you that your paper entitled
- *       --> 4: '$txitle' was ${ accepted ? 'accepted' : 'rejected' }.
+ *           3: We {@code <%} if (accepted) out.print 'are pleased' else out.print 'regret' {@code %>} to inform you that your paper entitled
+ *       {@code -->} 4: '$txitle' was ${ accepted ? 'accepted' : 'rejected' }.
  *           5:
  * at test.run(test.groovy:18)
  *
@@ -168,11 +168,9 @@ public class StreamingTemplateEngine extends TemplateEngine {
     }
 
     /**
-     * <p>Creates a template instance using the template source from the provided Reader.</p>
-     *
-     * <p>The template can be applied repeatedly on different bindings to produce custom
-     * output.</p>
+     * Creates a template instance using the template source from the provided Reader.
      *
+     * The template can be applied repeatedly on different bindings to produce custom output.
      *
      * <strong>Technical detail</strong><br />
      * Under the hood the returned template is represented as a four argument
@@ -182,21 +180,21 @@ public class StreamingTemplateEngine extends TemplateEngine {
      * In essence we start with a closure on the form:
      *
      * <pre>
-     *   { parentClass, stringSectionList, binding, out ->
+     *   { parentClass, stringSectionList, binding, out {@code ->}
      *      //code generated by parsing the template data
-     *   }                                                                             *
+     *   }
      * </pre>
      *
-     * , we then curry in the parentClass and stringSectionList arguments so that the StreamingTemplate
+     * We then curry in the parentClass and stringSectionList arguments so that the StreamingTemplate
      * instance returned from 'createTemplate' internally contains a template closure on the form:
      *
      * <pre>
-     *   { binding, out ->
+     *   { binding, out {@code ->}
      *      //code generated by parsing the template data
-     *   }                                                                             *
+     *   }
      * </pre>
      *
-     * Calling template.make(binding), curries in the 'binding' argument:
+     * Calling {@code template.make(binding)}, curries in the 'binding' argument:
      *
      * <pre>
      *   public Writable make(final Map map) {
@@ -205,11 +203,11 @@ public class StreamingTemplateEngine extends TemplateEngine {
      *   }
      * </pre>
      *
-     * which only leaves the 'out' argument unbound. The only method on the {@link groovy.lang.Writable writable} interface is
+     * This only leaves the 'out' argument unbound. The only method on the {@link groovy.lang.Writable writable} interface is
      * {@link groovy.lang.Writable#writeTo writeTo(Writer out)} so groovy rules about casting a closure to a one-method-interface
      * apply and the above works. I.e. we return the now one argument closure as the Writable
      * which can be serialized to System.out, a file, etc according to the Writable interface contract.
-     * </p>
+     *
      * @see groovy.text.TemplateEngine#createTemplate(java.io.Reader)
      */
     @Override
diff --git a/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java b/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
index 6f505af..70db3c3 100644
--- a/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
+++ b/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
@@ -54,7 +54,7 @@ import java.util.Map;
  * <p>
  * Comments and processing instructions
  * will be removed as part of processing and special XML characters such as
- * &lt;, &gt;, &quot and &apos; will be escaped using the respective XML notation.
+ * &lt;, &gt;, &quot; and &apos; will be escaped using the respective XML notation.
  * The output will also be indented using standard XML pretty printing.
  * <p>
  * The xmlns namespace definition for <code>gsp:</code> tags will be removed
@@ -74,7 +74,7 @@ import java.util.Map;
  *   &lt;gsp:expression&gt;greeting&lt;/gsp:expression&gt;
  *   &lt;foo:to&gt;$firstname "$nickname" $lastname&lt;/foo:to&gt;
  *   How are you today?
- * &lt;/document>
+ * &lt;/document&gt;
  * '''
  * def template = engine.createTemplate(text).make(binding)
  * println template.toString()
diff --git a/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy b/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy
index 54900a2..b1e3a2a 100644
--- a/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy
+++ b/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy
@@ -26,7 +26,8 @@ import java.util.regex.Pattern
  * attribute assignment. Example:
  * <pre>&lt;pre class="groovyTestCase"&gt; assert "example".size() == 7 &lt;/pre&gt;</pre>
  * When extracting the code for the test, single-line snippets of code without braces within a {{@code @code} ...}
- * tag will have the javadoc {@code code} tag stripped.
+ * tag will have the javadoc {@code code} tag stripped. Similarly, html entities are converted back when extracting
+ * code, so {@code &lt;} and {@code &gt;} will be converted to {@code <} and {@code >}.
  */
 class JavadocAssertionTestBuilder {
     // TODO write tests for this classes functionality
diff --git a/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
index 3e37a1c..abd1c66 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
@@ -412,7 +412,7 @@ public abstract class GPathResult extends GroovyObjectSupport implements Writabl
      * &lt;characterList&gt;
      *   &lt;character/&gt;
      *   &lt;character&gt;
-     *     &lt;name>Gromit&lt;/name&gt;
+     *     &lt;name&gt;Gromit&lt;/name&gt;
      *   &lt;/character&gt;
      * &lt;/characterList&gt;"""
      *
@@ -452,7 +452,7 @@ public abstract class GPathResult extends GroovyObjectSupport implements Writabl
      * <pre class="groovyTestCase">
      * import groovy.util.slurpersupport.*
      * def text = """
-     * &lt;characterList>
+     * &lt;characterList&gt;
      *   &lt;character&gt;Wallace&lt;/character&gt;
      *   &lt;character&gt;Gromit&lt;/character&gt;
      *   &lt;character&gt;Shaun&lt;/character&gt;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java b/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java
index d67e842..c469f95 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java
@@ -33,19 +33,23 @@ import java.util.Map;
  * The builder supports various 'pretty printed' formats.
  * <p>
  * Example:
- * <pre>new MarkupBuilder().root {
+ * <pre>
+ * new MarkupBuilder().root {
  *   a( a1:'one' ) {
- *     b { mkp.yield( '3 < 5' ) }
+ *     b { mkp.yield( '3 {@code <} 5' ) }
  *     c( a2:'two', 'blah' )
  *   }
- * }</pre>
+ * }
+ * </pre>
  * Will print the following to System.out:
- * <pre>&lt;root&gt;
+ * <pre>
+ * &lt;root&gt;
  *   &lt;a a1='one'&gt;
  *     &lt;b&gt;3 &amp;lt; 5&lt;/b&gt;
  *     &lt;c a2='two'&gt;blah&lt;/c&gt;
  *   &lt;/a&gt;
- * &lt;/root&gt;</pre>
+ * &lt;/root&gt;
+ * </pre>
  * Notes:
  * <ul>
  *    <li><code>mkp</code> is a special namespace used to escape


[groovy] 01/06: minor refactor: remove javadoc warnings and tidy up

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit b298d52375a1a1ff721608d70d86dd1df2415eea
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Apr 27 11:06:28 2019 +1000

    minor refactor: remove javadoc warnings and tidy up
---
 .../groovy/classgen/asm/BytecodeHelper.java        | 59 ++++++++++------------
 1 file changed, 28 insertions(+), 31 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java b/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java
index b010726..bf9238f 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java
@@ -211,7 +211,7 @@ public class BytecodeHelper implements Opcodes {
     }
     
     /**
-     * negate a boolean on stack. true->false, false->true
+     * Negate a boolean on stack.
      */
     public static void negateBoolean(MethodVisitor mv) {
         // code to negate the primitive boolean
@@ -225,7 +225,7 @@ public class BytecodeHelper implements Opcodes {
         mv.visitLabel(endLabel);
     }
 
-    /**
+    /* *
      * load a message on the stack and remove it right away. Good for put a mark in the generated bytecode for debugging purpose.
      *
      * @param msg
@@ -239,8 +239,6 @@ public class BytecodeHelper implements Opcodes {
      * returns a name that Class.forName() can take. Notably for arrays:
      * [I, [Ljava.lang.String; etc
      * Regular object type:  java.lang.String
-     *
-     * @param name
      */
     public static String formatNameForClassLoading(String name) {
         if (name == null) {
@@ -280,8 +278,8 @@ public class BytecodeHelper implements Opcodes {
 
     private static boolean hasGenerics(Parameter[] param) {
         if (param.length == 0) return false;
-        for (int i = 0; i < param.length; i++) {
-            ClassNode type = param[i].getType();
+        for (Parameter parameter : param) {
+            ClassNode type = parameter.getType();
             if (hasGenerics(type)) return true;
         }
         return false;
@@ -322,8 +320,8 @@ public class BytecodeHelper implements Opcodes {
         if (sclass.isUsingGenerics()) return true;
         ClassNode[] interfaces = node.getInterfaces();
         if (interfaces != null) {
-            for (int i = 0; i < interfaces.length; i++) {
-                if (interfaces[i].isUsingGenerics()) return true;
+            for (ClassNode anInterface : interfaces) {
+                if (anInterface.isUsingGenerics()) return true;
             }
         }
 
@@ -338,8 +336,8 @@ public class BytecodeHelper implements Opcodes {
         GenericsType extendsPart = new GenericsType(node.getUnresolvedSuperClass(false));
         writeGenericsBounds(ret, extendsPart, true);
         ClassNode[] interfaces = node.getInterfaces();
-        for (int i = 0; i < interfaces.length; i++) {
-            GenericsType interfacePart = new GenericsType(interfaces[i]);
+        for (ClassNode anInterface : interfaces) {
+            GenericsType interfacePart = new GenericsType(anInterface);
             writeGenericsBounds(ret, interfacePart, false);
         }
         return ret.toString();
@@ -348,11 +346,11 @@ public class BytecodeHelper implements Opcodes {
     private static void getGenericsTypeSpec(StringBuilder ret, GenericsType[] genericsTypes) {
         if (genericsTypes == null) return;
         ret.append('<');
-        for (int i = 0; i < genericsTypes.length; i++) {
-            String name = genericsTypes[i].getName();
+        for (GenericsType genericsType : genericsTypes) {
+            String name = genericsType.getName();
             ret.append(name);
             ret.append(':');
-            writeGenericsBounds(ret, genericsTypes[i], true);
+            writeGenericsBounds(ret, genericsType, true);
         }
         ret.append('>');
     }
@@ -388,8 +386,8 @@ public class BytecodeHelper implements Opcodes {
     private static void writeGenericsBounds(StringBuilder ret, GenericsType type, boolean writeInterfaceMarker) {
         if (type.getUpperBounds() != null) {
             ClassNode[] bounds = type.getUpperBounds();
-            for (int i = 0; i < bounds.length; i++) {
-                writeGenericsBoundType(ret, bounds[i], writeInterfaceMarker);
+            for (ClassNode bound : bounds) {
+                writeGenericsBoundType(ret, bound, writeInterfaceMarker);
             }
         } else if (type.getLowerBound() != null) {
             writeGenericsBoundType(ret, type.getLowerBound(), writeInterfaceMarker);
@@ -401,29 +399,28 @@ public class BytecodeHelper implements Opcodes {
     private static void addSubTypes(StringBuilder ret, GenericsType[] types, String start, String end) {
         if (types == null) return;
         ret.append(start);
-        for (int i = 0; i < types.length; i++) {
-            if (types[i].getType().isArray()) {
+        for (GenericsType type : types) {
+            if (type.getType().isArray()) {
                 ret.append("[");
-                addSubTypes(ret, new GenericsType[]{new GenericsType(types[i].getType().getComponentType())}, "", "");
-            }
-            else {
-                if (types[i].isPlaceholder()) {
+                addSubTypes(ret, new GenericsType[]{new GenericsType(type.getType().getComponentType())}, "", "");
+            } else {
+                if (type.isPlaceholder()) {
                     ret.append('T');
-                    String name = types[i].getName();
+                    String name = type.getName();
                     ret.append(name);
                     ret.append(';');
-                } else if (types[i].isWildcard()) {
-                    if (types[i].getUpperBounds() != null) {
+                } else if (type.isWildcard()) {
+                    if (type.getUpperBounds() != null) {
                         ret.append('+');
-                        writeGenericsBounds(ret, types[i], false);
-                    } else if (types[i].getLowerBound() != null) {
+                        writeGenericsBounds(ret, type, false);
+                    } else if (type.getLowerBound() != null) {
                         ret.append('-');
-                        writeGenericsBounds(ret, types[i], false);
+                        writeGenericsBounds(ret, type, false);
                     } else {
                         ret.append('*');
                     }
                 } else {
-                    writeGenericsBounds(ret, types[i], false);
+                    writeGenericsBounds(ret, type, false);
                 }
             }
         }
@@ -559,7 +556,7 @@ public class BytecodeHelper implements Opcodes {
     public static boolean isSameCompilationUnit(ClassNode a, ClassNode b) {
         CompileUnit cu1 = a.getCompileUnit();
         CompileUnit cu2 = b.getCompileUnit();
-        return cu1 !=null && cu2 !=null && cu1==cu2;
+        return cu1 != null && cu1 == cu2;
     }
 
     /**
@@ -571,8 +568,8 @@ public class BytecodeHelper implements Opcodes {
     public static int hashCode(String str) {
         final char[] chars = str.toCharArray();
         int h = 0;
-        for (int i = 0; i < chars.length; i++) {
-            h = 31 * h + chars[i];
+        for (char aChar : chars) {
+            h = 31 * h + aChar;
         }
         return h;
     }