Changelog for Groovy 4.0.0-beta-1

Bug

  • [GROOVY-3015] - Seems like ClosureMetaClass#invokeMethod does not respect the interceptable nature of the owner/delegate
  • [GROOVY-3421] - Expression underlying a spread map expression is evaluated twice
  • [GROOVY-3708] - Intercepting an indirectly called method doesn't work.
  • [GROOVY-4320] - Joint compiler + @Delegate fail to recognize method signature with default value
  • [GROOVY-4610] - GroovyInterceptable (AOP) not working with closures
  • [GROOVY-5204] - @Delegate to a method with optional params
  • [GROOVY-5239] - Statically imported method vs other methods with the same name
  • [GROOVY-5245] - Inconsistency with accessing issers as properties
  • [GROOVY-5364] - Static property reference from static context in script does not compile
  • [GROOVY-5367] - Closure property in Binding used as Closure delegate cannot be called
  • [GROOVY-5453] - Incorrect resolve of category property for String
  • [GROOVY-6282] - groovyc ant task generates invalid stub (picks wrong constructor) and fails in Java 1.7 compilation
  • [GROOVY-7142] - type inference problem with List of Interface and List of the class which implements the interface
  • [GROOVY-7208] - Script.getProperty vs Script.setProperty asymmetry
  • [GROOVY-7867] - asType(Collection col, Class clazz) ingnores exceptions in clazz constructor
  • [GROOVY-8111] - Stack overflow between WideningCategories lowestUpperBound and parameterizeLowestUpperBound
  • [GROOVY-8179] - Map-style constructor call, inner class and static compilation
  • [GROOVY-8202] - void tail calls in closures break @CompileStatic type inference
  • [GROOVY-8409] - Static compilation with generic function wrapping BiFunction causes GroovyCastException
  • [GROOVY-8427] - Issue With Static Compiler And Generics
  • [GROOVY-8452] - @CompileStatic, generic with 'extends' bug: Expected parameter of type ? but got A
  • [GROOVY-8633] - MME on Class receiver via method closure
  • [GROOVY-8638] - CompileStatic fails with Guava Multimap#asMap
  • [GROOVY-8652] - Putting key on generic Map fails when using CompileStatic
  • [GROOVY-8678] - Groovy Script execution fails when comparing decimal values against decimal constant without leading 0
  • [GROOVY-8946] - @CompileStatic ignores declared type and forces a cast when inside a closure
  • [GROOVY-8974] - STC ignores declaration type
  • [GROOVY-9033] - Bad code green: empty list literal with each method
  • [GROOVY-9382] - Inconsistent support for [Bb]oolean properties *
  • [GROOVY-9632] - Java 8 Type Param Annotation Not Generated in Byte Code
  • [GROOVY-9983] - Type argument inference does not work in ternary operator
  • [GROOVY-9994] - Type checking of array initializer expressions
  • [GROOVY-10033] - Compiler crash when encountering function reference on nested class
  • [GROOVY-10046] - NPE in static compiler
  • [GROOVY-10047] - STC infers Closure instead of SAM for method references
  • [GROOVY-10051] - STC: return type for unresolved placeholder with bound resolved to Object
  • [GROOVY-10053] - STC: Wrong type inferred for lambda parameter in a generic method
  • [GROOVY-10056] - Inferred parameter type of lambda expression for multi-dimensions array is not correct
  • [GROOVY-10057] - MissingMethodException for pointer/reference from Class instance to Class method
  • [GROOVY-10062] - STC: no type parameter inference for variadic method called with fewer arguments than parameters
  • [GROOVY-10063] - STC: multiple-assignment from tuple-bearing static method
  • [GROOVY-10067] - STC: Wrong return value type inferred for generic method with upper bound without parameters
  • [GROOVY-10071] - SC: closure with variadic parameter
  • [GROOVY-10072] - SC: closure with default argument(s)
  • [GROOVY-10075] - Static compiler incorrectly typechecks extension modules
  • [GROOVY-10079] - groovyc does not perform unboxing on Character type
  • [GROOVY-10080] - Closure with type argument inference does not work as expected
  • [GROOVY-10082] - Incompatible generic argument types when combining subtyping and closures
  • [GROOVY-10085] - Class.isCase() documentation does not clarify that Class.isCase(SomeClass) is false, or why
  • [GROOVY-10086] - STC misses type error when calling a vararg method
  • [GROOVY-10087] - STC does not perform boxing on chars when encountering assignment and function call
  • [GROOVY-10088] - STC: type argument not applied to error message
  • [GROOVY-10089] - SC: GroovyCastException for map value as constructor for Collection
  • [GROOVY-10091] - Incompatible generic argument types on closure's return type
  • [GROOVY-10097] - CLONE - Better propagation of InterruptedException (additional cases)
  • [GROOVY-10098] - Unexpected behaviour when the return type of a closure is a type parameter
  • [GROOVY-10102] - Type checking fails when calling trait method using indirect SelfType relation
  • [GROOVY-10104] - SC: runtime error for default argument call expression
  • [GROOVY-10106] - STC error for call to static trait method from closure
  • [GROOVY-10107] - Cannot assign null to a variable with a bounded generic type
  • [GROOVY-10111] - compiler crash during canonicalization
  • [GROOVY-10113] - StackOverflowError in STC
  • [GROOVY-10121] - @AnnotationCollector does not work with JUnit 5
  • [GROOVY-10122] - Wrong cast in stubs generated
  • [GROOVY-10125] - FP Cycle detected in type parameter that extends another type parameter
  • [GROOVY-10132] - XmlUtil.serialize() Emoji bug
  • [GROOVY-10133] - Inconsistent method selection for [Bb]oolean properties *
  • [GROOVY-10134] - Groovy console can not highlight token properly sometimes
  • [GROOVY-10141] - NPE in InnerClassVisitor for non-static inner class CCE within two AICs
  • [GROOVY-10145] - Support JDK16
  • [GROOVY-10159] - Compilation failure: ClassCastException
  • [GROOVY-10164] - RootLoader cannot be set as system class loader in Java 12+
  • [GROOVY-10179] - STC: instanceof and for-in variable type
  • [GROOVY-10180] - STC: instanceof and DGM each(Map,Closure)
  • [GROOVY-10181] - Groovy 3 AST for annotated fields reports wrong lastLineNumber if field not initialized
  • [GROOVY-10188] - Different treatment of property expressions in closures from 2.4 to 2.5
  • [GROOVY-10189] - File.withWriter and Path.withWriter are inconsistent
  • [GROOVY-10191] - NoSuchMethodError during static field inlining is not caught, unlike NoSuchFieldException
  • [GROOVY-10199] - ASTTest cannot reference types from transform classpath
  • [GROOVY-10200] - Static scope error for variable in non-static method of static inner class
  • [GROOVY-10320] - Generics failed to compile with Groovy 3.0.9 when overriding plus operator
  • [GROOVY-10391] - Default interface methods causing problems with java 17 and groovy 3.0.9
  • [GROOVY-10413] - IllegalAccessException when using closures for functional interfaces with default methods
  • [GROOVY-10462] - Groovy should not generate both `getFlag` and `isFlag` for a Boolean field.

Dependency upgrade

Improvement

  • [GROOVY-5441] - Type argument checking
  • [GROOVY-9628] - Initial support for reproducible builds
  • [GROOVY-9800] - Log generic mismatches extensively
  • [GROOVY-10028] - Add support for type conversion from Stream to array/collection/list/set
  • [GROOVY-10029] - SC: produce direct method call for assignment of collection to array
  • [GROOVY-10034] - Compiler writes extra cast for Type[] to Object[]
  • [GROOVY-10035] - Eliminate redundant type cast
  • [GROOVY-10036] - STC: unresolved generics for return type of extension method call with full type arguments
  • [GROOVY-10050] - Add additional NamedParam annotations in ResourceGroovyMethods, NioExtensions and JsonSlurper
  • [GROOVY-10052] - STC sometimes requires explicit closure to SAM cast inside of another closure
  • [GROOVY-10061] - "del" ASCII character also should be escaped
  • [GROOVY-10077] - Groovy Console: Support JDKs without macOS Runtime Support for Java
  • [GROOVY-10110] - AST browser should show additional information *
  • [GROOVY-10112] - IndexedProperty AST transform should only provide the getter for immutable fields
  • [GROOVY-10123] - Consolidate methods for collecting interfaces *
  • [GROOVY-10126] - Support parsing multiple YAML documents
  • [GROOVY-10146] - Groovy 3 compilation errors are less accurate than Groovy 2
  • [GROOVY-10148] - Groovy should support sealed classes
  • [GROOVY-10150] - Eliminate ambiguities while parsing non-static class creator
  • [GROOVY-10155] - Add JDK18 constant
  • [GROOVY-10160] - Highlight source code in the AST browser smartly
  • [GROOVY-10212] - Provide a mechanism for users to enable Antlr4's SLL (fast but only simple) mode

New Feature

  • [GROOVY-4990] - Ability to create missing parent directories when using File.write()
  • [GROOVY-9159] - [GEP] Support LINQ, aka GINQ
  • [GROOVY-9272] - Support switch expression
  • [GROOVY-9804] - Support TOML
  • [GROOVY-10032] - CLONE - left-open and full-open ranges (consider adjusting containsWithinBounds behavior) *
  • [GROOVY-10193] - Support sealed type grammar
  • [GROOVY-10195] - Groovy should have a @Final AST transform
  • [GROOVY-10210] - Provide a helper factory class to assist with porting

Sub-task

  • [GROOVY-2686] - Can't call a Closure in a Closure's Delegete
  • [GROOVY-10137] - [JDK16] Illegal access to dynamic proxy
  • [GROOVY-10138] - [JDK16] Failed to invoke default method of proxy

Task

  • [GROOVY-9958] - Prepare for bintray/jcenter sunset
  • [GROOVY-10065] - Move stream-related extension methods to StreamGroovyMethods
  • [GROOVY-10411] - Refactor org.codehaus.groovy.vmplugin.v8.Java8 *

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