Changelog for Groovy 2.0.0

Bug

  • [GROOVY-3388] - GroovyASTTransformation phase must be SEMANTIC_ANALYSIS or later for usage
  • [GROOVY-3467] - Boolean assignment optimized by compiler
  • [GROOVY-4001] - Grapes/Grab spending time checking remote repositories every 3rd run?
  • [GROOVY-4016] - Single super constructor argument is casted to array if super constructor has vararg parameter
  • [GROOVY-4231] - DOMCategory.setValue is unable to handle newly created elements
  • [GROOVY-4269] - metaClosure not called when using named parameters in Sql.rows
  • [GROOVY-4290] - Parse error when using method call w/o parens in method-level annotation closure
  • [GROOVY-4292] - ClassHelper.ClassHelperCache#classCache is not thread-safe
  • [GROOVY-4362] - Node.text() returns empty string for non-String or Collection values
  • [GROOVY-4415] - Error implementing a Java or Groovy generic interface
  • [GROOVY-4430] - Verify Error when using wrong enum syntax
  • [GROOVY-4457] - generic type declarations leaking across all files in a build
  • [GROOVY-4617] - Error when running groovysh with verbose option (-v)
  • [GROOVY-4633] - @InheritConstructors does not work on inner classes *
  • [GROOVY-4645] - Convariant returns causes compiler to fail when generating property getters
  • [GROOVY-4658] - CLONE -problem compiling @Delegate to an interface that extends another interface (handle default args case)
  • [GROOVY-4660] - NPE in groovy.servlet.AbstractHttpServlet if deploy WAR to jetty
  • [GROOVY-4803] - out of memory error when running groovydoc when there are java files in packages
  • [GROOVY-4812] - Problem Parsing Expression With 1.8.0
  • [GROOVY-4841] - Null BigDecimals converted to String with add operator *
  • [GROOVY-4922] - StackOverflowError when calling super and overriding a package protected java method
  • [GROOVY-4934] - incorrect signature attributes in class files for inner class generics
  • [GROOVY-4946] - Groovy getAt cannot be used with lazily initialized lists
  • [GROOVY-4958] - ConfigSlurper doesn't parse config files that contain $ signs in property values correctly
  • [GROOVY-4966] - VeryifyError in multi-dimensional array usage: Incompatible argument to function
  • [GROOVY-4967] - List to LinkedHashSet inconsistent conversion behavior vs List to HashSet
  • [GROOVY-4970] - Method call expression parsed differently in 1.8 compared to 1.7
  • [GROOVY-4973] - Inconsistent numeric range types
  • [GROOVY-4979] - @ToString creates additional unneeded field
  • [GROOVY-4986] - java.sql.Timestamp + int = java.util.Date
  • [GROOVY-4988] - JsonSlurper fails to correctly parse strings containing some escaped character sequences
  • [GROOVY-4997] - @Immutable not working for inner classes *
  • [GROOVY-5044] - Ant Groovyc compilation error in Gradle
  • [GROOVY-5061] - Incorrect translation of class property which type has array as enclosed type argument
  • [GROOVY-5063] - Cannot set "-Werror" javac option when using Groovyc ant task.
  • [GROOVY-5076] - the shorthand notation for Grab isn't working correctly
  • [GROOVY-5080] - Inner type default constructors incorrectly tagged synthetic
  • [GROOVY-5082] - Sometimes invalid inner class reference left in .class files produced for interfaces
  • [GROOVY-5084] - Groovydoc can't handle @link tags in package-info.java
  • [GROOVY-5087] - Variables from a static import scope used in GStrings resolve to null under certain conditions
  • [GROOVY-5089] - Unnecessary unboxing and casting in boolean handling in generated bytecode
  • [GROOVY-5090] - Groovy compiler generates invalid byte code for local boolean variables that later on are referenced in a closure
  • [GROOVY-5097] - Proxy unwrapping causes UndeclaredThrowableExceptions
  • [GROOVY-5101] - GroovyCastException occurs since 1.8.3
  • [GROOVY-5102] - Unrelated changes cause BigDecimal division to return Double
  • [GROOVY-5109] - inner class inheritance with outer class inheritance can't find constructor
  • [GROOVY-5111] - Named parameter support breaks with postgres casting syntax
  • [GROOVY-5112] - "A transform used a generics containing ClassNode" error messages for @Delegate
  • [GROOVY-5114] - String[] to Set coercion seems broken in some cases
  • [GROOVY-5119] - Node.depthFirst() 'forgets' text nodes
  • [GROOVY-5122] - static fields on interface not getting initialized, when being initialized to an anonymous class instance
  • [GROOVY-5126] - Arrays.asList(2L,2L) returns incorrect inferred generic type
  • [GROOVY-5127] - Assignement to interface is wrongly marked as an error
  • [GROOVY-5129] - groovy.json.JsonSlurper failes to parse decimal numbers correctly
  • [GROOVY-5130] - Documentation: Error for one of the examples from JN0025-Starting
  • [GROOVY-5137] - MockFor.getInstance() fails for abstract classes
  • [GROOVY-5140] - ASTTransformationCustomizer uses wrong classloader to find transformer class from annotation
  • [GROOVY-5141] - The static type checker may be unable to choose between two "identical" methods from DGM
  • [GROOVY-5142] - collectMany should not use createSimilarCollection and instead behave like collect
  • [GROOVY-5144] - JsonSlurper does not handle backslashes at the end of a String
  • [GROOVY-5145] - Return type inference doesn't handle closures properly
  • [GROOVY-5147] - Static type checker marks null assignments as invalid
  • [GROOVY-5148] - Static type checker should allow casts to character from single char strings
  • [GROOVY-5152] - object instanceof MyObject[] causes ClassDefNotFound exception within Closure
  • [GROOVY-5154] - Invalid Static Type Checking report on a method call with type parameters
  • [GROOVY-5156] - Strange method name in the StaticTypeCheckingVisitor class
  • [GROOVY-5158] - Encoding issue with groovy.xml.XmlUtil.serialize()
  • [GROOVY-5160] - Assignments in if/else/for/while/ternary are not type checked properly
  • [GROOVY-5161] - MetaObjectProtocol.getMetaMethod doc for "args" is ambiguous
  • [GROOVY-5162] - JsonOutput fails with uninformative NPE when map has null key
  • [GROOVY-5163] - IncompatibleClassChangeError when running groovysh
  • [GROOVY-5165] - ASTNode#removeNodeMetaData may nullify metaData field
  • [GROOVY-5166] - Static type checker should handle closure shared variables properly
  • [GROOVY-5167] - GDK date methods not recognized by the static type checker
  • [GROOVY-5168] - Static type checker should not complain on methods w/ implicit object return type when last expression is void
  • [GROOVY-5170] - GroovyRowResult and GroovyResultSet are Inconsistent with each other when using a postgres driver
  • [GROOVY-5171] - Change execution phase of static type checking
  • [GROOVY-5172] - Inferred generics parameter types could contain primitive types
  • [GROOVY-5173] - BigDecimals are incorrectly converted to Double after arithmetic operation (appears to be the same as [GROOVY-5102] - Unrelated changes cause BigDecimal division to return Double)
  • [GROOVY-5175] - Calling a method with a null argument's value when the parameter is an array
  • [GROOVY-5176] - incorrect handling of generics placeholders in JavaStubGenerator
  • [GROOVY-5177] - STC allows assign an array to any type which is not an array
  • [GROOVY-5178] - STC allows assign an array to any type which is not an array
  • [GROOVY-5181] - "static final" constructors should be a Compile-time error
  • [GROOVY-5184] - Static type checker doesn't handle divisions properly
  • [GROOVY-5193] - Compilation should always fail when two methods exist in the same class with the same name but differing access levels *
  • [GROOVY-5196] - Map#drop Javadoc breaks all following Javadoc
  • [GROOVY-5197] - Source location incorrect for statement after a label
  • [GROOVY-5198] - using "as" to coerce a String to an Enum value results in a groovy.lang.MissingMethodException under high contention
  • [GROOVY-5199] - Expression#transformExpression should copy node metadata
  • [GROOVY-5202] - inherited non public listener structure causing NPE
  • [GROOVY-5207] - @Field access within closure fails with 'BUG! exception in phase 'class generation' in source unit'
  • [GROOVY-5210] - Problem converting primitive array to a Set
  • [GROOVY-5212] - Compilation problem for java enums defined as groovy classes
  • [GROOVY-5213] - Inner classes are not type checked
  • [GROOVY-5214] - Source location incorrect for enums
  • [GROOVY-5216] - groovy.sql.Sql.newInstance(Map<String, Object>) remove params
  • [GROOVY-5217] - Calls to closures declared as fields are not type checked properly
  • [GROOVY-5219] - FactoryBuilderSupport doesn't register methods in a predictable order
  • [GROOVY-5221] - Problem with @InheritConstructors with multiple level of inheritance (part 1 of 2 - document the current limitation)
  • [GROOVY-5222] - Casts to subclasses should not be caught as errors by the type checker
  • [GROOVY-5224] - groovy.util.Node plus operator assuming all children are not strings
  • [GROOVY-5226] - Variables which type is determined thanks to instanceof checks should be usable as arguments without casts
  • [GROOVY-5228] - Prefix/Postfix operations are not type checked
  • [GROOVY-5229] - Some properties are not recognized as properties by the type checker
  • [GROOVY-5231] - Problem with @TupleConstructor with static type checking
  • [GROOVY-5232] - Static type checking fails on setter call
  • [GROOVY-5233] - Static type checker has problems with args coerced to arrays
  • [GROOVY-5235] - Static compilation of method call expressions with missing default parameters
  • [GROOVY-5237] - Static type checker complains on assignment on generics fields
  • [GROOVY-5238] - Methods belonging to a different source unit get visited and report errors at the wrong place
  • [GROOVY-5240] - Static type checker confuses Class and type
  • [GROOVY-5247] - Sorting a map then passing it to JsonBuilder results in a NullPointerException only in 1.8.5
  • [GROOVY-5248] - call site caching missing null check
  • [GROOVY-5256] - Wrong generation of stubs with Generics
  • [GROOVY-5257] - Node.ReplaceNode method fails cannot remove itself
  • [GROOVY-5258] - Static type checker incorrectly handles assignments of variables used as parameters in control structures
  • [GROOVY-5259] - VerifyError - cannot access outer class static final fields from an inner class
  • [GROOVY-5260] - Groovyc stub generation doesn't handle all primitive types properly
  • [GROOVY-5262] - Problem currying null parameters
  • [GROOVY-5267] - getting java.lang.VerifyError depending on some simple method content
  • [GROOVY-5272] - Intermittant/random incorrect resolution of sub-interface constant values
  • [GROOVY-5274] - CLONE - Problem with @InheritConstructors with multiple level of inheritance
  • [GROOVY-5277] - SecureASTCustomizer doesn't check class methods
  • [GROOVY-5278] - groovy allows top-level classes be marked as private *
  • [GROOVY-5279] - groovysh holds a grudge -
  • [GROOVY-5280] - DOMCategory: NullPointerException in setValue() when element has no text
  • [GROOVY-5285] - super.setMetaClass() generates StackOverflowError when there is no base class *
  • [GROOVY-5286] - Constant pool is used for not final fields too
  • [GROOVY-5287] - invalid unboxing in compare and other operations if primopts are enabled
  • [GROOVY-5288] - invalid cast of null to int
  • [GROOVY-5292] - Stub generation doesn't handle 'protected' multi-line String correctly.
  • [GROOVY-5293] - ASTTransformationVisitor not closing URL streams
  • [GROOVY-5294] - This reference is null during construction of object of abstract class implemented as closure map
  • [GROOVY-5295] - Static type checker cannot choose between two covariant return type methods
  • [GROOVY-5303] - page title on groovydoc index page is "{todo.title}"
  • [GROOVY-5304] - groovydoc output html does not specify character encoding
  • [GROOVY-5308] - Caught: BUG! exception in phase 'conversion' in source unit '${file}' null
  • [GROOVY-5316] - @Lazy (LazyASTTransformation) not multi-thread safe
  • [GROOVY-5323] - JsonOutput.prettyPrint breaks escaped special characters
  • [GROOVY-5330] - Typo in exception message at JsonSlurper.parseObject()
  • [GROOVY-5332] - Map<String,Integer> is recognized as Map<String,String> by the type checker
  • [GROOVY-5339] - groovy.sql.Sql.executeQuery(String) should be non-final for extension
  • [GROOVY-5340] - AbstractQueryCommand constructor should be protected for subclassing
  • [GROOVY-5356] - When using Grab concurrently the underlying ivy library can lock a metadata file causing grab failure
  • [GROOVY-5361] - XmlParser and XmlSlurper should support XML Schema validation
  • [GROOVY-5371] - Sql DataSet fails to work with non-literals in queries (fix error message/doco)
  • [GROOVY-5374] - @TypeChecked does not recognize @Log annotation
  • [GROOVY-5377] - CLONE - Incomprehensible Error Message Passing Partial Evaluated Lambda Function (improved error message for normal closure not on classpath case)
  • [GROOVY-5383] - @ListenerList changes the ArrayList classnode generics
  • [GROOVY-5384] - Type checker doesn't infer generics properly
  • [GROOVY-5411] - Type checker doesn't seem to realise a non-static method won't satisfy a call from a static context
  • [GROOVY-5415] - Static Type checker reporting invalid error
  • [GROOVY-5416] - Transform loaded by wrong class loader when @GroovyASTTransformationClass(classes = ...) is used
  • [GROOVY-5428] - Performance problem: ClassCastExceptions are created in normal execution flow which kills performance
  • [GROOVY-5443] - Static type checking not working for fields assigment
  • [GROOVY-5444] - Message "This method should not have been called" on script with nested loops and @CompileStatic
  • [GROOVY-5454] - Static type checker reports ambiguous method call on DGM method
  • [GROOVY-5456] - Static type compiler failure when defining a closure using the / operator
  • [GROOVY-5457] - The example code in the docs of Closure class regarding OWNER_ONLY resolution strategy is wrong
  • [GROOVY-5463] - "Caught: BUG! exception in phase 'class generation'" when @CompileStatic present on class definition
  • [GROOVY-5470] - @TypeChecked Closure methods/properties not recognized inside closure defition
  • [GROOVY-5479] - indy looses safe navigation flag
  • [GROOVY-5480] - @TypeChecked type inference does not work with closure
  • [GROOVY-5482] - Type inference on lists
  • [GROOVY-5486] - Distribution misses some dependencies
  • [GROOVY-5487] - jarjar task in Gradle doesn't exclude some classes
  • [GROOVY-5488] - groovy-all pom doesn't include modules dependencies
  • [GROOVY-5495] - @TypeChecked and @CompileStatic is not aware of interfaces hierarchy
  • [GROOVY-5497] - Returning "null" in a function reports an invalid type checking error
  • [GROOVY-5498] - Static type check reports an error when accessing some property
  • [GROOVY-5500] - GroovyBugError thrown when it shouldn't be
  • [GROOVY-5507] - rcurry for overloaded MethodClosure throws an exception
  • [GROOVY-5512] - [NPE] Creating a range in an inner class using @CompileStatic
  • [GROOVY-5516] - Type checker fails verification of generic types with addAll
  • [GROOVY-5517] - Type inference doesn't work with a Java class and a static property
  • [GROOVY-5518] - Static Type Checker: Cannot return null with type checking enabled
  • [GROOVY-5519] - Static Type Checker: Exception type not inferred for catch blocks
  • [GROOVY-5520] - Static Type Checker: Cannot check for null against a Java interface
  • [GROOVY-5521] - Static Type Checker: Type not inferred from maps with generics
  • [GROOVY-5522] - Add array DGM variants for find and findAll to assist Static Type Checker
  • [GROOVY-5523] - Static Type Checker: Ternary operator doesn't allow nulls
  • [GROOVY-5525] - Type checker doesn't find a method defined in Arrays
  • [GROOVY-5526] - VerifyError using @CompileStatic and assertEquals
  • [GROOVY-5527] - VerifyError with @CompileStatic when using the power operator
  • [GROOVY-5528] - wrong generics check for classes extending another class and giving through the generics parameter
  • [GROOVY-5529] - Closure not statically compiled and owner access issue
  • [GROOVY-5530] - No compilation error for GString values in named parameter consturctors for String fields
  • [GROOVY-5531] - Problem accessing closure parameter inside named arg constructor values inside a closure in a @CompileStatic class
  • [GROOVY-5532] - Static compilation complains when accessing a property with a property notation inside a named arg ctor inside a closure inside a @CompileStatic class
  • [GROOVY-5533] - Static compiler doesn't write valid bytecode for list.property
  • [GROOVY-5534] - Static Compilation: Groovy @CompileStatic doesn't support safe dereference
  • [GROOVY-5535] - When variable is not initialized @CompileStatic can fail compilation
  • [GROOVY-5536] - Using @CompileStatic causes VerifierError
  • [GROOVY-5537] - Using @CompileStatic results in "Illegal use of nonvirtual function call"
  • [GROOVY-5538] - Using @CompileStatic produces NoSuchMethodError
  • [GROOVY-5539] - @CompileStatic throws verify error using power operator
  • [GROOVY-5540] - Static compiler doesn't choose the right method in hierarchy
  • [GROOVY-5541] - AstBrowser doesn't show any labels
  • [GROOVY-5545] - Groovy console OS X icon broken again
  • [GROOVY-5547] - Groovy RC release zip download contains duplicate files
  • [GROOVY-5552] - Stackoverflow in JsonSlurper.parseText
  • [GROOVY-5555] - groovy.sql is missing from the 2.0 api docs online and in the docs .zip file
  • [GROOVY-5972] - String returned by JsonOutput.prettyPrint() isn't valid JSON

Improvement

  • [GROOVY-2067] - Truth as a method.
  • [GROOVY-2116] - add an extension mechanism to allow new GDK methods to be added to other libraries by other projects using a META-INF/services/groovy/groovyMethods file on the classpath to list Classes to be used to load GDK methods
  • [GROOVY-2247] - check the new StackMapTable feature for usage in Groovy
  • [GROOVY-2528] - Provide optional attribute to groovy task to specify Java executable to use, similar to the executable attribute used in the javac task
  • [GROOVY-3916] - Implement ranges for Calendar
  • [GROOVY-4735] - part1: patches to enable groovy-eclipse to run unpatched groovy
  • [GROOVY-4783] - @ToString generated code does not need private instance field
  • [GROOVY-4788] - The clearTime() method added to java.*.Date should return the modified Date for a more fluent API
  • [GROOVY-5024] - Reduce groovyc command line length
  • [GROOVY-5088] - @Immutable should support java.util.UUID
  • [GROOVY-5095] - MetaClassRegistryChangeEventListener doesn't provide a way to get a reference to the old meta class
  • [GROOVY-5100] - Unnecessary castToType when boxed type subclasses or implements the target type
  • [GROOVY-5105] - Avoid temporary bytecode variable on simple declaration assignments
  • [GROOVY-5118] - Make TupleConstructor work with enums
  • [GROOVY-5132] - GroovyConsole should support adding multiple Jars at one time via the Menu.
  • [GROOVY-5134] - @ToString optionally exclude fields with null values
  • [GROOVY-5135] - Implement a "lowest upper bound" algorithm
  • [GROOVY-5138] - GEP 10 - Static compilation
  • [GROOVY-5139] - GroovyTestCase's shouldFail {...} should return the throwable and not the enclosed message
  • [GROOVY-5143] - We should provide a version of collect with no parameters that implicitly uses Closure.IDENTITY
  • [GROOVY-5146] - Disallow setting of type on VariableExpression if isClosureSharedVariable() returns true from AST transforms
  • [GROOVY-5149] - Groovy should default to LinkedHashSet when using 'as Set' to make default sets deterministic
  • [GROOVY-5150] - Switch to a primitive representation of constants
  • [GROOVY-5151] - Provide methods to specify owner, delegate and thisObject of closures
  • [GROOVY-5164] - LongMath does not make use of Long.valueOf() optimization
  • [GROOVY-5179] - Implement type inference for for loop variable types
  • [GROOVY-5182] - for consistency, DGM collectEntries should have a Closure.IDENTITY variant
  • [GROOVY-5190] - groovy -version could show more information about the JVM
  • [GROOVY-5223] - Bytecode optimizations: make use of LDC for class literals *
  • [GROOVY-5230] - Add a <license/> block to groovy's POM
  • [GROOVY-5241] - GroovyScriptEngineImpl could use ConcurrentHashMaps
  • [GROOVY-5255] - GroovyClassLoader-aware constructor of GroovyScriptEngineImpl
  • [GROOVY-5266] - GroovyEngine not creating friendly script names for ant files
  • [GROOVY-5269] - Add hasVariable to binding
  • [GROOVY-5270] - TableSorter prints to System.out on table change
  • [GROOVY-5271] - TimeDuration should implement Comparable
  • [GROOVY-5276] - Change ProxyGenerator to use ASM based class generation instead of GroovyShell *
  • [GROOVY-5283] - Add a collate method to List
  • [GROOVY-5307] - "Null key for a Map not allowed" is a bad error description in JsonOutput
  • [GROOVY-5315] - Inject could take the initialValue from the first item in the Collection/Array
  • [GROOVY-5324] - Provide a hook for FactoryBuilderSupport subclasses/decorators for handling methodMissing
  • [GROOVY-5325] - Provide a hook for FactoryBuilderSupport subclasses/decorators for handling propertyMissing
  • [GROOVY-5326] - FactorBuilderSupport's resolve* methods could be extension friendly
  • [GROOVY-5329] - Allow static type checking to be turned off for individual classes/methodss
  • [GROOVY-5333] - Visit properties and fields even if variable is a DynamicVariable
  • [GROOVY-5338] - GroovyDoc doesn't create package-list
  • [GROOVY-5387] - Support for Iterable.collectEntries
  • [GROOVY-5401] - Extend groovy.sql.DataSet with paging capabilities
  • [GROOVY-5402] - Provide a plus() method for arrays
  • [GROOVY-5407] - Make DGM.first() and DGM.last() work with any Iterable
  • [GROOVY-5408] - JavaAwareCompilationUnit should have a constructor that allows to set transformLoader
  • [GROOVY-5409] - Improve error message for shouldFailWithCause
  • [GROOVY-5429] - Add excludes to @EqualsAndHashCode
  • [GROOVY-5431] - Allow @EqualsAndHashCode, @Canonical, @TupleConstructor, @ToString to use an array of Strings in addition to a comma separated String
  • [GROOVY-5432] - GroovyDoc error for @EqualsAndHashCode
  • [GROOVY-5448] - make indy use switchpoints for constant meta class changes

New Feature

  • [GROOVY-3307] - Add byte[].encodeHex
  • [GROOVY-4789] - Add method on Date to parse strings created with date.toString()
  • [GROOVY-4835] - provide a @NotYetImplemented AST transform for test cases of not yet implemented features (@Hackergarten contribution)
  • [GROOVY-5073] - GEP 8 - Static Type Checking
  • [GROOVY-5096] - @Immutable should have an extensible way to be informed of classes that are "deemed" Immutable
  • [GROOVY-5263] - New GDK method: Object[].contains()
  • [GROOVY-5273] - Provide contains as a DGM method for primitive arrays
  • [GROOVY-5341] - json implicit object of type JsonBuilder added to groovlets
  • [GROOVY-5375] - Sql has newInstance methods which create connections but doesn't manage them
  • [GROOVY-5392] - @ASTTest AST transformation
  • [GROOVY-5405] - Named parameters for groovy.sql.Sql
  • [GROOVY-5412] - Implement a matchesPartially() method on Matchers
  • [GROOVY-5414] - Groovy could benefit from DGM takeWhile and dropWhile methods
  • [GROOVY-5460] - HTML Builder changes & between URL parameters to &amp; when building an <a> tag

Sub-task

  • [GROOVY-3014] - add an annotation that forces the compiler to check methods for their existence at compile time
  • [GROOVY-5081] - Handle explicit and implicit returns

Task

Wish

  • [GROOVY-5107] - java.util.UUID support in JsonBuilder
  • [GROOVY-5123] - avoid getTypeClass() use in DelegateASTTransformation
  • [GROOVY-5133] - java.net.URL support in groovy.json.JsonBuilder

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