In fact, you don't even need a Java decompiler to do this. All you need is a backwords Java compiler. That is, one that treats bytecode as a source languages and compiles down to Java. This is a much easier process because (ignoring things like Enums) you don't need to try and figure out what the original code is, and instead can just do a naive decompile with optimization passes.