different header format.

Writer is given as parameter


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@150 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent af29d1d3c7
commit 6e2fd59cb6
  1. 19
      jode/jode/decompiler/ImportHandler.java

@ -20,6 +20,7 @@
package jode; package jode;
import java.util.*; import java.util.*;
import jode.bytecode.ClassInfo; import jode.bytecode.ClassInfo;
import java.io.IOException;
public class JodeEnvironment { public class JodeEnvironment {
Hashtable imports; Hashtable imports;
@ -136,7 +137,10 @@ public class JodeEnvironment {
private void dumpHeader(TabbedPrintWriter writer) private void dumpHeader(TabbedPrintWriter writer)
throws java.io.IOException throws java.io.IOException
{ {
writer.println("/* "+ className + " - Decompiled by JoDe (Jochen's Decompiler)\n * Send comments or bug reports to Jochen Hoenicke <jochenh@bigfoot.com>\n */"); writer.println("/* "+ className
+ " - Decompiled by JoDe (Jochen's Decompiler)\n"
+ " * Send comments or bug reports to "
+ Decompiler.email + "\n */");
if (pkg.length() != 0) if (pkg.length() != 0)
writer.println("package "+pkg+";"); writer.println("package "+pkg+";");
@ -154,7 +158,8 @@ public class JodeEnvironment {
System.err.println(message); System.err.println(message);
} }
public void doClass(String className) public void doClass(String className, TabbedPrintWriter writer)
throws IOException
{ {
ClassInfo clazz; ClassInfo clazz;
try { try {
@ -174,14 +179,8 @@ public class JodeEnvironment {
main = new ClassAnalyzer(null, clazz, this); main = new ClassAnalyzer(null, clazz, this);
main.analyze(); main.analyze();
TabbedPrintWriter writer = dumpHeader(writer);
new TabbedPrintWriter(System.out, " "); main.dumpSource(writer);
try {
dumpHeader(writer);
main.dumpSource(writer);
} catch (java.io.IOException e) {
e.printStackTrace();
}
} }
/* Marks the clazz as used, so that it will be imported if used often /* Marks the clazz as used, so that it will be imported if used often

Loading…
Cancel
Save