Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.14, 3.0.7, 4.0.0-alpha-2
-
None
-
None
Description
Consider the following:
def test(str) { switch(str) { case 'foo': case 'bar': 'value' //break } } println test('foo') println test('bar') println test('baz')
When this script is executed, it prints "null" three times. If the break statement is added, it prints "value", "value", "null" as expected. ReturnAdder only transforms case blocks that end with break. This is possibly the reason GROOVY-4727 fails.