I have a groovy project that started to fail compilling sometime over the last month or so with simple extending [runtime]exception

What went wrong: Execution failed for task ‘:groovy:compileTestGroovy’. > Bad method call from inside of a branch

Exception Details:

Location:

lang/ProcessUtil$FailedToExecuteException.(Ljava/lang/String;)V @87: invokespecial

Reason:

Error exists in the bytecode

Bytecode:

0000000: b800 134d 04bd 0015 5903 2b53 5910 ff12

0000010: 04b8 001b 2a5f ab00 0000 00af 0000 0005

0000020: 8794 83a0 0000 0032 aad3 b1ff 0000 0047

0000030: c783 a456 0000 005a f0c1 c756 0000 0087

0000040: 0000 9b75 0000 00a6 5f5a 5903 3212 1db8

0000050: 0021 c000 1d5f 57b7 0024 a700 755f 5a59

0000060: 0332 b800 2ac0 002c 5f57 b700 2ea7 0062

0000070: 5f5a 5903 32b8 002a c000 2c5f 5904 3212

0000080: 1db8 0021 c000 1d5f 5905 32b8 0034 5f59

0000090: 0632 b800 345f 57b7 0037 a700 355f 5a59

00000a0: 0332 b800 2ac0 002c 5f59 0432 121d b800

00000b0: 21c0 001d 5f57 b700 3aa7 0016 5f5a 57b7

00000c0: 003d a700 0dbb 003f 5912 41b7 0042 bf57

00000d0: 2ab6 0046 4e2d 2a5f b500 482d 57b1

Stackmap Table:

full_frame(@72,{UninitializedThis,Object[#44],Object[#78]},{Object[#80],UninitializedThis})

full_frame(@93,{UninitializedThis,Object[#44],Object[#78]},{Object[#80],UninitializedThis})

full_frame(@112,{UninitializedThis,Object[#44],Object[#78]},{Object[#80],UninitializedThis})

full_frame(@157,{UninitializedThis,Object[#44],Object[#78]},{Object[#80],UninitializedThis})

full_frame(@188,{UninitializedThis,Object[#44],Object[#78]},{Object[#80],UninitializedThis})

full_frame(@197,{UninitializedThis,Object[#44],Object[#78]},{Object[#80],UninitializedThis})

full_frame(@207,{Object[#2],Object[#44],Object[#78]},{Object[#80]})

i had to add the null on super call to make this go away –

public static class FailedToExecuteException extends RuntimeException {
    public FailedToExecuteException(String msg) {
      super(msg, null) // TODO(sduchin): remove null once gradle/groovy compile issue is fixed
    }
  }

Sounds like you hit some Groovy bug. Doesn’t seem to be related to Gradle, so I recommend to raise this on the Groovy list.