decompiler: move generated lines as it is stated in debug line table (disabled for now)
This commit is contained in:
@@ -20,6 +20,7 @@ import org.jetbrains.java.decompiler.code.Instruction;
|
||||
import org.jetbrains.java.decompiler.code.InstructionSequence;
|
||||
import org.jetbrains.java.decompiler.code.cfg.BasicBlock;
|
||||
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||
import org.jetbrains.java.decompiler.main.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.exps.*;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.sforms.DirectGraph;
|
||||
@@ -857,14 +858,14 @@ public class ExprProcessor implements CodeConstants {
|
||||
return defaultval;
|
||||
}
|
||||
|
||||
public static boolean getCastedExprent(Exprent exprent, VarType leftType, StringBuilder buffer, int indent,
|
||||
public static boolean getCastedExprent(Exprent exprent, VarType leftType, TextBuffer buffer, int indent,
|
||||
boolean castNull, BytecodeMappingTracer tracer) {
|
||||
return getCastedExprent(exprent, leftType, buffer, indent, castNull, false, tracer);
|
||||
}
|
||||
|
||||
public static boolean getCastedExprent(Exprent exprent,
|
||||
VarType leftType,
|
||||
StringBuilder buffer,
|
||||
TextBuffer buffer,
|
||||
int indent,
|
||||
boolean castNull,
|
||||
boolean castAlways, BytecodeMappingTracer tracer) {
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.java.decompiler.modules.decompiler.exps;
|
||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
import org.jetbrains.java.decompiler.main.ClassesProcessor.ClassNode;
|
||||
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||
import org.jetbrains.java.decompiler.main.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.main.rels.MethodWrapper;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
@@ -81,7 +82,7 @@ public class ExitExprent extends Exprent {
|
||||
tracer.addMapping(bytecode);
|
||||
|
||||
if (exittype == EXIT_RETURN) {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
TextBuffer buffer = new TextBuffer();
|
||||
|
||||
if (rettype.type != CodeConstants.TYPE_VOID) {
|
||||
buffer.append(" ");
|
||||
@@ -115,7 +116,7 @@ public class ExitExprent extends Exprent {
|
||||
if (classname != null) {
|
||||
VarType exctype = new VarType(classname, true);
|
||||
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
TextBuffer buffer = new TextBuffer();
|
||||
ExprProcessor.getCastedExprent(value, exctype, buffer, indent, false, tracer);
|
||||
|
||||
return "throw " + buffer.toString();
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.java.decompiler.modules.decompiler.exps;
|
||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
import org.jetbrains.java.decompiler.main.ClassesProcessor.ClassNode;
|
||||
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||
import org.jetbrains.java.decompiler.main.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.main.rels.MethodWrapper;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
@@ -137,7 +138,7 @@ public class FieldExprent extends Exprent {
|
||||
buf.append("super");
|
||||
}
|
||||
else {
|
||||
StringBuilder buff = new StringBuilder();
|
||||
TextBuffer buff = new TextBuffer();
|
||||
boolean casted = ExprProcessor.getCastedExprent(instance, new VarType(CodeConstants.TYPE_OBJECT, 0, classname), buff, indent, true, tracer);
|
||||
String res = buff.toString();
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.java.decompiler.modules.decompiler.exps;
|
||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
import org.jetbrains.java.decompiler.main.ClassesProcessor.ClassNode;
|
||||
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||
import org.jetbrains.java.decompiler.main.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences;
|
||||
import org.jetbrains.java.decompiler.main.rels.MethodWrapper;
|
||||
@@ -360,7 +361,7 @@ public class InvocationExprent extends Exprent {
|
||||
buf.append(", ");
|
||||
}
|
||||
|
||||
StringBuilder buff = new StringBuilder();
|
||||
TextBuffer buff = new TextBuffer();
|
||||
ExprProcessor.getCastedExprent(lstParameters.get(i), descriptor.params[i], buff, indent, true, setAmbiguousParameters.contains(i), tracer);
|
||||
|
||||
buf.append(buff);
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
import org.jetbrains.java.decompiler.main.ClassWriter;
|
||||
import org.jetbrains.java.decompiler.main.ClassesProcessor.ClassNode;
|
||||
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||
import org.jetbrains.java.decompiler.main.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
@@ -172,7 +173,7 @@ public class NewExprent extends Exprent {
|
||||
|
||||
@Override
|
||||
public String toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
TextBuffer buf = new TextBuffer();
|
||||
|
||||
if (anonymous) {
|
||||
|
||||
@@ -220,7 +221,7 @@ public class NewExprent extends Exprent {
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder buff = new StringBuilder();
|
||||
TextBuffer buff = new TextBuffer();
|
||||
ExprProcessor.getCastedExprent(param, invsuper.getDescriptor().params[i], buff, indent, true, tracer);
|
||||
|
||||
buf.append(buff);
|
||||
@@ -317,7 +318,7 @@ public class NewExprent extends Exprent {
|
||||
buf.append(", ");
|
||||
}
|
||||
|
||||
StringBuilder buff = new StringBuilder();
|
||||
TextBuffer buff = new TextBuffer();
|
||||
ExprProcessor.getCastedExprent(lstParameters.get(i), constructor.getDescriptor().params[i], buff, indent, true, tracer);
|
||||
|
||||
buf.append(buff);
|
||||
@@ -373,7 +374,7 @@ public class NewExprent extends Exprent {
|
||||
if (i > 0) {
|
||||
buf.append(", ");
|
||||
}
|
||||
StringBuilder buff = new StringBuilder();
|
||||
TextBuffer buff = new TextBuffer();
|
||||
ExprProcessor.getCastedExprent(lstArrayElements.get(i), leftType, buff, indent, false, tracer);
|
||||
|
||||
buf.append(buff);
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.java.decompiler.modules.decompiler.exps;
|
||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
import org.jetbrains.java.decompiler.main.ClassWriter;
|
||||
import org.jetbrains.java.decompiler.main.ClassesProcessor.ClassNode;
|
||||
import org.jetbrains.java.decompiler.main.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
@@ -83,7 +84,7 @@ public class VarExprent extends Exprent {
|
||||
|
||||
@Override
|
||||
public String toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
TextBuffer buffer = new TextBuffer();
|
||||
|
||||
tracer.addMapping(bytecode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user