summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar gegy10002019-01-24 21:28:45 +0200
committerGravatar gegy10002019-01-24 21:28:45 +0200
commit7126e915ca0a027b378d2abab46865fb0a835bcf (patch)
treead76d171d0241d43a50dff24cce437f496dfccdf /src
parentFix package name on inner classes (#101) (diff)
downloadenigma-7126e915ca0a027b378d2abab46865fb0a835bcf.tar.gz
enigma-7126e915ca0a027b378d2abab46865fb0a835bcf.tar.xz
enigma-7126e915ca0a027b378d2abab46865fb0a835bcf.zip
Fix navigation to inner classes not decompiling outer class
Diffstat (limited to 'src')
-rw-r--r--src/main/java/cuchaz/enigma/gui/GuiController.java2
-rw-r--r--src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/GuiController.java b/src/main/java/cuchaz/enigma/gui/GuiController.java
index 06cb33e3..fd9e7f0c 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 {
332 new Thread(() -> 332 new Thread(() ->
333 { 333 {
334 // decompile,deobfuscate the bytecode 334 // decompile,deobfuscate the bytecode
335 CompilationUnit sourceTree = deobfuscator.getSourceTree(classEntry.getFullName()); 335 CompilationUnit sourceTree = deobfuscator.getSourceTree(classEntry.getOutermostClass().getFullName());
336 if (sourceTree == null) { 336 if (sourceTree == null) {
337 // decompilation of this class is not supported 337 // decompilation of this class is not supported
338 gui.setSource("Unable to find class: " + classEntry); 338 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 52ec3e2b..5904efe6 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<ClassEntry> implements Comparable<
125 return parent; 125 return parent;
126 } 126 }
127 127
128 public ClassEntry getOutermostClass() {
129 if (parent == null) {
130 return this;
131 }
132 return parent.getOutermostClass();
133 }
134
128 public ClassEntry buildClassEntry(List<ClassEntry> classChain) { 135 public ClassEntry buildClassEntry(List<ClassEntry> classChain) {
129 assert (classChain.contains(this)); 136 assert (classChain.contains(this));
130 StringBuilder buf = new StringBuilder(); 137 StringBuilder buf = new StringBuilder();