Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.6
-
None
-
None
Description
The attached script.groovy has a very strange behaviour:
Bar.java
class GroovyTimedInterruptAndWithTest { @groovy.transform.TimedInterrupt( 60L ) def test() { def map = [:] map.with { key1 = 'foo' key2 = 42 } map } } new GroovyTimedInterruptAndWithTest().test()
At runtime, the script immediately throws the TimeoutException (whereas the timeout's value given to the @TimedInterrupt annotation is 60 seconds) :
java.util.concurrent.TimeoutException: Execution timed out after 60 units. Start time: null
at GroovyTimedInterruptAndWithTest$_test_closure1.doCall(script.groovy)
at GroovyTimedInterruptAndWithTest.test(script.groovy:8)
at GroovyTimedInterruptAndWithTest$test.call(Unknown Source)
at script.run(script.groovy:17)
The Start time displayed in this stacktrace, which is null, is another strange fact.
Experienced on 1.8.6 but might also occur on all versions including @TimedInterrupt (1.8.0+).
This is not very critical as it's of course possible to write instead:
map['key1']='foo' map['key2']=42
but the thing is that the script runs fine when commenting the @TimedInterrupt annotation ; so this bug might hide another strange behaviours when using @TimedInterrupt annotation.