@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { tracer.addMapping(bytecode); if (monType == MONITOR_ENTER) { return value.toJava(indent, tracer).enclose("synchronized(", ")"); } else { return new TextBuffer(); } }
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buffer = new TextBuffer(); buffer.append("assert "); tracer.addMapping(bytecode); if (parameters.get(0) == null) { buffer.append("false"); } else { buffer.append(parameters.get(0).toJava(indent, tracer)); } if (parameters.size() > 1) { buffer.append(" : "); buffer.append(parameters.get(1).toJava(indent, tracer)); } return buffer; } }
@Override public String getClassContent(StructClass cl) { try { TextBuffer buffer = new TextBuffer(ClassesProcessor.AVERAGE_CLASS_SIZE); buffer.append(DecompilerContext.getProperty(IFernflowerPreferences.BANNER).toString()); classProcessor.writeClass(cl, buffer); return buffer.toString(); } catch (Throwable t) { DecompilerContext.getLogger().writeMessage("Class " + cl.qualifiedName + " couldn't be fully decompiled.", t); return null; } } }
return new TextBuffer(ExprProcessor.getCastTypeName(constType)); return new TextBuffer(Boolean.toString((Integer)value != 0)); return new TextBuffer(ret).enclose("'", "'"); return new TextBuffer(value.toString()); return new TextBuffer(value.toString()).append('L'); return new TextBuffer("0.0F / 0.0"); return new TextBuffer("1.0F / 0.0"); return new TextBuffer("-1.0F / 0.0"); return new TextBuffer(value.toString()).append('F'); return new TextBuffer("0.0D / 0.0"); return new TextBuffer("1.0D / 0.0"); return new TextBuffer("-1.0D / 0.0"); return new TextBuffer(value.toString()).append('D'); return new TextBuffer("null"); return new TextBuffer(convertStringToJava(value.toString(), ascii)).enclose("\"", "\"");
TextBuffer buffer = new TextBuffer("return"); TextBuffer buffer = new TextBuffer("throw "); ExprProcessor.getCastedExprent(value, exType, buffer, indent, false, tracer); return buffer;
public static TextBuffer listToJava(List<? extends Exprent> lst, int indent, BytecodeMappingTracer tracer) { if (lst == null || lst.isEmpty()) { return new TextBuffer(); } TextBuffer buf = new TextBuffer(); for (Exprent expr : lst) { if (buf.length() > 0 && expr.type == Exprent.EXPRENT_VAR && ((VarExprent)expr).isClassDef()) { // separates local class definition from previous statements buf.appendLineSeparator(); tracer.incrementCurrentSourceLine(); } TextBuffer content = expr.toJava(indent, tracer); if (content.length() > 0) { if (expr.type != Exprent.EXPRENT_VAR || !((VarExprent)expr).isClassDef()) { buf.appendIndent(indent); } buf.append(content); if (expr.type == Exprent.EXPRENT_MONITOR && ((MonitorExprent)expr).getMonType() == MonitorExprent.MONITOR_ENTER) { buf.append("{}"); // empty synchronized block } if (endsWithSemicolon(expr)) { buf.append(";"); } buf.appendLineSeparator(); tracer.incrementCurrentSourceLine(); } } return buf; }
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buffer = new TextBuffer(); tracer.addMapping(bytecode); if (classDef) { ClassNode child = DecompilerContext.getClassProcessor().getMapRootClasses().get(varType.value); new ClassWriter().classToJava(child, buffer, indent, tracer); tracer.incrementCurrentSourceLine(buffer.countLines()); } else { VarVersionPair varVersion = getVarVersionPair(); String name = null; if (processor != null) { name = processor.getVarName(varVersion); } if (definition) { if (processor != null && processor.getVarFinal(varVersion) == VarTypeProcessor.VAR_EXPLICIT_FINAL) { buffer.append("final "); } appendDefinitionType(buffer); buffer.append(" "); } buffer.append(name == null ? ("var" + index + (this.version == 0 ? "" : "_" + this.version)) : name); } return buffer; }
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buf = new TextBuffer(); TextBuffer buff = new TextBuffer(); boolean casted = ExprProcessor.getCastedExprent(instance, new VarType(CodeConstants.TYPE_OBJECT, 0, classname), buff, indent, true, tracer); String res = buff.toString();
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buf = new TextBuffer(); if (isLabeled()) { buf.appendIndent(indent).append("label").append(this.id.toString()).append(":").appendLineSeparator(); } buf.appendIndent(indent).append("abstract statement {").appendLineSeparator(); for (Statement stat : stats) { buf.append(stat.toJava(indent + 1, tracer)); } buf.appendIndent(indent).append("}"); return buf; } }
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buffer = new TextBuffer(); buffer.appendIndent(indent); buffer.append('@'); buffer.append(DecompilerContext.getImportCollector().getShortName(ExprProcessor.buildJavaClassName(className))); int type = getAnnotationType(); if (type != ANNOTATION_MARKER) { buffer.append('('); boolean oneLiner = type == ANNOTATION_SINGLE_ELEMENT || indent < 0; for (int i = 0; i < parNames.size(); i++) { if (!oneLiner) { buffer.appendLineSeparator().appendIndent(indent + 1); } if (type != ANNOTATION_SINGLE_ELEMENT) { buffer.append(parNames.get(i)); buffer.append(" = "); } buffer.append(parValues.get(i).toJava(0, tracer)); if (i < parNames.size() - 1) { buffer.append(','); } } if (!oneLiner) { buffer.appendLineSeparator().appendIndent(indent); } buffer.append(')'); } return buffer; }
SwitchHelper.simplify(this); TextBuffer buf = new TextBuffer(); buf.append(ExprProcessor.listToJava(varDefinitions, indent, tracer)); buf.append(first.toJava(indent, tracer));
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buf = new TextBuffer(); buf.append(ExprProcessor.listToJava(varDefinitions, indent, tracer)); buf.append(first.toJava(indent, tracer)); if (isLabeled()) { buf.appendIndent(indent).append("label").append(this.id.toString()).append(":").appendLineSeparator(); tracer.incrementCurrentSourceLine(); } buf.appendIndent(indent).append(headexprent.get(0).toJava(indent, tracer)).append(" {").appendLineSeparator(); tracer.incrementCurrentSourceLine(); buf.append(ExprProcessor.jmpWrapper(body, indent + 1, true, tracer)); buf.appendIndent(indent).append("}").appendLineSeparator(); mapMonitorExitInstr(tracer); tracer.incrementCurrentSourceLine(); return buf; }
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buf = new TextBuffer(); case TYP_GENERAL: if (VarExprent.VAR_NAMELESS_ENCLOSURE.equals(buf.toString())) { buf = new TextBuffer(); for (int i = start; i < lstParameters.size(); i++) { if (mask == null || mask.get(i) == null) { TextBuffer buff = new TextBuffer(); boolean ambiguous = setAmbiguousParameters.get(i);
String new_line_separator = DecompilerContext.getNewLineSeparator(); TextBuffer buf = new TextBuffer();
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buf = new TextBuffer();
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buf = new TextBuffer(); boolean islabeled = isLabeled(); buf.append(ExprProcessor.listToJava(varDefinitions, indent, tracer)); if (islabeled) { buf.appendIndent(indent++).append("label").append(this.id.toString()).append(": {").appendLineSeparator(); tracer.incrementCurrentSourceLine(); } boolean notempty = false; for (int i = 0; i < stats.size(); i++) { Statement st = stats.get(i); if (i > 0 && notempty) { buf.appendLineSeparator(); tracer.incrementCurrentSourceLine(); } TextBuffer str = ExprProcessor.jmpWrapper(st, indent, false, tracer); buf.append(str); notempty = !str.containsOnlyWhitespaces(); } if (islabeled) { buf.appendIndent(indent-1).append("}").appendLineSeparator(); tracer.incrementCurrentSourceLine(); } return buf; }
return new TextBuffer(); TextBuffer buffer = new TextBuffer();
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buf = new TextBuffer();
TextBuffer classBuffer = new TextBuffer(AVERAGE_CLASS_SIZE); new ClassWriter().classToJava(root, classBuffer, 0, null);
@Override public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { TextBuffer buf = new TextBuffer();