groovy

try-finally block creates a VerifyError when used in methods with return values

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.1-beta-1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Ubuntu Linux 6.10, Java SE 6, Groovy 1.0
  • Testcase included:
    yes
  • Number of attachments :
    0

Description

When using a try-finally block in methods with return values then it creates a VerifyError on execution. The following script creates this output:

boolean foo () {
try { print "try" return true }
finally { print "finally" }
}

foo ()

Output: eddie@saringnb:~$ groovy test.groovy
Caught: java.lang.VerifyError: (class: test, method: foo signature: ()Z) Expecting to find object/array on stack

The problem doesn't exists when foo would return void.

Thanks in advance,
Stefan

Activity

Hide
blackdrag blackdrag added a comment -

was a little autoboxing issue... fixed

Show
blackdrag blackdrag added a comment - was a little autoboxing issue... fixed
Hide
Stefan Saring added a comment -

This was awesome fast ...

Thanks,
Stefan

Show
Stefan Saring added a comment - This was awesome fast ... Thanks, Stefan
Hide
blackdrag blackdrag added a comment -

autoboxing bugs are easy to fix

Show
blackdrag blackdrag added a comment - autoboxing bugs are easy to fix

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: