Changelog for Groovy 4.0.0-alpha-3

Bug

  • [GROOVY-3422] - unable to reference one static closure from another without class name prefix
  • [GROOVY-4727] - Adding "return" automatically in nested switch statements
  • [GROOVY-5728] - Accessing private constructor from a static factory
  • [GROOVY-6408] - Problem With @CompileStatic And Typed Collections
  • [GROOVY-6610] - "Expecting to find object/array on stack" VerifyError when passing static member as argument to chained ctor call
  • [GROOVY-6747] - Problem With Anonymous Inner Enum
  • [GROOVY-6912] - @CompileStatic not recognising Literal list when LHS is a concrete list type
  • [GROOVY-7024] - Reference to static member of parent class in enum constructor fails at runtime
  • [GROOVY-7128] - Generic method declaration should see the super class
  • [GROOVY-7293] - @Memoized ignored in trait methods
  • [GROOVY-7306] - Invalid stub generated for a constructor using a generic bounded parameter
  • [GROOVY-7419] - Static Compilation with Diamond of local EnumMap<>
  • [GROOVY-7468] - type checker should use superclass bound when expected by generics
  • [GROOVY-7507] - Cannot assign value of type java.lang.Object in ternary operator with null
  • [GROOVY-7582] - Closure to SAM coercion doesn't handle overloads with different SAM signatures
  • [GROOVY-7686] - Can not see local variable from overriden method called from the constructor of an anonymous class instance
  • [GROOVY-7945] - Expect compilation error while resolving generic types
  • [GROOVY-7968] - A field and a property with the same name and both having an initial value leads to an ambiguity over what the initial value should be, so should fail compilation *
  • [GROOVY-8001] - Static compiling fails type checking with generics
  • [GROOVY-8034] - Compile error when using generic type with lower bound
  • [GROOVY-8104] - Could not call constructor of inner class from anonimous class inside closure
  • [GROOVY-8850] - StreamingMarkupBuilder adds namespace on elements not expected
  • [GROOVY-8909] - List literal type inference does not take its context into account
  • [GROOVY-8960] - Can not call a java parameterized type method from groovy with java enum. Compile error
  • [GROOVY-8983] - Cannot assign Collection to Array
  • [GROOVY-8984] - Can assign Collection with super wildcard to Array
  • [GROOVY-9064] - STC: explicit declared variable type ignored in favor of assigned value type(s)
  • [GROOVY-9076] - Debugger Step Into doesn't work in Groovy-compiled classes
  • [GROOVY-9373] - ASM: rework line numbers for blocks with fast-path, try/catch or return statement insertion
  • [GROOVY-9397] - CLONE - Closures are maybe not Threadsafe
  • [GROOVY-9524] - VerifyError when referencing a private enum method
  • [GROOVY-9662] - Groovy 3.0.5: Closure delegate is not working properly
  • [GROOVY-9681] - Groovy2 indy not backward compatible missingMethod with Groovy3
  • [GROOVY-9707] - TypeChecked: NoSuchMethodError: DefaultGroovyMethods.plus(java.lang.String, java.lang.Object)
  • [GROOVY-9737] - VerifyError if superclass has static and non-static overloads
  • [GROOVY-9777] - Stub missing cast, depending on constructor order
  • [GROOVY-9797] - println(-0.0f) does not comply with IEEE754
  • [GROOVY-9807] - Static compile of dynamically generated code produces different output in a top-level class and a nested class
  • [GROOVY-9844] - STC infers too-narrow bounds for inline map
  • [GROOVY-9852] - Result is already complete (IllegalStateException) *
  • [GROOVY-9855] - Compiler does not resolve compile-time constants in string concatenation
  • [GROOVY-9859] - Groovy3 doesn't parse a function property when there's a new line between return value and function name
  • [GROOVY-9860] - compilation error when passing a closure's genericized parameters to a constructor under static compilation
  • [GROOVY-9861] - parsing bug when inner class references top level class fields in groovy 3
  • [GROOVY-9862] - General error during instruction selection: ClassCastException
  • [GROOVY-9863] - arithmetic using an implicit getter fails to compile with "BUG! exception in phase 'class generation'" under static compilation
  • [GROOVY-9867] - docgenerator not displaying array types correctly
  • [GROOVY-9875] - backspace does not work in the groovysh under SecureCRT connecting Linux
  • [GROOVY-9880] - Switch incorrectly falls through default case
  • [GROOVY-9881] - STC can't distinguish SAMs based on arity
  • [GROOVY-9882] - STC: field or property with parameterized SAM-type and closure initializer
  • [GROOVY-9885] - STC doesn't coerce GString in certain ternary expressions
  • [GROOVY-9890] - Static type checking can't find default method overload on interface
  • [GROOVY-9891] - Wrongly detected incompatible generic arguments for Java collections
  • [GROOVY-9892] - STC: VerifyError when embedding unary pre/postfix inc/decrement operation of outer field in GString
  • [GROOVY-9893] - Wrong overloaded method selected
  • [GROOVY-9896] - Switch return statement transformation misses last case without break
  • [GROOVY-9901] - Memoization doesn't seem to work for trait methods
  • [GROOVY-9902] - Generic typecheck in @DelegatesTo doesn't work
  • [GROOVY-9903] - STC: @DelegatesTo error for incomplete arguments linked to first line of source
  • [GROOVY-9905] - Groovy 3 bug: references to an outer class's parent class variable fails
  • [GROOVY-9906] - ArrayIndexOutOfBoundsException when compiling method call with many overloaded methods
  • [GROOVY-9907] - Type tracked from instanceof condition is not captured in closure
  • [GROOVY-9911] - Tuples with same collection values do not match
  • [GROOVY-9914] - map.collectEntries extension method variant returns Map<?,?>
  • [GROOVY-9915] - STC: call to static method fails with incompatible generics error
  • [GROOVY-9916] - IllegalArgumentException when set null to a boolean field into a closure
  • [GROOVY-9918] - NPE in static compiler when calling pathological method signature
  • [GROOVY-9923] - Several Sql#call variants incorrectly throw Exception rather than SqlException *
  • [GROOVY-9932] - MockFor/StubFor makes mocked internal method return null
  • [GROOVY-9934] - Bounded type parameter is not captured by closure
  • [GROOVY-9935] - int reference seems to not use its wrapper class
  • [GROOVY-9936] - Difference between Antlr2 and parrot parsers for variable declaration optimisation *
  • [GROOVY-9938] - VerifyError when instantiating class with @CompileStatic that implements a method with @DelegatesTo annotation.
  • [GROOVY-9945] - STC: Cannot find matching method when using Generics
  • [GROOVY-9948] - Cannot infer the correct type in the presence of diamond operator
  • [GROOVY-9951] - @CompileStatic @POJO annotation on static inner class with @Immutable annotation
  • [GROOVY-9953] - Type from flow typing is not propagated in variable assignments
  • [GROOVY-9954] - JsonSlurper LAX parser skips the first character after comments
  • [GROOVY-9955] - IllegalAccessError exception is raised when accessing inherited static field
  • [GROOVY-9956] - Cannot infer correct type argument when passing a subtype of the declared type argument
  • [GROOVY-9963] - Generic type of field is not instantiated
  • [GROOVY-9966] - Build Error: StringIndexOutOfBoundsException when the stars align...
  • [GROOVY-9967] - STC: Access to field/property is forbidden after instanceof.
  • [GROOVY-9968] - @TypeChecked Error: Members of Iterable<T extends Foo> are Foo, not Object
  • [GROOVY-9970] - Type argument inference does not work in closure
  • [GROOVY-9971] - @TypeChecked: Closure<String> no longer compatible with Closure<GString> argument
  • [GROOVY-9972] - LUB does not work correctly in case of ternary operator
  • [GROOVY-9973] - @CompileStatic: Binary operation with property throws ClassCastException
  • [GROOVY-9974] - @CompileStatic with Method References
  • [GROOVY-9977] - @CompileStatic does not work when a class field has a lambda initializer
  • [GROOVY-9978] - ASM reporting processing error
  • [GROOVY-9981] - CLONE - println(-0.0f) does not comply with IEEE754
  • [GROOVY-9982] - Can't assign a field with the result of a method call of the same name from a base class
  • [GROOVY-9984] - Wrong type inference when passing null
  • [GROOVY-9985] - STC does not report type mismatches in array initializers
  • [GROOVY-9991] - STC: error for closure not matching functional interface method's parameter count
  • [GROOVY-9993] - CLONE - Field and a property with the same name: clarification of boundary cases *
  • [GROOVY-9995] - Wrong inference inside closure when having a bounded type parameter
  • [GROOVY-9996] - Cannot infer correct type argument when using subtyping
  • [GROOVY-9997] - STC: cast or coerce to functional interface fails to infer param types of closure/lambda
  • [GROOVY-9998] - Wildcards with a lower bound fail static type checking
  • [GROOVY-10002] - STC: inconsistent support for assignment of list literals
  • [GROOVY-10006] - @CompileStatic fails to unify types
  • [GROOVY-10009] - TracingInterceptor throws NullPointerException if arguments contains a null argument
  • [GROOVY-10010] - STC: method call with GString elements in list/array has different error from assignment
  • [GROOVY-10011] - Combining flow typing and type argument inference does not work as expected
  • [GROOVY-10024] - Dollar slashy /$ string ending in backslash "breaks" the parser
  • [GROOVY-10027] - STC: NamedParams error for method call argument

Dependency upgrade

Documentation

  • [GROOVY-9925] - Groovy match operator documentation should contain real examples and slashy strings reminder
  • [GROOVY-9926] - Groovy documentation does not describe how to instantiate empty maps in section where maps are first described

Improvement

  • [GROOVY-6360] - GString performance is slow with String's method
  • [GROOVY-7106] - Improve coercion / implicit cast of map literals for @CompileStatic
  • [GROOVY-7274] - Improve type inference for hash map -> Map<?, ?>
  • [GROOVY-9849] - Show elapsed time in groovy console
  • [GROOVY-9858] - In generated closures, annotate generated call() methods with @Generated
  • [GROOVY-9865] - Add some DGM methods for primitive arrays
  • [GROOVY-9868] - DGM methods via dgminfo not enabled for int[][], long[][], double[][]
  • [GROOVY-9877] - Add DGM `asReversed` to `List`
  • [GROOVY-9878] - GroovyClassLoader#fileReallyExists is inefficient
  • [GROOVY-9921] - Replace legacy data structure with Java collection(SingleKeyHashMap) *
  • [GROOVY-9941] - Make Gradle build fully cacheable
  • [GROOVY-9946] - Add `@Pure` to mark constant result of method
  • [GROOVY-10003] - Eliminate some ambiguities while parsing
  • [GROOVY-10004] - @Lazy transform should check for explicit getters/setters *
  • [GROOVY-10031] - Compiler writes multianewarray instruction for all non-initializer array allocations

New Feature

Task

  • [GROOVY-9989] - Investigate impact of Bintray/JCenter shutdown (grape config aspects)
  • [GROOVY-10005] - Remove groovy-jaxb module from Groovy 4 *
  • [GROOVY-10023] - Remove BSF from Groovy 4 *

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