Changelog for Groovy 4.0.0-beta-2
Bug
- [GROOVY-5746] - Array assignment with operator does double call for index expression and array part
- [GROOVY-6328] - onMethodSelection() doesn't fire when setter is called with property syntax
- [GROOVY-6586] - Read vs Write to members of base script supplied by @BaseScript is inconsistent
- [GROOVY-6802] - CompileStatic: ListAssignment takes precedence over Coercion when statically compiling
- [GROOVY-6803] - CompileStatic: ListAssignment for String takes precendence over Coercion when statically compiling
- [GROOVY-6919] - Static compilation fails with multiple bounds generics
- [GROOVY-7490] - CompileStatic confuses statically importing an instance and statically importing a method
- [GROOVY-7510] - Static import of a static property causes joint compilation to fail
- [GROOVY-7690] - TypeChecked Groovy does not throw illegal assignment error at compile time when using raw generic type
- [GROOVY-9006] - Static type checking fails on java.sql.Timestamp when compared to null
- [GROOVY-10049] - STC fails when calling a generic method from another generic method
- [GROOVY-10055] - STC does not support self bounded types
- [GROOVY-10094] - STC misses type checks on default arguments
- [GROOVY-10103] - Lambda with command method call fails with cast exception
- [GROOVY-10128] - Cannot assign closure with long as return type to java.util.function.Function<X, Number>
- [GROOVY-10166] - Cannot call T#method(arg) with arguments <arg>
- [GROOVY-10178] - @CompileStatic and @NullCheck make compiler fail
- [GROOVY-10184] - NPE in SecureASTCustomizer with indirectImportCheckEnabled
- [GROOVY-10217] - Type inference does not work with GDK class enhancements
- [GROOVY-10218] - BUG! exception in phase 'instruction selection' when non-existent method called
- [GROOVY-10220] - Unexpected type mismatch when having conflicting type parameter names
- [GROOVY-10222] - Unable to infer the type parameter of a parameterized function
- [GROOVY-10225] - Unexpected NullPointerException during the "instruction selection" phase
- [GROOVY-10228] - STC fails to substitute type variable in the presence of the diamond operator and a function call
- [GROOVY-10229] - Question mark in the attribute for a class name
- [GROOVY-10230] - Unexpected generics parameter arity mismatch in the "instruction selection" phase
- [GROOVY-10234] - Groovyc throws Stackoverflow error on generic class with lower bound
- [GROOVY-10235] - STC: Generic type of Set not correctly resolved when calling ConcurrentHashMap.newKeySet()
- [GROOVY-10236] - Parser fails to parse a single-statement lambda when omitting parentheses for method call
- [GROOVY-10238] - @CompileStatic @Canonical inner class throws RTE: NoSuchMethodError: java.util.Map.withDefault
- [GROOVY-10239] - GroovyCastException when @CompileStatic and !in keyword are used together
- [GROOVY-10243] - IOOBE thrown when parsing switch-expression without branches
- [GROOVY-10248] - Groovy ResolveVisitor runs twice
- [GROOVY-10249] - Generated stubs missing method from traits with array parameter
- [GROOVY-10250] - Erroneous type inference of closure in STC
- [GROOVY-10254] - STC: cannot return closure from method without casting
- [GROOVY-10256] - STC: no error for incompatible type bounds on return value
- [GROOVY-10261] - @NamedVariant: Default parameters on ctor/method are ignored when passing some named parameters
- [GROOVY-10262] - MethodNode#getText can output incorrect modifiers
- [GROOVY-10269] - STC: Stackoverflow Error when passing function reference to closure
- [GROOVY-10280] - Type variable substitution does not work well when running into chain of field accesses
- [GROOVY-10282] - STC: false positive for BiFunction and BinaryOperator with same type parameter
- [GROOVY-10283] - Cannot assign type parameter whose bound is a parameterized type that takes a wildcard
- [GROOVY-10289] - Regression with static and non static class mixing
- [GROOVY-10291] - STC fails to substitute type variable when using the diamond operator and calling a closure
- [GROOVY-10294] - Variable's inferred type is upcasted to an Object
- [GROOVY-10299] - Groovy compiler generates invalid Java stubs
- [GROOVY-10303] - Compiler NPE within CompileStack#clear
- [GROOVY-10306] - STC rejects program when assigning a closure that returns a class field
- [GROOVY-10308] - SC incorrectly reports "access to Object#field" is forbidden
- [GROOVY-10309] - Improper type variable substitution when involving type parameters with conficting names
- [GROOVY-10310] - STC is unable to call parameterized function
- [GROOVY-10311] - MetaClassImpl creates static meta property for non-static field and getter (no setter)
- [GROOVY-10312] - MissingMethodException in method with default parameter in trait - regression in 3.0.9
- [GROOVY-10314] - finally block produces long sequence of nop instructions
- [GROOVY-10315] - Unable to infer type variable of parameterized function that expects two parameters
- [GROOVY-10317] - Type variable substitution does not work properly on parameterized function's return type
- [GROOVY-10318] - Weird behavior of !in operator
- [GROOVY-10319] - Groovy3 CompileStatic bug: Method clone is protected in java.lang.Object
- [GROOVY-10322] - Type variable of function does not shadow the corresponding type variable of class
- [GROOVY-10323] - Compiler crashes on parameterized function with duplicate type variables
- [GROOVY-10324] - STC is unable to infer type variable when combining parameterized types and the diamond operator
- [GROOVY-10325] - STC: error for map*.value assignment
- [GROOVY-10326] - STC: missing error for map*.key assignment
- [GROOVY-10328] - STC: incorrect type inference for list, map, etc. with lower bound generics
- [GROOVY-10329] - import static star: add support for static callable property
- [GROOVY-10330] - STC instantiates type variable with a wrong type when calling an instance method of the same class
- [GROOVY-10336] - STC crashes when passing method reference to an inner closure
- [GROOVY-10337] - STC rejects program on compiling constructor initialization with a wildcard type
- [GROOVY-10344] - STC crashes when bound has two wildcard types as type arguments
Dependency upgrade
- [GROOVY-10237] - Bump gradle to 7.2
- [GROOVY-10242] - Bump asciidoctor gradle to 3.3.2
- [GROOVY-10245] - Bump asciidoctorj to 2.5.2
- [GROOVY-10246] - Bump junit5 to 5.8.0
- [GROOVY-10255] - Bump JUnit5 to 5.8.1
- [GROOVY-10276] - Bump jackson to 2.13.0
- [GROOVY-10285] - Bump javaparser to 3.23.1
- [GROOVY-10292] - Bump checkstyle to 9.0.1
- [GROOVY-10296] - Bump Spotbugs/Spotbugs annotations to 4.4.2
- [GROOVY-10313] - Bump jansi to 2.4.0
- [GROOVY-10331] - Bump Commons CLI to 1.5.0
- [GROOVY-10332] - Bump logback to 1.2.6
- [GROOVY-10333] - Bump slf4j to 1.7.32
- [GROOVY-10334] - Bump Ant version to 1.10.12
Improvement
- [GROOVY-6954] - map.foo = "bar" not optimized by the static compiler
- [GROOVY-8729] - Eliminate the additional resolving phase of compilation for better performance
- [GROOVY-10233] - Sealed classes should generate native class information for JDK17+
- [GROOVY-10252] - @Final should have a boolean attribute to disable
- [GROOVY-10275] - Align intersect which takes a closure/comparator ordering to be the same as other languages. *
- [GROOVY-10279] - Support native record
- [GROOVY-10281] - Add compiler option for logging class generation
- [GROOVY-10284] - AnnotationCollector should not collect @Incubating which is a meta-annotation in Groovy
- [GROOVY-10286] - Set target bytecode by JDK
- [GROOVY-10287] - The Groovy Console About window could list Java/OS versions along with the Groovy version
- [GROOVY-10295] - STC: cannot infer list or map type for method return
- [GROOVY-10297] - Refine @ToString and @EqualsAndHashCode generation of fallback methods
- [GROOVY-10298] - Refine records to not use system properties
- [GROOVY-10321] - @ToString could provide annotation attributes to control further the format of the created toString
- [GROOVY-10338] - Enhance records with additional helper methods
- [GROOVY-10340] - Refine sealed classes to not use system properties
New Feature
- [GROOVY-5450] - Final field assignment check on static compilation
- [GROOVY-10240] - Support record grammar
- [GROOVY-10274] - Improvements to DGM: provide a set union and minus which take a closure/comparator
* potentially breaking change (read issue for details - even minor differences are sometimes flagged as potentially breaking changes)