Affects Version/s: 2.3.11
Fix Version/s: 2.5.0-beta-2
Environment:Groovy Version: 2.3.11 JVM: 1.7.0_80 Vendor: Oracle Corporation OS: Linux
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
I've stumbled across some curious behaviour for the shorthand assignment operator in Groovy v2.3.11 (symptom also present in Groovy v2.4.9).
The following boolean or logic, unexpectedly throws NullPointerException.
The same approach for boolean and logic, performs as expected.
It's possible to work around the issue with explicit cast.