Closed GoogleCodeExporter closed 9 years ago
There's a rule for @SneakyThrows that super and this calls are excluded,
because they HAVE to be the first line in your constructor if you have one,
thus, we can't put a try around it.
The bug here is that putting @SneakyThrows on any method (or constructor) that
has no statements whatsoever to put a try/catch block around (so, an entirely
empty method OR a constructor that consists solely of a this or super call)
results in broken delombok output. Either the @SneakyThrows annotation isn't
removed (in the case of empty methods), or you get this wonky brace-free 'try
catch (....' construction.
What you 'want' for this issue (that you can @SneakyThrows away exceptions
thrown in your this/super call) cannot be fixed, but, we will address the issue
of empty methods/constructors, probably by just generating a warning, removing
the annotation (in javac), and NOT generating a try/catch block as there'd be
no point.
We've got this fixed (basically, we generate a warning if there's no code to
wrap in a try/catch block and leave it at that) locally and that fix will show
up in the next release.
Original comment by reini...@gmail.com
on 12 Mar 2013 at 12:27
Original issue reported on code.google.com by
brinkman...@gmail.com
on 19 Jan 2013 at 11:12