Changelog for Groovy 2.4.0

Bug

  • [GROOVY-3457] - GStringTemplateEngine fails to work with >64K strings
  • [GROOVY-3680] - Cannot use Groovy class with @Bindable or @Vetoable in Java code: cannot find symbol for addPropertyChangeListener
  • [GROOVY-3971] - adding method to class in ASTBuilder not working
  • [GROOVY-4102] - remove timestamp fields for better hotswap
  • [GROOVY-4248] - CLONE -JavaStubGenerator doesn't generate annotations available in Groovy code - More Tests required
  • [GROOVY-4359] - Generic types are incorrectly shared/resolved within the module
  • [GROOVY-4759] - compiler NPE with some finally blocks with explicit return
  • [GROOVY-4822] - Label before closure
  • [GROOVY-5200] - Anonymous class with elipsis type in constructor
  • [GROOVY-5524] - rcurry fails using with closures and default parameters
  • [GROOVY-5750] - MissingFieldException when accessing @Lazy property of outer class
  • [GROOVY-5765] - Enum with vararg argument to the constructor ignores everything except the first argument
  • [GROOVY-5841] - Runtime error with nested classes that have parameterized type
  • [GROOVY-5876] - Problem With Arguments Passed To Static Dynamic Methods
  • [GROOVY-5957] - groovydoc does not create links for non-fully qualified classes in same package
  • [GROOVY-6128] - Incorrect encoding in generated java stubs
  • [GROOVY-6166] - NPE when mixing anonymous inner class and generics
  • [GROOVY-6202] - MIssed generics in delegated method
  • [GROOVY-6302] - Stub generator chokes on multi-dimensional arrays
  • [GROOVY-6326] - Nonsensical error message when trying to call instance method from closure enclosed in static method
  • [GROOVY-6344] - ClassFormatError when class name contains invalid chars
  • [GROOVY-6378] - Assignment of values from Map to another causes "Incompatible generic argument types." when using @TypeChecked
  • [GROOVY-6404] - Incorrect stubs for enums without constants
  • [GROOVY-6438] - @Newify AST transformation doesn't work for anon inner classes
  • [GROOVY-6445] - Inner class can't access container class inherited attributes
  • [GROOVY-6452] - @Grab group element is documented as optional but the implementation requires it
  • [GROOVY-6460] - Static method not found when called from within closure in child class
  • [GROOVY-6477] - Array Index Operator Incorrectly Trying to Use getAt Method
  • [GROOVY-6530] - finally blocks do not always execute
  • [GROOVY-6556] - NPE on TypeResolver using anonymous inner class and the jdk7 compiler
  • [GROOVY-6614] - Groovy compiler throws internal error with @CompileStatic and getPropertyChangeListeners()
  • [GROOVY-6618] - Enum constructor doesn't work properly with variable arguments *
  • [GROOVY-6628] - Static compiler fails on constructors with initializers
  • [GROOVY-6636] - STC/CS: constructor call with Map argument fails when javabean property has a setter but no getter
  • [GROOVY-6704] - Memory leak in ClassInfo when using MetaClasses
  • [GROOVY-6713] - Inherited generic property do not honour type
  • [GROOVY-6718] - MalformedParameterizedTypeException when using genericed interfaces from a library
  • [GROOVY-6740] - Calling a static method of itself in an inner class causes ClassCastException
  • [GROOVY-6741] - Generic Traits and SAM type coercion
  • [GROOVY-6755] - Bad type resolution causing bad classes and TypeNotPresentExceptions with joint compilation, deep generics and star imports
  • [GROOVY-6762] - Groovy won't run in OSGI Java 7 environment
  • [GROOVY-6766] - collectEntries misleading error message
  • [GROOVY-6770] - The method NioGroovyMethods#write does not truncate the content of a file
  • [GROOVY-6778] - groovy scripts file path name containing "e-n" raises "java.io.IOException: Invalid argument"
  • [GROOVY-6781] - Compound assignments to "mixed type" properties don't type-check
  • [GROOVY-6791] - Cannot compile Map<K,V> == null
  • [GROOVY-6793] - Module descriptors should be read in UTF-8
  • [GROOVY-6799] - Cannot static compile for..in when List interface is extended
  • [GROOVY-6812] - ArrayIndexOutOfBoundsException on JsonBuilder.toString
  • [GROOVY-6830] - Calling Closure from within inner static class fails in 2.1.7+
  • [GROOVY-6840] - inconsistency in JsonSlurper return type
  • [GROOVY-6842] - Cannot create AIC inside closure body
  • [GROOVY-6852] - groovy.json.JsonOutput throws ArrayIndexOutOfBoundsException when serializing some Strings that contain a high percentage of non-ASCII characters.
  • [GROOVY-6855] - Groovy annotations that support closures don't get stubs generated correctly
  • [GROOVY-6866] - Cannot use @CompileStatic and @Sortable together
  • [GROOVY-6870] - Sortable should honor typical Java generics usage
  • [GROOVY-6874] - Inherit Constructors in Combination with Compile Static and Generic Parameters in the Parent Class Does not Work
  • [GROOVY-6887] - AutoClone issue with CompileStatic
  • [GROOVY-6891] - Inconsistent setter selection dynamic and static Groovy
  • [GROOVY-6892] - Oddity with Min function for Collections
  • [GROOVY-6896] - Assignment chain fails when using @CompileStatic
  • [GROOVY-6901] - @Grab dependencies can't be fetched
  • [GROOVY-6903] - try catch cause a NullPointerException
  • [GROOVY-6909] - @CompileStatic in combo @WithXXXLock transform is broken
  • [GROOVY-6910] - @CompileStatic in combo with @IndexProperty transform is broken
  • [GROOVY-6913] - additional cleanup for @Immutable combined with @CompileStatic
  • [GROOVY-6917] - additional cleanup for @Category combined with @CompileStatic
  • [GROOVY-6918] - GroovyDoc index-all page seems to list methods from private classes which are broken links
  • [GROOVY-6933] - Add swap() to List and array
  • [GROOVY-6937] - JSon serialization with unicode characters fail
  • [GROOVY-6948] - NioGroovyMethods don't work under JDK6
  • [GROOVY-6964] - Build on Windows
  • [GROOVY-6969] - Set.flatten() should return Set
  • [GROOVY-6976] - after upgrading to 2.3.5 CliBuilder doesn't work.
  • [GROOVY-6980] - Normal Groovy jar shouldn't include openbeans
  • [GROOVY-6981] - MalformedParameterizedTypeException when bounded generic attribute without visibility modifier
  • [GROOVY-6986] - Wrong end position for invalid operator
  • [GROOVY-6989] - .each{..} Closure With Parameter Typed As Object[] Makes Arguments Object[Object[]] *
  • [GROOVY-6998] - groovysh breaks terminal after exit (no chars rendered anymore)
  • [GROOVY-7005] - Compile bug with @Synchronized("lockname") and undefined lockname
  • [GROOVY-7007] - Bytecode is too big, please make it smaller.
  • [GROOVY-7009] - try block with finally having nested try causes NPE during compilation
  • [GROOVY-7011] - Trait methods with default arguments do not work correctly
  • [GROOVY-7015] - Groovy static type checking doesn't solve the generic types properly (behavior is different than Java)
  • [GROOVY-7016] - AutoClone does not check for existing copy constructor
  • [GROOVY-7021] - CompileStatic on templated classes with multiple template constraints
  • [GROOVY-7026] - GroovyShell fails to give script constructor or setBinding a binding for "args"
  • [GROOVY-7027] - @Synchronized should be disallowed on an abstract method
  • [GROOVY-7039] - Access to constant fields in classes implementing constant interfaces erroneously forbidden in @CompileStatic code
  • [GROOVY-7040] - Builder annotation should provide default values for forClass, prefix, builderClassName, buildMethodName, builderMethodName
  • [GROOVY-7043] - GString concatenation break equal operator transitive property
  • [GROOVY-7048] - Groovysh: Missing completion for optional_dot ?. and spread-dot *.
  • [GROOVY-7049] - Groovysh: Completion should suggest field notation rather than bean accessors
  • [GROOVY-7052] - Stubs do not support traits
  • [GROOVY-7054] - Read Only Property not resolved correctly at runtime (w/CompileDynamic)
  • [GROOVY-7055] - Groovysh: Command hyphen checker breaks sane code cases
  • [GROOVY-7056] - AnnotationCollector unusable in external jar when used in stub generation
  • [GROOVY-7057] - JsonSlurper with type LAX throws exception on comments in arrays
  • [GROOVY-7065] - ReturnAdder shouldn't add return if there's one in a finally block
  • [GROOVY-7071] - Improve StringGroovyMethods typing info for better @CompileStatic integration
  • [GROOVY-7077] - NullPointerException compiling fully qualified reference to 'this' of outer class inside inner class
  • [GROOVY-7091] - Cloning with AutoClone results in Null Pointer Exception
  • [GROOVY-7096] - Groovydoc needlessly initialises classes
  • [GROOVY-7104] - Default methods on closures coerced to interfaces don't work
  • [GROOVY-7110] - Error while popping argument from operand stack tracker
  • [GROOVY-7112] - @Memoized failed to apply for method with variable args
  • [GROOVY-7113] - Problem With Stubs Related To Class Which Implements A Trait
  • [GROOVY-7115] - @CompileStatic: Chained assignment to delegate property broken
  • [GROOVY-7118] - @Delegate for class that implements interface with Generic Method causes VerifyError
  • [GROOVY-7119] - Callsite helper class generation cannot handle some methods
  • [GROOVY-7120] - closure class my contain invalid chars
  • [GROOVY-7122] - Static type checking error at Iterable<T> loop
  • [GROOVY-7123] - In traits field assignment is not an expression
  • [GROOVY-7124] - Issue when a the version of a class in local SDK is different from compiled one
  • [GROOVY-7132] - JsonSlurper throws exception if reader does not fill complete char buffer
  • [GROOVY-7133] - NoClassDefFoundError: [Lint;
  • [GROOVY-7138] - Calling super.foo() from a closure fails if code is statically compiled
  • [GROOVY-7143] - groovy.json.DateFormatThreadLocal creates a memory leak
  • [GROOVY-7145] - Safe navigation operator does not perform null-check for field access under CompileStatic
  • [GROOVY-7146] - VerifyError when coercing at runtime a method that uses double or long
  • [GROOVY-7149] - @CompileStatic 'Access to <property> is forbidden' with abstract base class and interface
  • [GROOVY-7168] - I am unable to instantiate objects using the "new" keyword
  • [GROOVY-7169] - Cannot use array if it is assigned twice
  • [GROOVY-7176] - Trait missing as a keyword in Groovy documentation
  • [GROOVY-7181] - Using a memoized closure with inject corrupts the memoization cache
  • [GROOVY-7184] - Problem With Compiler Inconsistency
  • [GROOVY-7186] - Resource Leak in GroovyScriptEngine
  • [GROOVY-7190] - Problem With Static Fields Defined In A Trait
  • [GROOVY-7193] - Recursive calls cause unnecessary call site generation
  • [GROOVY-7195] - usage of compare operators should not force fastpath
  • [GROOVY-7196] - Problem With Static Trait Properties And Test Classes
  • [GROOVY-7201] - Groovysh parser produces error when writing methods with annotations
  • [GROOVY-7203] - Groovy 2.3.8 causes Gaelyk 2.1.2's initialization to fail on the Google App Engine Production server
  • [GROOVY-7206] - NullPointerException when assigning an unknown property in a trait
  • [GROOVY-7210] - array index variable unboxing not working
  • [GROOVY-7213] - Private methods in traits cause compile time error if the class implementing trait is statically compiled
  • [GROOVY-7214] - Problem With Private Methods In A Trait
  • [GROOVY-7215] - Incorrect stubs generated for traits if a class defines a conflicting property
  • [GROOVY-7216] - subMap includes keys with null value that are not in the original map
  • [GROOVY-7217] - Number initialization in traits
  • [GROOVY-7225] - GroovyShell/Grape cannot use Extension Modules that extend Closure
  • [GROOVY-7229] - Charset.toString() returns incompatible name for Charset.forName on Android
  • [GROOVY-7230] - NPE during compilation because of constant optimization

Improvement

  • [GROOVY-2900] - Allow Ant targets declaration by AntBuilder without immediate execution.
  • [GROOVY-3298] - Support multiple labels on the same statement
  • [GROOVY-5783] - Inconsistency when generating sets
  • [GROOVY-6563] - groovysh: completion candidates could use ANSI styles
  • [GROOVY-6622] - groovysh: completion: static members should only be shown for static context
  • [GROOVY-6623] - Groovysh: improve interpreter_mode likeness
  • [GROOVY-6739] - Allow to implement and register a type checking extension as a subclass of TypeCheckingExtension
  • [GROOVY-6752] - groovysh Main not customizable and buggy w.r.t. AnsiConsole *
  • [GROOVY-6753] - groovysh file commands provide ambiguous output
  • [GROOVY-6754] - groovysh positional argument terminates groovysh after evaluation
  • [GROOVY-6822] - Rewrite the JsonBuilder implementation
  • [GROOVY-6824] - Rewrite the StreamingJsonBuilder implementation
  • [GROOVY-6839] - @PackageScope could be also allowed for constructors
  • [GROOVY-6861] - Make Groovy run on Android
  • [GROOVY-6863] - Move methods from Collection to Iterable
  • [GROOVY-6869] - Move collate() and permutations() from List to Iterable
  • [GROOVY-6875] - @Builder InitializerStrategy and DefaultStrategy should avoid marking created methods as synthetic to allow Java integration
  • [GROOVY-6889] - clean up generated code when using @AutoExternalize with @CompileStatic
  • [GROOVY-6890] - NamespaceBuilder(Support): allow automatic detection of namespace declarations
  • [GROOVY-6893] - clean up generated code when using @EqualsAndHashCode with @CompileStatic
  • [GROOVY-6894] - clean up generated code when using @TupleConstructor with @CompileStatic
  • [GROOVY-6920] - Add disjoint, minus and toSpreadMap to Iterable
  • [GROOVY-6942] - support spaces in groovysh command arguments
  • [GROOVY-6943] - Support for custom .rc and .profile scripts to be loaded by groovysh
  • [GROOVY-6945] - Some DGM Collection improvements
  • [GROOVY-6952] - Add List.removeAt(int) and Collection.removeElement(Object)
  • [GROOVY-6963] - groovydoc should honour the {@docRoot} javadoc tag
  • [GROOVY-6966] - Type cast methods for Collection
  • [GROOVY-6967] - Document the possible race condition when using consumeProcessOutput()
  • [GROOVY-6968] - Improve @ASTTest to support multiple phases
  • [GROOVY-6990] - Avoid creation of MOP methods in static compilation *
  • [GROOVY-6993] - Remove inner class distributor methods if possible
  • [GROOVY-7030] - @Synchronized could allow an explicit static lock to be used for an instance method
  • [GROOVY-7059] - @InheritConstructors should replicate annotations on super constructors
  • [GROOVY-7134] - @SelfType annotation for traits
  • [GROOVY-7139] - automated constant optimization for BigDecimal
  • [GROOVY-7140] - optimze "as" usage in the static compiler
  • [GROOVY-7152] - JCenter should use https by default
  • [GROOVY-7161] - Include inherited properties with @ToString
  • [GROOVY-7175] - List.withIndex()
  • [GROOVY-7178] - Reduce memory consumption of respondsTo *
  • [GROOVY-7183] - ConfigObject does not override toString()
  • [GROOVY-7194] - Improve performance of SBA#compare operations
  • [GROOVY-7198] - Traits should allow to use @Override for method implemented from interface
  • [GROOVY-7200] - Groovysh could complete instanceof statements
  • [GROOVY-7222] - Optimize primitive type initialization in @CompileStatic

New Feature

Sub-task

  • [GROOVY-2049] - Provide some auto-overloading between int and String values
  • [GROOVY-2500] - Assignment calls the wrong setter, depending on order of declaration
  • [GROOVY-5121] - ClassInfo.modifiedExpandos is not thread safe, it can cause an infinite loop
  • [GROOVY-5351] - Malformed class names for closures in inner classes *
  • [GROOVY-5754] - Referencing an interface inner class from implementor doesn't work
  • [GROOVY-6084] - Assignment operator does not dispatch to overloaded setter methods
  • [GROOVY-6301] - Static inner classes not visible to child classes
  • [GROOVY-6339] - IncompatibleClassChangeError when using @Slf4j (on inner class) with @CompileStatic

Task

Wish

  • [GROOVY-6956] - Align the parameters of @DelegatesTo and @ClosureParams
  • [GROOVY-7085] - Add DefaultGroovyMethods.size(Iterable)

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