fixed line numbers in case of decompile error
This commit is contained in:
@@ -827,11 +827,16 @@ public class ClassWriter {
|
|||||||
|
|
||||||
if (root != null && !methodWrapper.decompiledWithErrors) { // check for existence
|
if (root != null && !methodWrapper.decompiledWithErrors) { // check for existence
|
||||||
try {
|
try {
|
||||||
TextBuffer code = root.toJava(indent + 1, tracer);
|
// to restore in case of an exception
|
||||||
|
BytecodeMappingTracer codeTracer = new BytecodeMappingTracer(tracer.getCurrentSourceLine());
|
||||||
|
TextBuffer code = root.toJava(indent + 1, codeTracer);
|
||||||
|
|
||||||
hideMethod = (clinit || dinit || hideConstructor(wrapper, init, throwsExceptions, paramCount)) && code.length() == 0;
|
hideMethod = (clinit || dinit || hideConstructor(wrapper, init, throwsExceptions, paramCount)) && code.length() == 0;
|
||||||
|
|
||||||
buffer.append(code);
|
buffer.append(code);
|
||||||
|
|
||||||
|
tracer.setCurrentSourceLine(codeTracer.getCurrentSourceLine());
|
||||||
|
tracer.addTracer(codeTracer);
|
||||||
}
|
}
|
||||||
catch (Throwable ex) {
|
catch (Throwable ex) {
|
||||||
DecompilerContext.getLogger()
|
DecompilerContext.getLogger()
|
||||||
@@ -848,8 +853,7 @@ public class ClassWriter {
|
|||||||
buffer.appendLineSeparator();
|
buffer.appendLineSeparator();
|
||||||
tracer.incrementCurrentSourceLine();
|
tracer.incrementCurrentSourceLine();
|
||||||
}
|
}
|
||||||
|
else if (root != null) {
|
||||||
if (root != null) {
|
|
||||||
tracer.addMapping(root.getDummyExit().bytecode);
|
tracer.addMapping(root.getDummyExit().bytecode);
|
||||||
}
|
}
|
||||||
buffer.appendIndent(indent).append('}').appendLineSeparator();
|
buffer.appendIndent(indent).append('}').appendLineSeparator();
|
||||||
|
|||||||
Reference in New Issue
Block a user