decompiler: map dummy return line to the method closing bracket

This commit is contained in:
Egor.Ushakov
2015-03-24 17:56:33 +03:00
parent 07e1d66a53
commit 500f8b12d8
34 changed files with 565 additions and 128 deletions

View File

@@ -534,8 +534,8 @@ public class ClassWriter {
indent += 1;
}
RootStatement root = classWrapper.getMethodWrapper(mt.getName(), mt.getDescriptor()).root;
if (!methodWrapper.decompiledWithErrors) {
RootStatement root = classWrapper.getMethodWrapper(mt.getName(), mt.getDescriptor()).root;
if (root != null) { // check for existence
try {
buffer.append(root.toJava(indent, tracer));
@@ -553,12 +553,13 @@ public class ClassWriter {
buffer.appendLineSeparator();
}
if (root != null) {
tracer.addMapping(root.getDummyExit().bytecode);
}
if (!codeOnly) {
indent -= 1;
buffer.appendIndent(indent);
buffer.append('}');
buffer.appendLineSeparator();
buffer.appendIndent(indent).append('}').appendLineSeparator();
}
}
finally {
@@ -869,6 +870,9 @@ public class ClassWriter {
tracer.incrementCurrentSourceLine();
}
if (root != null) {
tracer.addMapping(root.getDummyExit().bytecode);
}
buffer.appendIndent(indent).append('}').appendLineSeparator();
tracer.incrementCurrentSourceLine();
}