2222import the .bytecode .club .jda .JDA ;
2323import the .bytecode .club .jda .JarUtils ;
2424import the .bytecode .club .jda .settings .DecompilerSettings ;
25+ import the .bytecode .club .jda .settings .Setting ;
2526
2627import java .io .File ;
2728import java .io .IOException ;
3738public final class CFRDecompiler extends Decompiler {
3839
3940 public CFRDecompiler () {
40- for (Settings setting : Settings .values ()) {
41- settings .registerSetting (setting );
42- }
41+ // for (Settings setting : Settings.values()) {
42+ // settings.registerSetting(setting);
43+ // }
4344 }
4445
4546 @ Override
@@ -98,14 +99,15 @@ public void decompileToZip(String zipName) {
9899 }
99100
100101 public String [] generateMainMethod () {
101- String [] result = new String [getSettings ().size () * 2 + 1 ];
102- result [0 ] = "bytecodeviewer" ;
103- int index = 1 ;
104- for (Settings setting : Settings .values ()) {
105- result [index ++] = "--" + setting .getParam ();
106- result [index ++] = String .valueOf (getSettings ().getBoolean (setting ));
107- }
108- return result ;
102+ // String[] result = new String[getSettings().size() * 2 + 1];
103+ // result[0] = "bytecodeviewer";
104+ // int index = 1;
105+ // for (Settings setting : Settings.values()) {
106+ // result[index++] = "--" + setting.getParam();
107+ // result[index++] = String.valueOf(getSettings().getBoolean(setting));
108+ // }
109+ // return result;
110+ return new String [0 ];
109111 }
110112
111113 public static String doClass (DCCommonState dcCommonState , byte [] content1 ) throws Exception {
@@ -192,51 +194,52 @@ public static void doJar(DCCommonState dcCommonState, Path input, Path output) t
192194 }
193195
194196 // TODO: Rewrite!
195- public enum Settings implements DecompilerSettings .SettingsEntry {
196- DECODE_ENUM_SWITCH ("decodeenumswitch" , "Decode Enum Switch" , true ),
197- SUGAR_ENUMS ("sugarenums" , "SugarEnums" , true ),
198- DECODE_STRING_SWITCH ("decodestringswitch" , "Decode String Switch" , true ),
199- ARRAYITER ("arrayiter" , "Arrayiter" , true ),
200- COLLECTIONITER ("collectioniter" , "Collectioniter" , true ),
201- INNER_CLASSES ("innerclasses" , "Inner Classes" , true ),
202- REMOVE_BOILER_PLATE ("removeboilerplate" , "Remove Boiler Plate" , true ),
203- REMOVE_INNER_CLASS_SYNTHETICS ("removeinnerclasssynthetics" , "Remove Inner Class Synthetics" , true ),
204- DECODE_LAMBDAS ("decodelambdas" , "Decode Lambdas" , true ),
205- HIDE_BRIDGE_METHODS ("hidebridgemethods" , "Hide Bridge Methods" , true ),
206- LIFT_CONSTRUCTOR_INIT ("liftconstructorinit" , "Lift Constructor Init" , true ),
207- REMOVE_DEAD_METHODS ("removedeadmethods" , "Remove Dead Methods" , true ),
208- REMOVE_BAD_GENERICS ("removebadgenerics" , "Remove Bad Generics" , true ),
209- SUGAR_ASSERTS ("sugarasserts" , "Sugar Asserts" , true ),
210- SUGAR_BOXING ("sugarboxing" , "Sugar Boxing" , true ),
211- SHOW_VERSION ("showversion" , "Show Version" , true ),
212- DECODE_FINALLY ("decodefinally" , "Decode Finally" , true ),
213- TIDY_MONITORS ("tidymonitors" , "Tidy Monitors" , true ),
214- LENIENT ("lenient" , "Lenient" ),
215- DUMP_CLASS_PATH ("dumpclasspath" , "Dump Classpath" ),
216- COMMENTS ("comments" , "Comments" , true ),
217- FORCE_TOP_SORT ("forcetopsort" , "Force Top Sort" , true ),
218- FORCE_TOP_SORT_AGGRESSIVE ("forcetopsortaggress" , "Force Top Sort Aggressive" , true ),
219- STRINGBUFFER ("stringbuffer" , "StringBuffer" ),
220- STRINGBUILDER ("stringbuilder" , "StringBuilder" , true ),
221- SILENT ("silent" , "Silent" , true ),
222- RECOVER ("recover" , "Recover" , true ),
223- ECLIPSE ("eclipse" , "Eclipse" , true ),
224- OVERRIDE ("override" , "Override" , true ),
225- SHOW_INFERRABLE ("showinferrable" , "Show Inferrable" , true ),
226- FORCE_AGGRESSIVE_EXCEPTION_AGG ("aexagg" , "Force Aggressive Exception Aggregation" , true ),
227- FORCE_COND_PROPAGATE ("forcecondpropagate" , "Force Conditional Propogation" , true ),
228- HIDE_UTF ("hideutf" , "Hide UTF" , true ),
229- HIDE_LONG_STRINGS ("hidelongstrings" , "Hide Long Strings" ),
230- COMMENT_MONITORS ("commentmonitors" , "Comment Monitors" ),
231- ALLOW_CORRECTING ("allowcorrecting" , "Allow Correcting" , true ),
232- LABELLED_BLOCKS ("labelledblocks" , "Labelled Blocks" , true ),
233- J14_CLASS_OBJ ("j14classobj" , "Java 1.4 Class Objects" ),
234- HIDE_LANG_IMPORTS ("hidelangimports" , "Hide Lang Imports" , true ),
235- RECOVER_TYPE_CLASH ("recovertypeclash" , "Recover Type Clash" , true ),
236- RECOVER_TYPE_HINTS ("recovertypehints" , "Recover Type Hints" , true ),
237- FORCE_RETURNING_IFS ("forcereturningifs" , "Force Returning Ifs" , true ),
238- FOR_LOOP_AGG_CAPTURE ("forloopaggcapture" , "For Loop Aggressive Capture" , true );
239-
197+ public enum Settings {
198+ ;
199+ // DECODE_ENUM_SWITCH("decodeenumswitch", "Decode Enum Switch", true),
200+ // SUGAR_ENUMS("sugarenums", "SugarEnums", true),
201+ // DECODE_STRING_SWITCH("decodestringswitch", "Decode String Switch", true),
202+ // ARRAYITER("arrayiter", "Arrayiter", true),
203+ // COLLECTIONITER("collectioniter", "Collectioniter", true),
204+ // INNER_CLASSES("innerclasses", "Inner Classes", true),
205+ // REMOVE_BOILER_PLATE("removeboilerplate", "Remove Boiler Plate", true),
206+ // REMOVE_INNER_CLASS_SYNTHETICS("removeinnerclasssynthetics", "Remove Inner Class Synthetics", true),
207+ // DECODE_LAMBDAS("decodelambdas", "Decode Lambdas", true),
208+ // HIDE_BRIDGE_METHODS("hidebridgemethods", "Hide Bridge Methods", true),
209+ // LIFT_CONSTRUCTOR_INIT("liftconstructorinit", "Lift Constructor Init", true),
210+ // REMOVE_DEAD_METHODS("removedeadmethods", "Remove Dead Methods", true),
211+ // REMOVE_BAD_GENERICS("removebadgenerics", "Remove Bad Generics", true),
212+ // SUGAR_ASSERTS("sugarasserts", "Sugar Asserts", true),
213+ // SUGAR_BOXING("sugarboxing", "Sugar Boxing", true),
214+ // SHOW_VERSION("showversion", "Show Version", true),
215+ // DECODE_FINALLY("decodefinally", "Decode Finally", true),
216+ // TIDY_MONITORS("tidymonitors", "Tidy Monitors", true),
217+ // LENIENT("lenient", "Lenient"),
218+ // DUMP_CLASS_PATH("dumpclasspath", "Dump Classpath"),
219+ // COMMENTS("comments", "Comments", true),
220+ // FORCE_TOP_SORT("forcetopsort", "Force Top Sort", true),
221+ // FORCE_TOP_SORT_AGGRESSIVE("forcetopsortaggress", "Force Top Sort Aggressive", true),
222+ // STRINGBUFFER("stringbuffer", "StringBuffer"),
223+ // STRINGBUILDER("stringbuilder", "StringBuilder", true),
224+ // SILENT("silent", "Silent", true),
225+ // RECOVER("recover", "Recover", true),
226+ // ECLIPSE("eclipse", "Eclipse", true),
227+ // OVERRIDE("override", "Override", true),
228+ // SHOW_INFERRABLE("showinferrable", "Show Inferrable", true),
229+ // FORCE_AGGRESSIVE_EXCEPTION_AGG("aexagg", "Force Aggressive Exception Aggregation", true),
230+ // FORCE_COND_PROPAGATE("forcecondpropagate", "Force Conditional Propogation", true),
231+ // HIDE_UTF("hideutf", "Hide UTF", true),
232+ // HIDE_LONG_STRINGS("hidelongstrings", "Hide Long Strings"),
233+ // COMMENT_MONITORS("commentmonitors", "Comment Monitors"),
234+ // ALLOW_CORRECTING("allowcorrecting", "Allow Correcting", true),
235+ // LABELLED_BLOCKS("labelledblocks", "Labelled Blocks", true),
236+ // J14_CLASS_OBJ("j14classobj", "Java 1.4 Class Objects"),
237+ // HIDE_LANG_IMPORTS("hidelangimports", "Hide Lang Imports", true),
238+ // RECOVER_TYPE_CLASH("recovertypeclash", "Recover Type Clash", true),
239+ // RECOVER_TYPE_HINTS("recovertypehints", "Recover Type Hints", true),
240+ // FORCE_RETURNING_IFS("forcereturningifs", "Force Returning Ifs", true),
241+ // FOR_LOOP_AGG_CAPTURE("forloopaggcapture", "For Loop Aggressive Capture", true);
242+ //
240243 private String name ;
241244 private String param ;
242245 private boolean on ;
@@ -263,8 +266,8 @@ public String getDefaultValue() {
263266 return String .valueOf (on );
264267 }
265268
266- public SettingType getType () {
267- return SettingType .BOOLEAN ;
269+ public Setting . SettingType getType () {
270+ return Setting . SettingType .BOOLEAN ;
268271 }
269272 }
270273}
0 commit comments