imports cleaned up

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1063 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
jochen 26 years ago
parent 56464880ac
commit 2ecb19a3d9
  1. 12
      jode/jode/Decompiler.java
  2. 18
      jode/jode/decompiler/ClassAnalyzer.java
  3. 9
      jode/jode/decompiler/FieldAnalyzer.java
  4. 5
      jode/jode/decompiler/ImportHandler.java

@ -18,13 +18,21 @@
*/ */
package jode; package jode;
import java.io.*;
import jode.bytecode.ClassInfo; import jode.bytecode.ClassInfo;
import jode.bytecode.SearchPath; import jode.bytecode.SearchPath;
import jode.bytecode.InnerClassInfo; import jode.bytecode.InnerClassInfo;
import jode.decompiler.*; import jode.decompiler.ClassAnalyzer;
import jode.decompiler.ImportHandler;
import jode.decompiler.TabbedPrintWriter;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import gnu.getopt.LongOpt; import gnu.getopt.LongOpt;
import gnu.getopt.Getopt; import gnu.getopt.Getopt;

@ -20,7 +20,8 @@
package jode.decompiler; package jode.decompiler;
import jode.GlobalOptions; import jode.GlobalOptions;
import jode.Decompiler; import jode.Decompiler;
import jode.type.*; import jode.type.MethodType;
import jode.type.Type;
import jode.bytecode.ClassInfo; import jode.bytecode.ClassInfo;
import jode.bytecode.FieldInfo; import jode.bytecode.FieldInfo;
import jode.bytecode.MethodInfo; import jode.bytecode.MethodInfo;
@ -32,10 +33,11 @@ import jode.expr.ConstructorOperator;
import jode.flow.TransformConstructors; import jode.flow.TransformConstructors;
import jode.flow.StructuredBlock; import jode.flow.StructuredBlock;
import java.lang.reflect.Modifier;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import java.util.Vector; import java.util.Vector;
import java.util.Enumeration; import java.util.Enumeration;
import java.lang.reflect.Modifier; import java.io.IOException;
public class ClassAnalyzer public class ClassAnalyzer
implements Analyzer, Scope, Declarable, ClassDeclarer implements Analyzer, Scope, Declarable, ClassDeclarer
@ -256,7 +258,7 @@ public class ClassAnalyzer
fields[j] = new FieldAnalyzer(this, finfos[j], imports); fields[j] = new FieldAnalyzer(this, finfos[j], imports);
staticConstructor = null; staticConstructor = null;
java.util.Vector constrVector = new java.util.Vector(); Vector constrVector = new Vector();
for (int j=0; j < methods.length; j++) { for (int j=0; j < methods.length; j++) {
methods[j] = new MethodAnalyzer(this, minfos[j], imports); methods[j] = new MethodAnalyzer(this, minfos[j], imports);
@ -339,13 +341,12 @@ public class ClassAnalyzer
for (int j=0; j < methods.length; j++) for (int j=0; j < methods.length; j++)
methods[j].makeDeclaration(); methods[j].makeDeclaration();
} }
public void dumpDeclaration(TabbedPrintWriter writer) public void dumpDeclaration(TabbedPrintWriter writer) throws IOException
throws java.io.IOException
{ {
dumpSource(writer); dumpSource(writer);
} }
public void dumpBlock(TabbedPrintWriter writer) throws java.io.IOException public void dumpBlock(TabbedPrintWriter writer) throws IOException
{ {
writer.pushScope(this); writer.pushScope(this);
boolean needFieldNewLine = false; boolean needFieldNewLine = false;
@ -412,7 +413,7 @@ public class ClassAnalyzer
writer.popScope(); writer.popScope();
} }
public void dumpSource(TabbedPrintWriter writer) throws java.io.IOException public void dumpSource(TabbedPrintWriter writer) throws IOException
{ {
if (fields == null) { if (fields == null) {
/* This means that the class could not be loaded. /* This means that the class could not be loaded.
@ -469,8 +470,7 @@ public class ClassAnalyzer
writer.closeBrace(); writer.closeBrace();
} }
public void dumpJavaFile(TabbedPrintWriter writer) public void dumpJavaFile(TabbedPrintWriter writer) throws IOException {
throws java.io.IOException {
imports.init(clazz.getName()); imports.init(clazz.getName());
LocalInfo.init(); LocalInfo.init();
analyze(); analyze();

@ -18,8 +18,7 @@
*/ */
package jode.decompiler; package jode.decompiler;
import java.lang.reflect.Modifier; import jode.type.Type;
import jode.type.*;
import jode.bytecode.FieldInfo; import jode.bytecode.FieldInfo;
import jode.expr.Expression; import jode.expr.Expression;
import jode.expr.ThisOperator; import jode.expr.ThisOperator;
@ -27,6 +26,9 @@ import jode.expr.LocalLoadOperator;
import jode.expr.ConstOperator; import jode.expr.ConstOperator;
import jode.expr.OuterLocalOperator; import jode.expr.OuterLocalOperator;
import java.lang.reflect.Modifier;
import java.io.IOException;
public class FieldAnalyzer implements Analyzer { public class FieldAnalyzer implements Analyzer {
ClassAnalyzer clazz; ClassAnalyzer clazz;
ImportHandler imports; ImportHandler imports;
@ -144,8 +146,7 @@ public class FieldAnalyzer implements Analyzer {
return analyzedSynthetic; return analyzedSynthetic;
} }
public void dumpSource(TabbedPrintWriter writer) public void dumpSource(TabbedPrintWriter writer) throws IOException
throws java.io.IOException
{ {
if (isDeprecated) { if (isDeprecated) {
writer.println("/**"); writer.println("/**");

@ -21,7 +21,10 @@ package jode.decompiler;
import jode.GlobalOptions; import jode.GlobalOptions;
import jode.bytecode.ClassInfo; import jode.bytecode.ClassInfo;
import jode.bytecode.InnerClassInfo; import jode.bytecode.InnerClassInfo;
import jode.type.*; import jode.type.Type;
import jode.type.ArrayType;
import jode.type.ClassInterfacesType;
import jode.type.NullType;
///#ifdef JDK12 ///#ifdef JDK12
///import java.util.SortedMap; ///import java.util.SortedMap;

Loading…
Cancel
Save