From fa4a253ee87c5db31f5f00f086cb4c353019d0f7 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 5 May 1999 20:47:02 +0000 Subject: [PATCH] don't decompile INNER/ANON classes separately use clazzAna.dumpJavaFile git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@756 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/Decompiler.java | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/jode/jode/Decompiler.java b/jode/jode/Decompiler.java index 6539473..3980eaa 100644 --- a/jode/jode/Decompiler.java +++ b/jode/jode/Decompiler.java @@ -20,6 +20,7 @@ package jode; import java.io.*; import jode.bytecode.ClassInfo; +import jode.bytecode.InnerClassInfo; import jode.decompiler.*; import java.util.zip.ZipOutputStream; import java.util.zip.ZipEntry; @@ -92,6 +93,18 @@ public class Decompiler { "use --debug=help for more information."); } + public static boolean skipClass(ClassInfo clazz) { + InnerClassInfo[] outers = clazz.getOuterClasses(); + if (outers != null) { + if (outers[0].outer == null) { + return ((Decompiler.options & Decompiler.OPTION_ANON) != 0); + } else { + return ((Decompiler.options & Decompiler.OPTION_INNER) != 0); + } + } + return false; + } + public static void main(String[] params) { int i; String classPath = System.getProperty("java.class.path"); @@ -204,6 +217,8 @@ public class Decompiler { ("`"+params[i]+"' is not a class name"); continue; } + if (skipClass(clazz)) + continue; String filename = params[i].replace('.', File.separatorChar)+".java"; @@ -222,14 +237,10 @@ public class Decompiler { imports); } - imports.init(params[i]); GlobalOptions.err.println(params[i]); ClassAnalyzer clazzAna = new ClassAnalyzer(clazz, imports); - clazzAna.analyze(); - - imports.dumpHeader(writer); - clazzAna.dumpSource(writer); + clazzAna.dumpJavaFile(writer); if (destZip != null) { writer.flush();