From 7126e915ca0a027b378d2abab46865fb0a835bcf Mon Sep 17 00:00:00 2001 From: gegy1000 Date: Thu, 24 Jan 2019 21:28:45 +0200 Subject: Fix navigation to inner classes not decompiling outer class --- src/main/java/cuchaz/enigma/gui/GuiController.java | 2 +- .../cuchaz/enigma/translation/representation/entry/ClassEntry.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/cuchaz/enigma/gui/GuiController.java b/src/main/java/cuchaz/enigma/gui/GuiController.java index 06cb33e..fd9e7f0 100644 --- a/src/main/java/cuchaz/enigma/gui/GuiController.java +++ b/src/main/java/cuchaz/enigma/gui/GuiController.java @@ -332,7 +332,7 @@ public class GuiController { new Thread(() -> { // decompile,deobfuscate the bytecode - CompilationUnit sourceTree = deobfuscator.getSourceTree(classEntry.getFullName()); + CompilationUnit sourceTree = deobfuscator.getSourceTree(classEntry.getOutermostClass().getFullName()); if (sourceTree == null) { // decompilation of this class is not supported gui.setSource("Unable to find class: " + classEntry); diff --git a/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java b/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java index 52ec3e2..5904efe 100644 --- a/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java +++ b/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java @@ -125,6 +125,13 @@ public class ClassEntry extends ParentedEntry implements Comparable< return parent; } + public ClassEntry getOutermostClass() { + if (parent == null) { + return this; + } + return parent.getOutermostClass(); + } + public ClassEntry buildClassEntry(List classChain) { assert (classChain.contains(this)); StringBuilder buf = new StringBuilder(); -- cgit v1.2.3