Recaf icon indicating copy to clipboard operation
Recaf copied to clipboard

Rethrows Missing in Decompiled code

Open 0xbadb0d00 opened this issue 2 years ago • 1 comments

Describe the bug

When you try to recompile a class that contains methods that rethrow to the caller an Exception, it generate the error:

unreported exception <ExceptionClass>; must be caught or declared to be thrown

The workaround is to modify manually the method declaration, by adding the throws instruction:

public static Type MethodName(Parameters) throws ExceptionClass {

0xbadb0d00 avatar Dec 09 '23 14:12 0xbadb0d00

Can you provide a sample or be more specific with the description?

Col-E avatar Dec 09 '23 23:12 Col-E

Going to assume this is a decompiler issue, in which this is a 3rd party problem where the decompiler is not adding the thrown type to the method signature.

Col-E avatar Jun 08 '24 04:06 Col-E