summaryrefslogtreecommitdiff
path: root/enigma/src/main
diff options
context:
space:
mode:
authorGravatar AlexTMjugador2020-10-24 17:05:09 +0200
committerGravatar AlexTMjugador2020-10-24 17:17:04 +0200
commitc0892ab3b6ec67f85b813ab610356b8dfc6eba2f (patch)
treed9f5619698fb9a8f702228d37d7b55c9bc98c807 /enigma/src/main
parentMerge pull request #320 from YanisBft/deobfuscated-panel (diff)
downloadenigma-fork-c0892ab3b6ec67f85b813ab610356b8dfc6eba2f.tar.gz
enigma-fork-c0892ab3b6ec67f85b813ab610356b8dfc6eba2f.tar.xz
enigma-fork-c0892ab3b6ec67f85b813ab610356b8dfc6eba2f.zip
Do not abort decompile command on decompiler errors
As explained in PR #289, the decompilers may fail decompiling some vanilla Minecraft classes. Although it is my opinion that these errors should be fixed in the decompilers themselves, currently they render the decompile CLI command useless, as no output is produced whatsoever. The PR that was mentioned previously addressed this situation for the GUI part of Enigma, but not for the CLI commands, which were left untouched. These changes modify the decompiler error strategy used by the aforementioned CLI command to trace the errors, but continue decompiling classes, so at least a partial output is generated. This way users will be happy that the Enigma decompile command works, and developers will still be motivated to fix the underlying issues. Signed-off-by: AlexTMjugador <AlexTMjugador@users.noreply.github.com>
Diffstat (limited to 'enigma/src/main')
-rw-r--r--enigma/src/main/java/cuchaz/enigma/EnigmaProject.java4
1 files changed, 0 insertions, 4 deletions
diff --git a/enigma/src/main/java/cuchaz/enigma/EnigmaProject.java b/enigma/src/main/java/cuchaz/enigma/EnigmaProject.java
index f6420d2..fcd2c96 100644
--- a/enigma/src/main/java/cuchaz/enigma/EnigmaProject.java
+++ b/enigma/src/main/java/cuchaz/enigma/EnigmaProject.java
@@ -216,10 +216,6 @@ public class EnigmaProject {
216 } 216 }
217 } 217 }
218 218
219 public SourceExport decompile(ProgressListener progress, DecompilerService decompilerService) {
220 return this.decompile(progress, decompilerService, DecompileErrorStrategy.PROPAGATE);
221 }
222
223 public SourceExport decompile(ProgressListener progress, DecompilerService decompilerService, DecompileErrorStrategy errorStrategy) { 219 public SourceExport decompile(ProgressListener progress, DecompilerService decompilerService, DecompileErrorStrategy errorStrategy) {
224 List<ClassSource> decompiled = this.decompileStream(progress, decompilerService, errorStrategy).collect(Collectors.toList()); 220 List<ClassSource> decompiled = this.decompileStream(progress, decompilerService, errorStrategy).collect(Collectors.toList());
225 return new SourceExport(decompiled); 221 return new SourceExport(decompiled);