Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.8.2
-
Fix Version/s: 1.8.4
-
Component/s: Compiler
-
Labels:None
-
Environment:java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
Groovy Version: 1.8.2 JVM: 1.6.0_23
-
Testcase included:yes
-
Number of attachments :
Description
In the attached test case you will see four methods which do the same three things. Each initializes a map, increments a value in the map, and then returns the map. The method called "works()" uses the add assignment operator to do this. The "buggy()" method is the same, but adds an enum comparison.
There is some interaction between the enum comparison and the += operator. The method "numericComparison()" is just like "buggy()," but performs an integer comparison. The "workaround()" method avoids the += operator. Both of these methods return a Map as expected.
Strange. I just ran your example as a script and had no problems:
I.e. buggy() wasn't buggy for me.
I was using Java 7.0_01, Groovy 1.8.4, Windows 7, running in the groovyConsole.