Changelog for Groovy 5.0.0-alpha-1

Bug

  • [GROOVY-3142] - Unable to access inherited private fields from a closure within an inherited method
  • [GROOVY-4020] - ClassFormatError when using the name including "-" sign
  • [GROOVY-5001] - Map access is given higher precedence when trying to access fields/properties in classes which implement java.util.Map or extend java.util.HashMap or java.util.Properties *
  • [GROOVY-5051] - 'this' uses in a superclass is treated as subclass, preventing acces to private members
  • [GROOVY-5491] - HashMap subclass property access inconsistent
  • [GROOVY-5744] - Multiple assignment from Iterator skips every other element
  • [GROOVY-5760] - CLONE - dash in script filename
  • [GROOVY-6144] - Confusing treatment of m['foo'], m.get('foo'), m.foo, m.getFoo() for Maps *
  • [GROOVY-6146] - Calling a Java vararg method from Groovy with a null argument cast to the vararg type behaves differently than in Java
  • [GROOVY-6277] - super class private members are preferred over public members of the current class with lower priority
  • [GROOVY-6335] - MissingPropertyException when private static property is used inside a nested closure and called from a child class
  • [GROOVY-6363] - The extension mechanism do not work when a method named "X" is a added to class having a private method named "X"
  • [GROOVY-6429] - flow typing detects unexpected error at if-else flow
  • [GROOVY-6591] - error message glitch for LUB
  • [GROOVY-6668] - Static compiler doesn't coerce GString for getAt() call
  • [GROOVY-6939] - Calling "each" on an untyped model variable with two arguments causes doCall error
  • [GROOVY-7670] - CLONE - dash in script filename
  • [GROOVY-8145] - Cross-project @Log + static import issue
  • [GROOVY-8168] - When using Interface: BigDecimal cannot be cast to Double
  • [GROOVY-8184] - Class constant withouts .class in annotation value resolves as VariableExpression
  • [GROOVY-8212] - coerce GString to String when used as Map key
  • [GROOVY-8219] - Add @TupleConstructor(includeFields = true) to a class implements a trait which contains properties will cause NPE *
  • [GROOVY-8499] - Glitch with native lambda support when supplied with incorrect arity lambda
  • [GROOVY-8555] - The private keyword of an instance variable is causing a behavior change in a map class
  • [GROOVY-8788] - Inconsistency in extension method selection with @CompileStatic *
  • [GROOVY-9523] - MissingMethodException when referencing a private enum method
  • [GROOVY-9596] - Cannot access protected field of Java superclass with --illegal-access=deny
  • [GROOVY-9987] - MissingMethodException when a base class calls a private static method inside a closure
  • [GROOVY-10527] - Extension method getProperties() returns raw map
  • [GROOVY-10568] - MissingMethodException using method-pointer operator in superclass
  • [GROOVY-10592] - Java static interface methods cannot be located using property notation in dynamic context
  • [GROOVY-10617] - Return statement insertion generates unnecessary dynamic cast
  • [GROOVY-10636] - STC: closure array or varargs parameter not properly type-checked
  • [GROOVY-10695] - StackOverflowError when calling a static method.
  • [GROOVY-10750] - Compiler does not resolve compile-time constants in string concatenation
  • [GROOVY-10763] - ClassNode setSuperClass and setInterfaces should update usingGenerics
  • [GROOVY-10770] - Multiple @CompileStatic annotations don't combine extensions
  • [GROOVY-10792] - Declared generic parameter on method not transferred to Closure
  • [GROOVY-10800] - The % operator returns unexpected results for negative numbers for BigIntegers *
  • [GROOVY-10818] - STC: Cannot choose between TimeDuration#plus(Duration) and Duration#plus(TimeDuration)
  • [GROOVY-10858] - STC method reference return type checking
  • [GROOVY-10862] - Annotation default set for every binary method *
  • [GROOVY-10904] - STC doesn't find property accessor on nested class
  • [GROOVY-10930] - STC accepts program although constructor reference is invalid
  • [GROOVY-10971] - STC is looking for the wrong constructor reference
  • [GROOVY-10985] - Precedence of self property over outer class field *
  • [GROOVY-11026] - NPE when checking compatibility of method reference
  • [GROOVY-11051] - Static compiler does not coerce Groovy truth from closures
  • [GROOVY-11060] - SC internal error when spreading inside list literal
  • [GROOVY-11071] - Compiler error related to getAt and interface methods
  • [GROOVY-11073] - Cannot infer type of parameterized method when dealing with arrays
  • [GROOVY-11128] - implicit-this access within closure to private members in declaring class when invoked from derived class
  • [GROOVY-11144] - MissingPropertyEx when accessing private static field in closure of same class
  • [GROOVY-11185] - each after transpose with 2 arguments does not compile
  • [GROOVY-11212] - Access to private fields of superclass from a block fails in subclass

Dependency upgrade

Improvement

  • [GROOVY-6022] - Static type checker should not register errors for ellipsis closure parameter annotated with @DelegatesTo
  • [GROOVY-6925] - Cannot enable static type checking on a method where static compilation has been disabled
  • [GROOVY-7319] - Add primitive array min() and max()
  • [GROOVY-7919] - Unexpected behaviour of in operator on an Iterable
  • [GROOVY-8411] - Support instanceof-like flow typing for class literal switch case
  • [GROOVY-8412] - Support !instanceof flow typing for else case
  • [GROOVY-8591] - Consider additional target bytecode checks and/or simplification in some areas
  • [GROOVY-10223] - Add support for Optional to DefaultTypeTransformation.asCollection()
  • [GROOVY-10278] - CompilerConfiguration: improve target bytecode selection
  • [GROOVY-10473] - Extend streams support to spread and subscript
  • [GROOVY-10597] - STC: support spread arguments for varargs
  • [GROOVY-10616] - Add peek extension method for Optional, OptionalInt, OptionalLong and OptionalDouble
  • [GROOVY-10655] - Add extension method for coercing AtomicBoolean to boolean value
  • [GROOVY-10666] - Implement multiple-assignment (aka destructuring) via getAt(IntRange) or iterator()
  • [GROOVY-10672] - Provide a stream 'from' DGM method taking an IntRange
  • [GROOVY-10682] - Provide eachWithIndex for primitive arrays
  • [GROOVY-10845] - Add type checking for enum constant constructor call
  • [GROOVY-10855] - Meta-annotation retention policy and target *
  • [GROOVY-10879] - Potential additional DGM collectEntries variants
  • [GROOVY-10898] - Provide tail/init/head/first/last for primitive arrays
  • [GROOVY-10905] - Improve matching implicit arg closures to SAM types
  • [GROOVY-10909] - bytecode for in, !in, !() and ?:
  • [GROOVY-10916] - Provide min/max closure/comparator variants for primitive arrays
  • [GROOVY-10921] - Optimised variants for AGM#each
  • [GROOVY-10943] - Treat multiple underscores as placeholders in multi-assignment statements and closure/lambda parameters
  • [GROOVY-10949] - Add asBoolean for File and Path meaning the file or path exists
  • [GROOVY-10953] - Extend multi-assignment type checking to Range expressions
  • [GROOVY-10964] - List.minus() slow for Numbers *
  • [GROOVY-11039] - DGM every for primitive arrays
  • [GROOVY-11070] - ObjectArrayStaticTypesHelper does not handle negative indices
  • [GROOVY-11092] - STC: support coerced closure argument destructuring (for list and tuple)
  • [GROOVY-11145] - add a join() method for Iterable/List
  • [GROOVY-11146] - Support flattening of Optionals in flatten/flattenMany

New Feature

  • [GROOVY-4232] - Better support for CheckedCollections
  • [GROOVY-10942] - Add `extension` & `baseName` extension methods
  • [GROOVY-10980] - Provide an AST transform to rename operator methods
  • [GROOVY-11103] - Provide an ascii barchart method
  • [GROOVY-11127] - Add '|', '&', and '^' operators to Set and SortedSet

Question

  • [GROOVY-10438] - DGM: getMetaPropertyValues and getProperties includes private entries

Sub-task

  • [GROOVY-2433] - Closure in base class unable to call private methods when invoked from derived class
  • [GROOVY-3073] - Private inheritance bug: Closure accessing private method
  • [GROOVY-5438] - Private field inaccessible in closure when using a subclass
  • [GROOVY-11118] - Initial JEP 445 compatibility

Wish

  • [GROOVY-10931] - Remove $getLookup method generation (Groovy 4+) *

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