java-decompiler: post-import cleanup (code style issues)

This commit is contained in:
Roman Shevchenko
2014-08-29 14:31:45 +04:00
parent 076e4393f2
commit 84ea54eb1e
72 changed files with 567 additions and 600 deletions

View File

@@ -225,7 +225,7 @@ public class ClassReference14Processor {
boolean res = false;
for (; ; ) {
while (true) {
boolean found = false;

View File

@@ -159,7 +159,6 @@ public class ClassWriter {
boolean firstpar = true;
int index = node.lambda_information.is_content_method_static ? 0 : 1;
;
int start_index = md_content.params.length - md_lambda.params.length;
@@ -625,7 +624,6 @@ public class ClassWriter {
boolean firstpar = true;
int index = node_lambda.lambda_information.is_content_method_static ? 0 : 1;
;
int start_index = md_content.params.length - md_lambda.params.length;

View File

@@ -39,12 +39,9 @@ public class Fernflower implements IDecompiledData {
private ClassesProcessor clprocessor;
public Fernflower(IBytecodeProvider provider, IDecompilatSaver saver,
HashMap<String, Object> propertiesCustom) {
public Fernflower(IBytecodeProvider provider, IDecompilatSaver saver, HashMap<String, Object> propertiesCustom) {
StructContext context = new StructContext(saver, this, new LazyLoader(provider));
structcontext = context;
structcontext = new StructContext(saver, this, new LazyLoader(provider));
DecompilerContext.initContext(propertiesCustom);
DecompilerContext.setCountercontainer(new CounterContainer());

View File

@@ -191,7 +191,7 @@ public class InitializerProcessor {
return;
}
for (; ; ) {
while (true) {
String fieldWithDescr = null;
Exprent value = null;

View File

@@ -31,7 +31,7 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;
@SuppressWarnings({"UseOfSystemOutOrSystemErr", "CallToPrintStackTrace"})
public class ConsoleDecompiler implements IBytecodeProvider, IDecompilatSaver {
private File root;

View File

@@ -19,5 +19,5 @@ import java.io.InputStream;
public interface IBytecodeProvider {
public InputStream getBytecodeStream(String externPath, String internPath);
InputStream getBytecodeStream(String externPath, String internPath);
}

View File

@@ -19,21 +19,21 @@ import java.util.jar.Manifest;
public interface IDecompilatSaver {
public void copyFile(String source, String destpath, String destfilename);
void copyFile(String source, String destpath, String destfilename);
public void saveFolder(String path);
void saveFolder(String path);
public void saveClassFile(String path, String qualifiedName, String entryName, String content);
void saveClassFile(String path, String qualifiedName, String entryName, String content);
public void saveFile(String path, String filename, String content);
void saveFile(String path, String filename, String content);
public void createArchive(String path, String archivename, Manifest manifest);
void createArchive(String path, String archivename, Manifest manifest);
public void saveClassEntry(String path, String archivename, String qualifiedName, String entryName, String content);
void saveClassEntry(String path, String archivename, String qualifiedName, String entryName, String content);
public void saveEntry(String path, String archivename, String entryName, String content);
void saveEntry(String path, String archivename, String entryName, String content);
public void copyEntry(String source, String destpath, String archivename, String entry);
void copyEntry(String source, String destpath, String archivename, String entry);
public void closeArchive(String path, String archivename);
void closeArchive(String path, String archivename);
}

View File

@@ -19,13 +19,13 @@ import java.util.HashMap;
public interface IFernflowerLogger {
public static final int TRACE = 1;
public static final int INFO = 2;
public static final int WARNING = 3;
public static final int ERROR = 4;
public static final int IMMEDIATE = 5;
int TRACE = 1;
int INFO = 2;
int WARNING = 3;
int ERROR = 4;
int IMMEDIATE = 5;
public static final HashMap<String, Integer> mapLogLevel = new HashMap<String, Integer>() {{
HashMap<String, Integer> mapLogLevel = new HashMap<String, Integer>() {{
put("TRACE", 1);
put("INFO", 2);
put("WARN", 3);
@@ -33,25 +33,25 @@ public interface IFernflowerLogger {
put("IMME", 5);
}};
public static final String[] names = new String[]{""/*DUMMY ENTRY*/, "TRACE", "INFO", "WARNING", "ERROR", ""/*IMMEDIATE*/};
String[] names = new String[]{""/*DUMMY ENTRY*/, "TRACE", "INFO", "WARNING", "ERROR", ""/*IMMEDIATE*/};
public void writeMessage(String message, int severity);
void writeMessage(String message, int severity);
public void writeMessage(String message, Throwable t);
void writeMessage(String message, Throwable t);
public void startClass(String classname);
void startClass(String classname);
public void endClass();
void endClass();
public void startWriteClass(String classname);
void startWriteClass(String classname);
public void endWriteClass();
void endWriteClass();
public void startMethod(String method);
void startMethod(String method);
public void endMethod();
void endMethod();
public int getSeverity();
int getSeverity();
public void setSeverity(int severity);
void setSeverity(int severity);
}

View File

@@ -17,42 +17,42 @@ package org.jetbrains.java.decompiler.main.extern;
public interface IFernflowerPreferences {
public static final String REMOVE_BRIDGE = "rbr";
public static final String REMOVE_SYNTHETIC = "rsy";
public static final String DECOMPILE_INNER = "din";
public static final String DECOMPILE_CLASS_1_4 = "dc4";
public static final String DECOMPILE_ASSERTIONS = "das";
public static final String HIDE_EMPTY_SUPER = "hes";
public static final String HIDE_DEFAULT_CONSTRUCTOR = "hdc";
public static final String DECOMPILE_GENERIC_SIGNATURES = "dgs";
public static final String OUTPUT_COPYRIGHT_COMMENT = "occ";
public static final String NO_EXCEPTIONS_RETURN = "ner";
public static final String DECOMPILE_ENUM = "den";
public static final String REMOVE_GETCLASS_NEW = "rgn";
public static final String LITERALS_AS_IS = "lit";
public static final String BOOLEAN_TRUE_ONE = "bto";
public static final String SYNTHETIC_NOT_SET = "nns";
public static final String UNDEFINED_PARAM_TYPE_OBJECT = "uto";
public static final String USE_DEBUG_VARNAMES = "udv";
public static final String MAX_PROCESSING_METHOD = "mpm";
public static final String REMOVE_EMPTY_RANGES = "rer";
public static final String ASCII_STRING_CHARACTERS = "asc";
String REMOVE_BRIDGE = "rbr";
String REMOVE_SYNTHETIC = "rsy";
String DECOMPILE_INNER = "din";
String DECOMPILE_CLASS_1_4 = "dc4";
String DECOMPILE_ASSERTIONS = "das";
String HIDE_EMPTY_SUPER = "hes";
String HIDE_DEFAULT_CONSTRUCTOR = "hdc";
String DECOMPILE_GENERIC_SIGNATURES = "dgs";
String OUTPUT_COPYRIGHT_COMMENT = "occ";
String NO_EXCEPTIONS_RETURN = "ner";
String DECOMPILE_ENUM = "den";
String REMOVE_GETCLASS_NEW = "rgn";
String LITERALS_AS_IS = "lit";
String BOOLEAN_TRUE_ONE = "bto";
String SYNTHETIC_NOT_SET = "nns";
String UNDEFINED_PARAM_TYPE_OBJECT = "uto";
String USE_DEBUG_VARNAMES = "udv";
String MAX_PROCESSING_METHOD = "mpm";
String REMOVE_EMPTY_RANGES = "rer";
String ASCII_STRING_CHARACTERS = "asc";
public static final String FINALLY_DEINLINE = "fdi";
String FINALLY_DEINLINE = "fdi";
public static final String FINALLY_CATCHALL = "FINALLY_CATCHALL";
public static final String FINALLY_SEMAPHOR = "FINALLY_SEMAPHOR";
String FINALLY_CATCHALL = "FINALLY_CATCHALL";
String FINALLY_SEMAPHOR = "FINALLY_SEMAPHOR";
public static final String RENAME_ENTITIES = "ren";
public static final String USER_RENAMER_CLASS = "urc";
String RENAME_ENTITIES = "ren";
String USER_RENAMER_CLASS = "urc";
public static final String LOG_LEVEL = "log";
String LOG_LEVEL = "log";
public static final String NEW_LINE_SEPARATOR = "nls";
public static final String IDEA_NOT_NULL_ANNOTATION = "inn";
public static final String LAMBDA_TO_ANONYMOUS_CLASS = "lac";
public static final String INDENT_STRING = "ind";
String NEW_LINE_SEPARATOR = "nls";
String IDEA_NOT_NULL_ANNOTATION = "inn";
String LAMBDA_TO_ANONYMOUS_CLASS = "lac";
String INDENT_STRING = "ind";
public static final String LINE_SEPARATOR_WIN = "\r\n";
public static final String LINE_SEPARATOR_LIN = "\n";
String LINE_SEPARATOR_WIN = "\r\n";
String LINE_SEPARATOR_LIN = "\n";
}

View File

@@ -18,18 +18,18 @@ package org.jetbrains.java.decompiler.main.extern;
public interface IIdentifierRenamer {
public static final int ELEMENT_CLASS = 1;
int ELEMENT_CLASS = 1;
public static final int ELEMENT_FIELD = 2;
int ELEMENT_FIELD = 2;
public static final int ELEMENT_METHOD = 3;
int ELEMENT_METHOD = 3;
public boolean toBeRenamed(int element_type, String classname, String element, String descriptor);
boolean toBeRenamed(int element_type, String classname, String element, String descriptor);
public String getNextClassname(String fullname, String shortname);
String getNextClassname(String fullname, String shortname);
public String getNextFieldname(String classname, String field, String descriptor);
String getNextFieldname(String classname, String field, String descriptor);
public String getNextMethodname(String classname, String method, String descriptor);
String getNextMethodname(String classname, String method, String descriptor);
}

View File

@@ -62,9 +62,7 @@ public class MethodProcessorThread implements Runnable {
this.notify();
}
}
catch (ThreadDeath ex) {
;
}
catch (ThreadDeath ignored) { }
catch (Throwable ex) {
error = ex;
}
@@ -169,7 +167,7 @@ public class MethodProcessorThread implements Runnable {
//System.out.println("~~~~~~~~~~~~~~~~~~~~~~ \r\n"+root.toJava());
for (; ; ) {
while (true) {
StackVarsProcessor stackproc = new StackVarsProcessor();
stackproc.simplifyStackVars(root, mt, cl);
@@ -184,11 +182,11 @@ public class MethodProcessorThread implements Runnable {
}
}
for (; ; ) {
while (true) {
LabelHelper.cleanUpEdges(root);
for (; ; ) {
while (true) {
MergeHelper.enhanceLoops(root);

View File

@@ -151,7 +151,6 @@ public class NestedClassProcessor {
InvocationExprent inv_dynamic = new_expr.getConstructor();
int param_index = is_static_lambda_content ? 0 : 1;
;
int varindex = is_static_lambda_content ? 0 : 1;
for (int i = 0; i < vars_count; ++i) {
@@ -713,7 +712,7 @@ public class NestedClassProcessor {
private void mergeListSignatures(List<VarFieldPair> first, List<VarFieldPair> second, boolean both) {
int i = 1;
for (; ; ) {
while (true) {
if (first.size() <= i || second.size() <= i) {
break;
}

View File

@@ -286,7 +286,7 @@ public class NestedMemberAccess {
res |= replaceInvocations(caller, meth, expr);
}
for (; ; ) {
while (true) {
boolean found = false;
@@ -397,10 +397,10 @@ public class NestedMemberAccess {
AssignmentExprent ret;
if (source.type == Exprent.EXPRENT_EXIT) {
ExitExprent extex = (ExitExprent)source;
ret = (AssignmentExprent)((AssignmentExprent)extex.getValue()).copy();
ret = (AssignmentExprent)extex.getValue().copy();
}
else {
ret = (AssignmentExprent)((AssignmentExprent)source).copy();
ret = (AssignmentExprent)source.copy();
}
FieldExprent fexpr = (FieldExprent)ret.getLeft();