Changelog for Groovy 2.5.0

Bug

  • [GROOVY-2972] - groovy.lang.ObjectRange.size() disobeys its contract for large ranges of Long values.
  • [GROOVY-3233] - The main(args) entry point cannot be found when a class file has multiple classes and the first class extends another class.
  • [GROOVY-3395] - calling binding variable as function fails to try object's call() method
  • [GROOVY-4255] - BUG! exception in phase 'class generation' ... SpreadExpression should not be visited here
  • [GROOVY-4356] - Static members should not be able to access class-level generic types
  • [GROOVY-4787] - BUG! exception in phase 'class generation' generating class from map in closure
  • [GROOVY-4811] - exception while compiling annotation type
  • [GROOVY-4851] - NullPointerException on iterator() call
  • [GROOVY-5318] - generic types in fully-qualified class names parsing error
  • [GROOVY-5320] - groovyc ant task cannot compile Servlet using Java EE 6 reference API libaries (results in ClassFormatError Missing Code attribute)
  • [GROOVY-5471] - Add "indy" option to Groovy Console
  • [GROOVY-5912] - Static compilation: Groovy doesn't fail compilation when accessing package scope methods, but fails at runtime
  • [GROOVY-5936] - java.lang.OutOfMemoryError through Iterator.collectEntries and others (part 2: handle others)
  • [GROOVY-6052] - ++ or -- doesn't respect final modifier
  • [GROOVY-6167] - Generics: within a single declaration, generic type definition order matters
  • [GROOVY-6212] - SpreadExpression BUG! when slicing a List
  • [GROOVY-6263] - Accessing private methods from public ones using categories and inheritance causes MissingMethodException *
  • [GROOVY-6396] - same linkedlist code different behavior between groovy and java *
  • [GROOVY-6454] - Can't delegate (with the @Delegate annotation) to a method whose name contains a dollar ($) character
  • [GROOVY-6523] - Improve Documentation for in DefaultGroovyMethods.intersect(..)
  • [GROOVY-6617] - joint compiler fails to compile groovy class implemented java interface
  • [GROOVY-6619] - Groovy command-line parser breaks when parsing '-n'
  • [GROOVY-6632] - CompileStatic selects wrong constructor when GString is a parameter
  • [GROOVY-6634] - Annotated enum constants breaks enum
  • [GROOVY-6659] - generic bounds ignored by type checking
  • [GROOVY-6660] - invalid generics symbol arity does not lead to compilation error
  • [GROOVY-6742] - Groovy is unable to resolve this Generics use case
  • [GROOVY-6938] - Wrong error reported by @CompileStatic when overriding a method returning a parameterized value
  • [GROOVY-6977] - Method type parameter resolved to class with anonymous inner class
  • [GROOVY-6991] - CliBuilder.usage() fails with SIOBE if header/footer longer than 74 chars
  • [GROOVY-7013] - GroovyDoc cannot parse several .java files from java 1.7 source code
  • [GROOVY-7014] - A Java compile time error results in a runtime exception in Groovy
  • [GROOVY-7031] - @CompileStatic breaks assign in combination with dereferencing
  • [GROOVY-7061] - Type inference not working for Collections.sort()
  • [GROOVY-7083] - PermGen memory leak in ConfigSlurper.parse(Script script, URL location)
  • [GROOVY-7087] - @TupleConstructor and @Builder should be able to use defined setters rather than the field directly
  • [GROOVY-7151] - groovyc should accept meta annotation with ElementType.TYPE
  • [GROOVY-7202] - Unable to resolve nested enum of parent class when compiling against binary parent
  • [GROOVY-7204] - Static type checking and compilation fail when multiple generics in use
  • [GROOVY-7259] - groovydoc only considers package level fields as properties even if you have a get and set methods declared
  • [GROOVY-7283] - DefaultGroovyMethods methods should include type information
  • [GROOVY-7325] - Verify error cloning a HashSet under CompileStatic conditions
  • [GROOVY-7385] - Invalid Integer & Long literals compile when they shouldn't
  • [GROOVY-7390] - @EqualsAndHashCode incorrect when using non-field properties
  • [GROOVY-7394] - @ToString could support non-field properties *
  • [GROOVY-7417] - @EqualsAndHashCode inconsistent when using boolean properties for classes with explicit getters
  • [GROOVY-7433] - API inconsistency between takeWhile, dropWhile and collectReplacements for CharSequences *
  • [GROOVY-7434] - Groovy should support resolving ambiguous signatures when using ClosureParams
  • [GROOVY-7440] - Improve ClosureParam type hints for various splitEachLine GroovyMethod methods
  • [GROOVY-7443] - instantiating a class withTraits does not use the classloader of the trait
  • [GROOVY-7465] - ResourceGroovyMethods/NioGroovyMethods BOM behavior is inconsistent
  • [GROOVY-7522] - TupleConstructor overwrites declared constructors
  • [GROOVY-7523] - TupleConstructor with empty includes includes all
  • [GROOVY-7529] - Fix up transforms (apart from TupleConstructor) which are affected by empty includes default
  • [GROOVY-7562] - imports and custom class defs not working in Groovysh Interpreter Mode
  • [GROOVY-7566] - Groovysh command arguments parser does not handle escaped blanks
  • [GROOVY-7567] - Groovysh File completion with hyphens broken
  • [GROOVY-7573] - Groovyc ant task does not release file handles
  • [GROOVY-7585] - ObjectRange strange semantics for mismatched arguments
  • [GROOVY-7608] - Comparison of decimal subclasses of Number with == fails
  • [GROOVY-7624] - Collection asImmutable() methods aren't immutable *
  • [GROOVY-7636] - NumberMath.getMath suboptimal choice for custom Numbers
  • [GROOVY-7637] - DefaultTypeTransformation.compareTo not symmetrical
  • [GROOVY-7655] - Wrong method is chosen when using super with generics
  • [GROOVY-7673] - Remove synchronized methods of groovy.sql.Sql and document it as not thread-safe *
  • [GROOVY-7691] - Type checking error on generic property with covariant type in subclass
  • [GROOVY-7721] - Static type checking fails when compiling against a Java8 interface with inherited methods
  • [GROOVY-7750] - @Lazy allows instantiation of abstract class
  • [GROOVY-7753] - regression of return type from ternary operator
  • [GROOVY-7803] - Java annotation with @Target(TYPE) on an annotation
  • [GROOVY-7827] - Allow groovyc ant task to select all available target bytecode versions
  • [GROOVY-7828] - Created a class loader that override loadClass can calls protected methods results in VerifyError
  • [GROOVY-7837] - TupleConstructor should provide pre and post annotation attributes like MapConstructor
  • [GROOVY-7840] - Verifier#makeDescriptorWithoutReturnType uses ClassNode#toString with generics
  • [GROOVY-7852] - Inconsistent checking of final for multi-assignments
  • [GROOVY-7853] - o.c.g.r.t.DefaultTypeTransformation does not apply the right toString on primitve arrays when transforming to String *
  • [GROOVY-7862] - Statically compiled calls to protected methods of an outerclass' superclass result in IllegalAccessErrors
  • [GROOVY-7865] - Better error message in the presence of Generics arity errors
  • [GROOVY-7883] - Static compiler prefers private constructor over public if private matches better
  • [GROOVY-7892] - CLONE - ClassCastException when calling DefaultTypeTransformation#compareEqual
  • [GROOVY-7902] - collate() infinite loop with zeroed step
  • [GROOVY-7920] - Simple getAt example produces a BUG exception
  • [GROOVY-7931] - javadoc generation fails for non-indy build
  • [GROOVY-7937] - CLONE - same linkedlist code different behavior between groovy and java (fix priority of DGM methods vs actual methods on an object) *
  • [GROOVY-7960] - IntRange iterator returns null instead of NoSuchElementException *
  • [GROOVY-7961] - ObjectRange iterator returns null instead of NoSuchElementException *
  • [GROOVY-7967] - AstNodeToScriptAdapter should output source using the recommended modifier order *
  • [GROOVY-7970] - Can't call private method from outer class when using anonymous inner classes and @CS
  • [GROOVY-7985] - Wrong "incompatible generic type" error
  • [GROOVY-8013] - The checking of property names during AST transform attribute processing doesn't take into account includeSuperProperties
  • [GROOVY-8016] - @TupleConstructor could use the order of properties listed in 'includes' when that option is used *
  • [GROOVY-8033] - STC: spread property references fails in static method
  • [GROOVY-8043] - NPE compiling Memoized method
  • [GROOVY-8046] - ClassFormatError void field
  • [GROOVY-8055] - @CompileStatic improperly orders parameter types
  • [GROOVY-8059] - STC overloaded generic method selection not using resolved types
  • [GROOVY-8072] - AstBrowser source view does not generate labels for statements
  • [GROOVY-8086] - Bump gradle version to 3.3 on master
  • [GROOVY-8087] - bump log4j2 version
  • [GROOVY-8093] - Final variable analysis broken within closure fields
  • [GROOVY-8094] - Final variable analysis giving incorrect message within nested if
  • [GROOVY-8120] - Bump commons cli version to 1.4
  • [GROOVY-8144] - Invoking a public method declared in a non-public class result in a IllegalAccessError
  • [GROOVY-8163] - Groovy scripts can disable java security manager and escape sandbox
  • [GROOVY-8176] - tap - exception in phase 'instruction selection'
  • [GROOVY-8186] - Builder ExternalStrategy constructors have trouble with private fields
  • [GROOVY-8200] - Shorthand |= results in NPE
  • [GROOVY-8205] - Static type checking failure for enums
  • [GROOVY-8211] - ArrayIndexOutOfBoundsException at compilation when accessing a generic type with the wrong number of type parameters
  • [GROOVY-8227] - Allow to specify Groovysh (and GroovyShell) class loader different from TCCL
  • [GROOVY-8230] - Deadlock in GroovyClassLoader
  • [GROOVY-8241] - SAM parameter type inference for explicit parameter
  • [GROOVY-8251] - Implement withCloseable on AutoCloseable
  • [GROOVY-8252] - AIOOBE in combination of ncurry and rcurry
  • [GROOVY-8288] - [Sql] withBatch fails when batchSize == number of addBatch call
  • [GROOVY-8303] - VerifyError for nested class this call to static method
  • [GROOVY-8316] - Project sourceSet for antlr seems wrong
  • [GROOVY-8317] - Smart type inference doesn't work on explicit closure params
  • [GROOVY-8319] - Improve smart type on list expresions
  • [GROOVY-8330] - Wrong 'Inconvertible types' error on casting interface
  • [GROOVY-8338] - Calling Stream.of from groovy class in JDK 9 fails
  • [GROOVY-8343] - Issue implementing Java interface
  • [GROOVY-8347] - Extend AutoFinal to closures and inner class within a class
  • [GROOVY-8356] - Use javax.validation 2.0 API results in GroovyBugError
  • [GROOVY-8360] - Enums that are nested classes do not have the static modifier set
  • [GROOVY-8361] - Nested class is resolved via aliased static import
  • [GROOVY-8367] - @Memoized not working for inner classes
  • [GROOVY-8386] - Final variable analysis broken with try/catch/finally
  • [GROOVY-8387] - Invalid module-info.class in jar artifacts
  • [GROOVY-8408] - invokeMethod cannot be set through category
  • [GROOVY-8416] - Map-based constructor generated by @Immutable works only with HashMap
  • [GROOVY-8429] - Jar files under indy directory of distribution miss the file extension(i.e. jar)
  • [GROOVY-8430] - @Field doesn't support final fields
  • [GROOVY-8432] - Weird behavior parsing dates
  • [GROOVY-8435] - @Immutable should use the cache setting of @ToString
  • [GROOVY-8436] - IOException "Stream closed" occurred when rebuilding Apache Groovy in IntelliJ IDEA
  • [GROOVY-8439] - @CompileStatic cannot compile generic class's static method
  • [GROOVY-8445] - Static analysis does not work properly when coercing Closure to FunctionInterface
  • [GROOVY-8453] - @TupleConstructor ignoring inherited standard Java Beans properties
  • [GROOVY-8455] - @TupleConstructor gives wrong ordering when includeSuperFields is set
  • [GROOVY-8456] - @MapConstructor could provide a noArg flag
  • [GROOVY-8471] - Contents of META-INF/services/org.codehaus.groovy.source.Extensions conflict with Maven/Jisaw
  • [GROOVY-8474] - 'Unexpected super property set for:' when accessing super class property via super.propertyName
  • [GROOVY-8482] - Build refactor impacts on release process
  • [GROOVY-8483] - groovy-all v2.5.0-beta-3 is missing from bintray
  • [GROOVY-8484] - Duplicate zip file entries in Groovy 2.5.0-beta-3 source jars on Maven Central
  • [GROOVY-8486] - Closure executed multiple times even if memoized
  • [GROOVY-8509] - SC: error for call to protected method from same package
  • [GROOVY-8515] - groovy.g no longer included in sources jars
  • [GROOVY-8523] - Static type checking instanceof
  • [GROOVY-8531] - Fail to resolve type defined in super class written in Java
  • [GROOVY-8537] - GroovyCollections.combinations(Iterable) exhibits incorrect (asymmetric) behavior
  • [GROOVY-8538] - <T> static type checking, generics, and collect
  • [GROOVY-8541] - Incorrect packaging in groovy-all pom
  • [GROOVY-8545] - DGM#intersect(Set, Iterable) throws ClassCastException if Iterable larger than Set
  • [GROOVY-8562] - Wrong Closure delegation for property access when using @CompileStatic and DELEGATE_FIRST / DELEGATE_ONLY
  • [GROOVY-8568] - SAM coercion doesn't work with abstract classes in @CompileStatic
  • [GROOVY-8579] - No bytecode level check is done before producing JDK8+ bytecodes
  • [GROOVY-8589] - GrapeMain bugfix: should not show error about missing mandatory args when --help or --version is specified
  • [GROOVY-8590] - STC incorrectly infers type of nested method call used in a return stmt
  • [GROOVY-8600] - BUG! exception in phase 'instruction selection'
  • [GROOVY-8839] - Static compilation and array type parameter causing compile error
  • [GROOVY-8916] - JsonOutput unable to serialize Locale object

Dependency upgrade

Epic

  • [GROOVY-8556] - Migrate classes depending on commons-cli to picocli

Improvement

  • [GROOVY-3270] - GroovyConsole: Configurable output area size
  • [GROOVY-3867] - Allow methodMissing/propertyMissing to be defined through category
  • [GROOVY-3976] - Alternative to "with" called "tap" that has an implicate "return delegate"
  • [GROOVY-4024] - Don't use classloader for analyzing compiled classes in groovyc
  • [GROOVY-4585] - backslash can not be escaped by `SimpleTemplateEngine`
  • [GROOVY-5380] - Add Ctrl+B for word/line/block selection
  • [GROOVY-5426] - ObjectRange.iterator() is reliant on size()
  • [GROOVY-5727] - Ovverriding 3rd Party libraries shipped
  • [GROOVY-6027] - groovy -h could be more clear
  • [GROOVY-6319] - Canonical annotation should become a meta annotation
  • [GROOVY-6514] - groovysh should offer easier access to grapes
  • [GROOVY-6537] - Support getParsedOptionValue() in OptionAccessor.getProperty()
  • [GROOVY-6538] - Support default value for OptionAccessor.getProperty()
  • [GROOVY-6555] - Allow @Immutable classes to validate their properties upon construction
  • [GROOVY-6854] - JsonOutput should be configurable with ISO 8601 UTC time zone instead of GMT
  • [GROOVY-6928] - Support all the Java 6 classes at createSimilarCollection() and createSimilarMap()
  • [GROOVY-6975] - Provide an option to deactivate escaping in JSON serialization
  • [GROOVY-7078] - make @Immutable play nice with constructor injection
  • [GROOVY-7162] - Handle @Immutable in class hierarchy?
  • [GROOVY-7227] - AST transformations relating to properties/fields should validate their includes/excludes lists
  • [GROOVY-7239] - Allow optimized array access in static compiled code with indy
  • [GROOVY-7360] - @EqualsAndHashCode generated hashcode values can be made more collision proof
  • [GROOVY-7383] - Make CompilerConfiguration.ALLOWED_JDKS public
  • [GROOVY-7422] - @AnnotationCollector could provide more control over how annotations are added in the presence of existing explicit annotations
  • [GROOVY-7426] - Add "Clear Output" Toolbar button to Groovy Console
  • [GROOVY-7427] - TupleConstructor should allow a mechanism to switch off automatic parameter defaults
  • [GROOVY-7486] - groovy.util.Node.depthFirst should provide a way to specify pre-order, post-order ordering
  • [GROOVY-7552] - add org.codehaus.groovy.runtime.DefaultGroovyMethods.isEmpty(Iterable)
  • [GROOVY-7563] - InvokerHelper formatting methods have inconsistent API *
  • [GROOVY-7565] - Groovysh tab completion should provide trailing spaces only when expecting more arguments
  • [GROOVY-7569] - PowerAsserts should print results more verbosely and safer *
  • [GROOVY-7574] - Range members should be final
  • [GROOVY-7599] - @Immutable should recognize JSR-310 classes
  • [GROOVY-7600] - @Immutable support for Optional?
  • [GROOVY-7611] - java.util.Optional should evaluate to false if empty *
  • [GROOVY-7616] - collectEntries throws cryptic error when used with split(delimiter, limit)
  • [GROOVY-7629] - ObjectRange methods duplicate functionality and should not rely on size()
  • [GROOVY-7640] - @Builder should have an option to include superclass properties
  • [GROOVY-7643] - Update GrapeIvy.groovy: set ivyInstance to IvyContext, for speed up
  • [GROOVY-7672] - TupleConstructor should have only SOURCE retention policy
  • [GROOVY-7769] - Allow @Delegate Annotation on a getter
  • [GROOVY-7825] - Enhance Groovy's CliBuilder to support annotation style definitions
  • [GROOVY-7877] - The Range abstraction could support numeric ranges where the items in the range differ by some step size different to 1
  • [GROOVY-7893] - LexerFrame could be made more general purpose and made accessible from GroovyConsole
  • [GROOVY-7905] - ListWithDefault DGM methods aren't type inference friendly
  • [GROOVY-7911] - Chained multiple assignment parsing fail
  • [GROOVY-7941] - MissingMethodException should limit argument types in getMessage()
  • [GROOVY-7981] - Not public constructors for groovy.transform.Immutable anotated class
  • [GROOVY-8011] - @ToString if used with includes='prop1,prop2' could allow the pseudo prop name 'super' as an alternative to using the includeSuper flag
  • [GROOVY-8014] - @ToString could output properties in a predefined order when 'includes' is used *
  • [GROOVY-8088] - For @MapConstructor and @TupleConstructor we should provide a default undefined value for better Java compatibility
  • [GROOVY-8114] - Include correct time unit in timeout error message
  • [GROOVY-8197] - Make JUnit3/4 GroovyRunners
  • [GROOVY-8218] - Allow to specify reverse order for @Sortable
  • [GROOVY-8259] - add suppressed exceptions for with[Auto]Closeable methods
  • [GROOVY-8351] - groovy-starter.conf could be extended to support configscript
  • [GROOVY-8353] - groovyConsole should support -Dname=value setting of system properties
  • [GROOVY-8406] - DefaultGroovyMethods missing Array support
  • [GROOVY-8410] - Provide a common cache
  • [GROOVY-8428] - Add DGM startsWithAny(String...) and endsWithAny(String...)
  • [GROOVY-8440] - @Immutable annotation should be re-vamped to be a meta-annotation
  • [GROOVY-8464] - Allow rendering inline json
  • [GROOVY-8465] - @ToString should support the includeSuperFields annotation attribute
  • [GROOVY-8472] - Final variable analysis doesn't account for early exit for try/catch/finally
  • [GROOVY-8477] - @Immutable-related transformations should be more configurable
  • [GROOVY-8480] - org.codehaus.groovy.runtime.ExtensionModule should move to META-INF/groovy
  • [GROOVY-8490] - Extend @Newify to support a class name pattern parameter
  • [GROOVY-8510] - Safe number parsing methods for more convenient XML parsing
  • [GROOVY-8520] - Replace commons-cli with picocli in CliBuilder
  • [GROOVY-8521] - Create new groovy-cli-commons module
  • [GROOVY-8548] - DGM#intersect should provide a variant with a comparator
  • [GROOVY-8567] - Migrate Groovyc to picocli
  • [GROOVY-8569] - Migrate groovy.ui.GroovyMain to picocli
  • [GROOVY-8576] - Remove Java2GroovyMain dependency on commons-cli
  • [GROOVY-8577] - Migrate org.codehaus.groovy.tools.GrapeMain.groovy to picocli
  • [GROOVY-8592] - Migrate command line tools to picocli version of CliBuilder
  • [GROOVY-8593] - DocGenerator could be moved to avoid split packages - part (1)
  • [GROOVY-8596] - SqlGroovyMethods could be moved to avoid split packages - part (1)
  • [GROOVY-8601] - Groovy should have a runner for JUnit5 tests
  • [GROOVY-8604] - Cache the parameterized type for better performance
  • [GROOVY-8605] - Autocompletion for Groovy command line tools
  • [GROOVY-8607] - CliBuilder should ignore 'opt' property if provided within a Map of arguments

New Feature

  • [GROOVY-4847] - Missing GDK rounding methods for BigDecimal
  • [GROOVY-5788] - Add inline() method to Object
  • [GROOVY-6744] - Have the elvis operator (?:) support the Optional type in Java 8 *
  • [GROOVY-7089] - Base64 URL Safe encoder
  • [GROOVY-7313] - "relativePath" extension method
  • [GROOVY-7353] - Groovy should provide a MapConstructor AST transform
  • [GROOVY-7423] - Access to Method parameter names at runtime
  • [GROOVY-7479] - Groovy should provide "inits" and "tails" DGM methods for lists
  • [GROOVY-7488] - depthFirst and breathFirst variants for XML processing taking a closure
  • [GROOVY-7540] - Add a method to StringGroovyMethods for replacing String pairs supplied as a Map
  • [GROOVY-7572] - Add withAutoClosable method
  • [GROOVY-7657] - add groovy macro module
  • [GROOVY-7745] - Add Map#removeAll(Closure) and Map#retainAll(Closure)
  • [GROOVY-7746] - Add BufferedIterator and Groovy JDK methods for it
  • [GROOVY-7755] - Add Extension Methods for JAXB Marshalling and Unmarshalling Support
  • [GROOVY-7860] - Groovy could implement an @AutoImplement transform
  • [GROOVY-7956] - Provide an AST transformation which improves named parameter support
  • [GROOVY-8091] - Add a ASMifier tab to AstBrowser
  • [GROOVY-8095] - Provide logging for bytecode generation
  • [GROOVY-8138] - Compile static to support streams
  • [GROOVY-8234] - Add @Repeatable java8 annotation support
  • [GROOVY-8300] - Groovy should have an @AutoFinal annotation
  • [GROOVY-8334] - Java 8 Date/Time type support in Groovy JDK (JSR 310)
  • [GROOVY-8352] - Add a @Generated annotation to mark generated members
  • [GROOVY-8500] - Support logging the stacktrace of bytecode generation
  • [GROOVY-8516] - Add DGM `md5`
  • [GROOVY-8518] - Add DGM `digest`
  • [GROOVY-8558] - Add DGM `getLocation` to get the url of the jar containing the specified class
  • [GROOVY-8559] - CLONE - Add @Repeatable java8 annotation support

Sub-task

  • [GROOVY-1628] - Inconsistent checking of final
  • [GROOVY-4490] - Method Chaining + invokeMethod
  • [GROOVY-4636] - GroovyConsole AST Browser does not show object initializer statements
  • [GROOVY-5501] - When inspecting the AST, it would be nice to have the node metadata properties listed too
  • [GROOVY-8226] - JSR308 initial plumbing tweaks

Task

  • [GROOVY-6780] - Provide an improved FileNameCompleter inheriting functionality from the latest class where possible
  • [GROOVY-7429] - CLONE - upgrade Apache Commons CLI to version 1.3 - migrate OptionBuilder to Option.builder()
  • [GROOVY-8379] - Rework groovy-json FastStringUtils
  • [GROOVY-8501] - Switch internal details of @ImmutableBase existing constructor validation
  • [GROOVY-8519] - Groovy should provide collect DGM variants for Optional and Future
  • [GROOVY-8525] - Binary compatibility issue for GroovyClassLoader between 2.4 vs later branches
  • [GROOVY-8557] - Verify that CliBuilder-based applications work correctly with picocli version of CliBuilder
  • [GROOVY-8588] - Tweak new groovyc implementation for consistent use of -v and -V switches

Wish

  • [GROOVY-6090] - Reimplement CliBuilder over another CLI API

* potentially breaking change (read issue for details - even minor differences are sometimes flagged as potentially breaking changes)