From 9a30e1e896cf2ea1adea4a166e551804ad8fc285 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 3 Jul 2014 17:08:03 +0200 Subject: [PATCH] java: decompiler logging --- .../jetbrains/java/decompiler/IdeaDecompiler.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/java-decompiler/src/org/jetbrains/java/decompiler/IdeaDecompiler.java b/plugins/java-decompiler/src/org/jetbrains/java/decompiler/IdeaDecompiler.java index d3d9ad76df3b..bf0454fd6670 100644 --- a/plugins/java-decompiler/src/org/jetbrains/java/decompiler/IdeaDecompiler.java +++ b/plugins/java-decompiler/src/org/jetbrains/java/decompiler/IdeaDecompiler.java @@ -48,6 +48,8 @@ import java.util.Map; import java.util.jar.Manifest; public class IdeaDecompiler extends ClassFileDecompilers.Light { + private static final Logger LOG = Logger.getInstance(IdeaDecompiler.class); + private static final String BANNER = "//\n" + "// Source code recreated from a .class file by IntelliJ IDEA\n" + @@ -104,13 +106,14 @@ public class IdeaDecompiler extends ClassFileDecompilers.Light { return BANNER + saver.myResult; } catch (Exception e) { - Logger.getInstance(IdeaDecompiler.class).error(file.getPath(), e); + LOG.error(file.getUrl(), e); return ClsFileImpl.decompile(file); } } private static boolean canHandle(VirtualFile file) { if ("package-info.class".equals(file.getName())) { + LOG.info("skipped: " + file.getUrl()); return false; } @@ -136,7 +139,12 @@ public class IdeaDecompiler extends ClassFileDecompilers.Light { }, ClassReader.SKIP_CODE); } catch (IOException ignore) { } - return !isGroovy.get(); + if (isGroovy.get()) { + LOG.info("skipped Groovy class: " + file.getUrl()); + return false; + } + + return true; } private static class MyByteCodeProvider implements IBytecodeProvider {