summaryrefslogtreecommitdiffstats
path: root/src/org/jetbrains/java/decompiler/modules
diff options
context:
space:
mode:
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-08-29 14:31:45 +0400
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-08-29 14:57:29 +0400
commit84ea54eb1e2c68091080951a3024cca98f70aca2 (patch)
tree323218d81ced0fd327fa3701ec9f7f1e407855f8 /src/org/jetbrains/java/decompiler/modules
parent076e4393f25bf1ad1ff1bd2853153e2b595dd90b (diff)
downloadfernflower-84ea54eb1e2c68091080951a3024cca98f70aca2.tar
fernflower-84ea54eb1e2c68091080951a3024cca98f70aca2.tar.gz
fernflower-84ea54eb1e2c68091080951a3024cca98f70aca2.tar.lz
fernflower-84ea54eb1e2c68091080951a3024cca98f70aca2.tar.xz
fernflower-84ea54eb1e2c68091080951a3024cca98f70aca2.zip
java-decompiler: post-import cleanup (code style issues)
Diffstat (limited to 'src/org/jetbrains/java/decompiler/modules')
-rw-r--r--src/org/jetbrains/java/decompiler/modules/code/DeadCodeHelper.java14
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/ConcatenationHelper.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/DecHelper.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/DomHelper.java6
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/ExitHelper.java6
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java8
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/ExprentStack.java4
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java6
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/IdeaNotNullHelper.java6
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/IfHelper.java11
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/InlineSingleBlockHelper.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java4
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/LoopExtractHelper.java4
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/LowBreakHelper.java6
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/MergeHelper.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/SequenceHelper.java6
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java8
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/StackVarsProcessor.java6
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java4
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraph.java4
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraphNode.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/IrreducibleCFGDeobfuscator.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/exps/Exprent.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java5
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/exps/VarExprent.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/sforms/DirectGraph.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java4
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/stats/SequenceStatement.java4
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java18
-rw-r--r--src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java2
-rw-r--r--src/org/jetbrains/java/decompiler/modules/renamer/IdentifierConverter.java2
35 files changed, 75 insertions, 89 deletions
diff --git a/src/org/jetbrains/java/decompiler/modules/code/DeadCodeHelper.java b/src/org/jetbrains/java/decompiler/modules/code/DeadCodeHelper.java
index 386f6ae..e8377ae 100644
--- a/src/org/jetbrains/java/decompiler/modules/code/DeadCodeHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/code/DeadCodeHelper.java
@@ -70,7 +70,7 @@ public class DeadCodeHelper {
cont = false;
for (int i = blocks.size() - 1; i >= 0; i--) {
- BasicBlock block = (BasicBlock)blocks.get(i);
+ BasicBlock block = blocks.get(i);
if (removeEmptyBlock(graph, block, false)) {
cont = true;
@@ -197,7 +197,7 @@ public class DeadCodeHelper {
graph.removeBlock(block);
if (deletedRanges) {
- DeadCodeHelper.removeDeadBlocks(graph);
+ removeDeadBlocks(graph);
}
}
}
@@ -219,7 +219,7 @@ public class DeadCodeHelper {
while (!lstNodes.isEmpty()) {
- BasicBlock node = (BasicBlock)lstNodes.remove(0);
+ BasicBlock node = lstNodes.remove(0);
if (marked.contains(node)) {
continue;
}
@@ -232,14 +232,14 @@ public class DeadCodeHelper {
}
for (int i = 0; i < node.getPreds().size(); i++) {
- BasicBlock pred = (BasicBlock)node.getPreds().get(i);
+ BasicBlock pred = node.getPreds().get(i);
if (!marked.contains(pred) && pred != dom) {
lstNodes.add(pred);
}
}
for (int i = 0; i < node.getPredExceptions().size(); i++) {
- BasicBlock pred = (BasicBlock)node.getPredExceptions().get(i);
+ BasicBlock pred = node.getPredExceptions().get(i);
if (!marked.contains(pred) && pred != dom) {
lstNodes.add(pred);
}
@@ -259,7 +259,7 @@ public class DeadCodeHelper {
}
}
- DeadCodeHelper.removeEmptyBlocks(graph);
+ removeEmptyBlocks(graph);
}
public static void connectDummyExitBlock(ControlFlowGraph graph) {
@@ -392,7 +392,7 @@ public class DeadCodeHelper {
public static void mergeBasicBlocks(ControlFlowGraph graph) {
- for (; ; ) {
+ while (true) {
boolean merged = false;
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/ConcatenationHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/ConcatenationHelper.java
index db67902..1b641a6 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/ConcatenationHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/ConcatenationHelper.java
@@ -62,7 +62,7 @@ public class ConcatenationHelper {
// iterate in depth, collecting possible operands
List<Exprent> lstOperands = new ArrayList<Exprent>();
- for (; ; ) {
+ while (true) {
int found = 0;
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/DecHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/DecHelper.java
index ec1fada..50b6673 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/DecHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/DecHelper.java
@@ -76,7 +76,7 @@ public class DecHelper {
return false;
}
- for (; ; ) {
+ while (true) {
lst.clear();
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/DomHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/DomHelper.java
index 79bea88..2b911e7 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/DomHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/DomHelper.java
@@ -254,7 +254,7 @@ public class DomHelper {
if (stat.type == Statement.TYPE_SEQUENCE) {
- for (; ; ) {
+ while (true) {
boolean found = false;
@@ -371,7 +371,7 @@ public class DomHelper {
boolean forceall = i != 0;
- for (; ; ) {
+ while (true) {
if (findSimpleStatements(general, mapExtPost)) {
reducibility = 0;
@@ -494,7 +494,7 @@ public class DomHelper {
// collect statement nodes
HashSet<Statement> setHandlers = new HashSet<Statement>();
setHandlers.add(head);
- for (; ; ) {
+ while (true) {
boolean hdfound = false;
Iterator<Statement> itHandlers = setHandlers.iterator();
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/ExitHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/ExitHelper.java
index cddbc21..2eddd57 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/ExitHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/ExitHelper.java
@@ -91,7 +91,7 @@ public class ExitHelper {
if (stat.getExprents() == null) {
- for (; ; ) {
+ while (true) {
int changed = 0;
@@ -160,7 +160,7 @@ public class ExitHelper {
bstat.addSuccessor(newexitedge);
oldexitedge.closure.addLabeledEdge(newexitedge);
- SequenceStatement block = new SequenceStatement(Arrays.asList(new Statement[]{stat, bstat}));
+ SequenceStatement block = new SequenceStatement(Arrays.asList(stat, bstat));
block.setAllParent();
parent.replaceStatement(stat, block);
@@ -324,7 +324,7 @@ public class ExitHelper {
bstat.setExprents(new ArrayList<Exprent>(Arrays.asList(new Exprent[]{retexpr})));
// build sequence to replace the former top statement
- SequenceStatement seq = new SequenceStatement(Arrays.asList(new Statement[]{top, bstat}));
+ SequenceStatement seq = new SequenceStatement(Arrays.asList(top, bstat));
top.setParent(seq);
bstat.setParent(seq);
seq.setParent(root);
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java
index 3b35d36..1612d32 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java
@@ -706,7 +706,7 @@ public class ExprProcessor implements CodeConstants {
return "void";
}
else if (tp == CodeConstants.TYPE_OBJECT) {
- String ret = ExprProcessor.buildJavaClassName(type.value);
+ String ret = buildJavaClassName(type.value);
if (getShort) {
ret = DecompilerContext.getImpcollector().getShortName(ret);
}
@@ -761,7 +761,7 @@ public class ExprProcessor implements CodeConstants {
List<StatEdge> lstSuccs = stat.getSuccessorEdges(Statement.STATEDGE_DIRECT_ALL);
if (lstSuccs.size() == 1) {
StatEdge edge = lstSuccs.get(0);
- if (edge.getType() != StatEdge.TYPE_REGULAR && edge.explicit == true && edge.getDestination().type != Statement.TYPE_DUMMYEXIT) {
+ if (edge.getType() != StatEdge.TYPE_REGULAR && edge.explicit && edge.getDestination().type != Statement.TYPE_DUMMYEXIT) {
buf.append(InterpreterUtil.getIndentString(indent));
switch (edge.getType()) {
@@ -820,7 +820,7 @@ public class ExprProcessor implements CodeConstants {
if (expr.type == Exprent.EXPRENT_MONITOR && ((MonitorExprent)expr).getMontype() == MonitorExprent.MONITOR_ENTER) {
buf.append("{}"); // empty synchronized block
}
- if (ExprProcessor.endsWithSemikolon(expr)) {
+ if (endsWithSemikolon(expr)) {
buf.append(";");
}
buf.append(new_line_separator);
@@ -885,7 +885,7 @@ public class ExprProcessor implements CodeConstants {
res = "(" + res + ")";
}
- res = "(" + ExprProcessor.getCastTypeName(leftType) + ")" + res;
+ res = "(" + getCastTypeName(leftType) + ")" + res;
ret = true;
}
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprentStack.java b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprentStack.java
index dafc655..c4cded2 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprentStack.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprentStack.java
@@ -36,9 +36,7 @@ public class ExprentStack extends ListStack<Exprent> {
public Exprent pop() {
- Exprent o = this.remove(--pointer);
-
- return o;
+ return this.remove(--pointer);
}
public ExprentStack clone() {
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java
index a56c0f2..103b933 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java
@@ -81,7 +81,7 @@ public class FinallyProcessor {
BasicBlock handler = fin.getHandler().getBasichead().getBlock();
if (catchallBlockIDs.containsKey(handler.id)) {
- ; // do nothing
+ // do nothing
}
else if (finallyBlockIDs.containsKey(handler.id)) {
@@ -465,8 +465,6 @@ public class FinallyProcessor {
range.getProtectedRange().remove(newheadinit);
}
}
-
- return;
}
@@ -677,7 +675,7 @@ public class FinallyProcessor {
// exception successors
if (isLastBlock && blockSample.getSeq().isEmpty()) {
- ; // do nothing, blockSample will be removed anyway
+ // do nothing, blockSample will be removed anyway
}
else {
if (blockCatch.getSuccExceptions().size() == blockSample.getSuccExceptions().size()) {
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/IdeaNotNullHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/IdeaNotNullHelper.java
index 0af6de0..9934298 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/IdeaNotNullHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/IdeaNotNullHelper.java
@@ -78,7 +78,7 @@ public class IdeaNotNullHelper {
Exprent second_param = func.getLstOperands().get(1);
if (second_param.type == Exprent.EXPRENT_CONST &&
- ((ConstExprent)second_param).getExprType().type == CodeConstants.TYPE_NULL) { // TODO: reversed parameter order
+ second_param.getExprType().type == CodeConstants.TYPE_NULL) { // TODO: reversed parameter order
if (first_param.type == Exprent.EXPRENT_VAR) {
VarExprent var = (VarExprent)first_param;
@@ -227,7 +227,7 @@ public class IdeaNotNullHelper {
Statement elsebranch = ifparent.getElsestat();
if (second_param.type == Exprent.EXPRENT_CONST &&
- ((ConstExprent)second_param).getExprType().type == CodeConstants.TYPE_NULL) { // TODO: reversed parameter order
+ second_param.getExprType().type == CodeConstants.TYPE_NULL) { // TODO: reversed parameter order
//if(first_param.type == Exprent.EXPRENT_VAR && ((VarExprent)first_param).getIndex() == var_value.getIndex()) {
if (first_param.equals(exprent_value)) { // TODO: check for absence of side effects like method invocations etc.
if (ifbranch.type == Statement.TYPE_BASICBLOCK &&
@@ -291,7 +291,7 @@ public class IdeaNotNullHelper {
Statement ifbranch = ifstat.getIfstat();
if (second_param.type == Exprent.EXPRENT_CONST &&
- ((ConstExprent)second_param).getExprType().type == CodeConstants.TYPE_NULL) { // TODO: reversed parameter order
+ second_param.getExprType().type == CodeConstants.TYPE_NULL) { // TODO: reversed parameter order
if (first_param.equals(exprent_value)) { // TODO: check for absence of side effects like method invocations etc.
if (ifbranch.type == Statement.TYPE_BASICBLOCK &&
ifbranch.getExprents().size() == 1 &&
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/IfHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/IfHelper.java
index d5f4c9c..b1a955c 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/IfHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/IfHelper.java
@@ -50,7 +50,7 @@ public class IfHelper {
if (stat.getExprents() == null) {
- for (; ; ) {
+ while (true) {
boolean changed = false;
@@ -59,7 +59,7 @@ public class IfHelper {
res |= mergeAllIfsRec(st, setReorderedIfs);
// collapse composed if's
- if (changed = IfHelper.mergeIfs(st, setReorderedIfs)) {
+ if (changed = mergeIfs(st, setReorderedIfs)) {
break;
}
}
@@ -84,7 +84,7 @@ public class IfHelper {
boolean res = false;
- for (; ; ) {
+ while (true) {
boolean updated = false;
@@ -442,7 +442,6 @@ public class IfHelper {
}
boolean ifdirect = false, elsedirect = false;
- ;
boolean noifstat = false, noelsestat = false;
boolean ifdirectpath = false, elsedirectpath = false;
@@ -471,7 +470,7 @@ public class IfHelper {
}
}
- Statement last = parent.type == Statement.TYPE_SEQUENCE ? ((SequenceStatement)parent).getStats().getLast() : ifstat;
+ Statement last = parent.type == Statement.TYPE_SEQUENCE ? parent.getStats().getLast() : ifstat;
noelsestat = (last == ifstat);
if (!last.getAllSuccessorEdges().isEmpty() && last.getAllSuccessorEdges().get(0).getType() == StatEdge.TYPE_FINALLYEXIT) {
@@ -575,7 +574,7 @@ public class IfHelper {
}
else {
Statement ifbranch = ifstat.getIfstat();
- SequenceStatement newseq = new SequenceStatement(Arrays.asList(new Statement[]{ifstat, ifbranch}));
+ SequenceStatement newseq = new SequenceStatement(Arrays.asList(ifstat, ifbranch));
ifstat.getFirst().removeSuccessor(ifedge);
ifstat.getStats().removeWithKey(ifbranch.id);
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/InlineSingleBlockHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/InlineSingleBlockHelper.java
index b9ffb8f..adeda02 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/InlineSingleBlockHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/InlineSingleBlockHelper.java
@@ -155,7 +155,7 @@ public class InlineSingleBlockHelper {
Statement from = edge.getSource();
Statement to = edge.getDestination();
- for (; ; ) {
+ while (true) {
Statement parent = from.getParent();
if (parent.containsStatementStrict(to)) {
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java
index 2e00d5b..00da7ac 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java
@@ -65,7 +65,7 @@ public class LabelHelper {
List<Statement> lst = new ArrayList<Statement>();
if (parent.type == Statement.TYPE_SEQUENCE) {
- lst.addAll(((SequenceStatement)parent).getStats());
+ lst.addAll(parent.getStats());
}
else if (parent.type == Statement.TYPE_SWITCH) {
lst.addAll(((SwitchStatement)parent).getCaseStatements());
@@ -489,7 +489,7 @@ public class LabelHelper {
private static Statement getMinContinueClosure(StatEdge edge) {
Statement closure = edge.closure;
- for (; ; ) {
+ while (true) {
boolean found = false;
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/LoopExtractHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/LoopExtractHelper.java
index 180f162..d5c9e8f 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/LoopExtractHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/LoopExtractHelper.java
@@ -44,7 +44,7 @@ public class LoopExtractHelper {
boolean res = false;
- for (; ; ) {
+ while (true) {
boolean updated = false;
@@ -183,7 +183,7 @@ public class LoopExtractHelper {
loop.addLabeledEdge(ifedge);
- SequenceStatement block = new SequenceStatement(Arrays.asList(new Statement[]{loop, target}));
+ SequenceStatement block = new SequenceStatement(Arrays.asList(loop, target));
loop.getParent().replaceStatement(loop, block);
block.setAllParent();
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/LowBreakHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/LowBreakHelper.java
index dcd501a..67e9248 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/LowBreakHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/LowBreakHelper.java
@@ -32,7 +32,7 @@ public class LowBreakHelper {
private static void lowBreakLabelsRec(Statement stat) {
- for (; ; ) {
+ while (true) {
boolean found = false;
@@ -79,7 +79,7 @@ public class LowBreakHelper {
public static Statement getMinClosure(Statement closure, Statement source) {
- for (; ; ) {
+ while (true) {
Statement newclosure = null;
@@ -152,7 +152,7 @@ public class LowBreakHelper {
}
- for (; ; ) {
+ while (true) {
boolean found = false;
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/MergeHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/MergeHelper.java
index 4ce408b..2d2f8b5 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/MergeHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/MergeHelper.java
@@ -323,7 +323,7 @@ public class MergeHelper {
// search for an initializing exprent
Statement current = stat;
- for (; ; ) {
+ while (true) {
Statement parent = current.getParent();
if (parent == null) {
break;
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/SequenceHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/SequenceHelper.java
index aa69931..6ffa709 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/SequenceHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/SequenceHelper.java
@@ -142,7 +142,7 @@ public class SequenceHelper {
// replace flat statements with synthetic basic blocks
outer:
- for (; ; ) {
+ while (true) {
for (Statement st : stat.getStats()) {
if ((st.getStats().isEmpty() || st.getExprents() != null) && st.type != Statement.TYPE_BASICBLOCK) {
destroyAndFlattenStatement(st);
@@ -185,7 +185,7 @@ public class SequenceHelper {
mergeFlatStatements(sequence);
- for (; ; ) {
+ while (true) {
boolean found = false;
@@ -242,7 +242,7 @@ public class SequenceHelper {
private static void mergeFlatStatements(SequenceStatement sequence) {
- for (; ; ) {
+ while (true) {
Statement next = null;
Statement current = null;
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java
index a7d5702..362a1e3 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java
@@ -45,7 +45,7 @@ public class SimplifyExprentsHelper {
if (stat.getExprents() == null) {
- for (; ; ) {
+ while (true) {
boolean changed = false;
@@ -402,7 +402,7 @@ public class SimplifyExprentsHelper {
AssignmentExprent asf = (AssignmentExprent)first;
AssignmentExprent ass = (AssignmentExprent)second;
- for (; ; ) {
+ while (true) {
if (asf.getRight().equals(ass.getRight())) {
if ((asf.getLeft().type == Exprent.EXPRENT_VAR && ((VarExprent)asf.getLeft()).isStack()) &&
(ass.getLeft().type != Exprent.EXPRENT_VAR || !((VarExprent)ass.getLeft()).isStack())) {
@@ -789,7 +789,7 @@ public class SimplifyExprentsHelper {
data.add(new AssignmentExprent(ifvar, new FunctionExprent(FunctionExprent.FUNCTION_IIF,
Arrays.asList(new Exprent[]{
- ((IfExprent)stif.getHeadexprent()).getCondition(),
+ stif.getHeadexprent().getCondition(),
ifas.getRight(),
elseas.getRight()}))));
stif.setExprents(data);
@@ -830,7 +830,7 @@ public class SimplifyExprentsHelper {
data.add(new ExitExprent(ifex.getExittype(), new FunctionExprent(FunctionExprent.FUNCTION_IIF,
Arrays.asList(new Exprent[]{
- ((IfExprent)stif.getHeadexprent()).getCondition(),
+ stif.getHeadexprent().getCondition(),
ifex.getValue(),
elseex.getValue()})), ifex.getRettype()));
stif.setExprents(data);
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/StackVarsProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/StackVarsProcessor.java
index d0f3f03..e72c646 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/StackVarsProcessor.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/StackVarsProcessor.java
@@ -43,7 +43,7 @@ public class StackVarsProcessor {
SSAUConstructorSparseEx ssau = null;
- for (; ; ) {
+ while (true) {
boolean found = false;
@@ -287,7 +287,7 @@ public class StackVarsProcessor {
int changed = 0;
for (Exprent expr : exprent.getAllExprents()) {
- for (; ; ) {
+ while (true) {
Object[] arr = iterateChildExprent(expr, exprent, next, mapVarValues, ssau);
Exprent retexpr = (Exprent)arr[0];
changed |= (Boolean)arr[1] ? 1 : 0;
@@ -464,7 +464,7 @@ public class StackVarsProcessor {
boolean changed = false;
for (Exprent expr : exprent.getAllExprents()) {
- for (; ; ) {
+ while (true) {
Object[] arr = iterateChildExprent(expr, parent, next, mapVarValues, ssau);
Exprent retexpr = (Exprent)arr[0];
changed |= (Boolean)arr[1];
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.java b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.java
index b79c864..0980bee 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.java
@@ -78,7 +78,7 @@ public class DominatorEngine {
// exclude first statement
List<Integer> lstIds = colOrderedIDoms.getLstKeys().subList(1, colOrderedIDoms.getLstKeys().size());
- for (; ; ) {
+ while (true) {
boolean changed = false;
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java
index daa898a..f029016 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java
@@ -286,7 +286,7 @@ public class FastExtendedPostdominanceHelper {
private void iterateReachability(IReachabilityAction action, int edgetype) {
- for (; ; ) {
+ while (true) {
boolean iterate = false;
@@ -350,6 +350,6 @@ public class FastExtendedPostdominanceHelper {
private interface IReachabilityAction {
- public boolean action(Statement node, HashMap<Integer, FastFixedSet<Integer>> mapSets);
+ boolean action(Statement node, HashMap<Integer, FastFixedSet<Integer>> mapSets);
}
}
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.java b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.java
index 2eca3b7..f77e950 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.java
@@ -91,7 +91,7 @@ public class GenericDominatorEngine {
List<IGraphNode> lstNodes = colOrderedIDoms.getLstKeys();
- for (; ; ) {
+ while (true) {
boolean changed = false;
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraph.java b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraph.java
index 9179f9c..faaf4c6 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraph.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraph.java
@@ -20,7 +20,7 @@ import java.util.Set;
public interface IGraph {
- public List<? extends IGraphNode> getReversePostOrderList();
+ List<? extends IGraphNode> getReversePostOrderList();
- public Set<? extends IGraphNode> getRoots();
+ Set<? extends IGraphNode> getRoots();
}
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraphNode.java b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraphNode.java
index 191b974..19d59b5 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraphNode.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraphNode.java
@@ -19,5 +19,5 @@ import java.util.List;
public interface IGraphNode {
- public List<? extends IGraphNode> getPredecessors();
+ List<? extends IGraphNode> getPredecessors();
}
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/IrreducibleCFGDeobfuscator.java b/src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/IrreducibleCFGDeobfuscator.java
index 11f9483..31e171e 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/IrreducibleCFGDeobfuscator.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/IrreducibleCFGDeobfuscator.java
@@ -63,7 +63,7 @@ public class IrreducibleCFGDeobfuscator {
}
// transforming and reducing the graph
- for (; ; ) {
+ while (true) {
int ttype = 0;
Node node = null;
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/Exprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/Exprent.java
index 63b3a5f..a0518b1 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/Exprent.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/Exprent.java
@@ -108,7 +108,7 @@ public class Exprent {
lstAllExprents.add(this);
for (Exprent expr : lstAllExprents) {
- if (expr.type == Exprent.EXPRENT_VAR) {
+ if (expr.type == EXPRENT_VAR) {
set.add(new VarVersionPaar((VarExprent)expr));
}
}
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java
index 305fd59..844a7a9 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java
@@ -292,10 +292,7 @@ public class FunctionExprent extends Exprent {
else if (functype == FUNCTION_STRCONCAT) {
exprType = VarType.VARTYPE_STRING;
}
- else if (functype >= FUNCTION_EQ) {
- exprType = VarType.VARTYPE_BOOLEAN;
- }
- else if (functype == FUNCTION_INSTANCEOF) {
+ else if (functype >= FUNCTION_EQ || functype == FUNCTION_INSTANCEOF) {
exprType = VarType.VARTYPE_BOOLEAN;
}
else if (functype >= FUNCTION_ARRAYLENGTH) {
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/VarExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/VarExprent.java
index cd75f1f..e589494 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/VarExprent.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/VarExprent.java
@@ -43,7 +43,6 @@ public class VarExprent extends Exprent {
private VarType vartype;
private boolean definition = false;
- ;
private VarProcessor processor;
@@ -52,7 +51,6 @@ public class VarExprent extends Exprent {
private boolean classdef = false;
private boolean stack = false;
- ;
{
this.type = EXPRENT_VAR;
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/DirectGraph.java b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/DirectGraph.java
index 1fc568f..2f4ed80 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/DirectGraph.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/DirectGraph.java
@@ -131,6 +131,6 @@ public class DirectGraph {
// 0 - success, do nothing
// 1 - cancel iteration
// 2 - success, delete exprent
- public int processExprent(Exprent exprent);
+ int processExprent(Exprent exprent);
}
}
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.java
index 1eb79e9..27d3c9a 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.java
@@ -321,7 +321,7 @@ public class FlattenStatementsHelper {
boolean isFinallyExit = false;
- for (; ; ) {
+ while (true) {
StackEntry entry = null;
if (!stack.isEmpty()) {
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.java b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.java
index 596da31..9b1ce0e 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.java
@@ -791,7 +791,7 @@ public class SSAUConstructorSparseEx {
private Integer getFirstProtectedRange(Statement stat) {
- for (; ; ) {
+ while (true) {
Statement parent = stat.getParent();
if (parent == null) {
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java
index 9f1a3f5..f2b6bc4 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java
@@ -49,8 +49,6 @@ public class CatchAllStatement extends Statement {
type = Statement.TYPE_CATCHALL;
}
- ;
-
private CatchAllStatement(Statement head, Statement handler) {
this();
@@ -102,7 +100,7 @@ public class CatchAllStatement extends Statement {
return null;
}
- if (DecHelper.checkStatementExceptions(Arrays.asList(new Statement[]{head, exc}))) {
+ if (DecHelper.checkStatementExceptions(Arrays.asList(head, exc))) {
return new CatchAllStatement(head, exc);
}
}
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SequenceStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SequenceStatement.java
index 8fd8a43..d561b9e 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SequenceStatement.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SequenceStatement.java
@@ -51,7 +51,7 @@ public class SequenceStatement extends Statement {
private SequenceStatement(Statement head, Statement tail) {
- this(Arrays.asList(new Statement[]{head, tail}));
+ this(Arrays.asList(head, tail));
List<StatEdge> lstSuccs = tail.getSuccessorEdges(STATEDGE_DIRECT_ALL);
if (!lstSuccs.isEmpty()) {
@@ -88,7 +88,7 @@ public class SequenceStatement extends Statement {
&& !stat.isMonitorEnter()) {
if (stat.getLastBasicType() == Statement.LASTBASICTYPE_GENERAL) {
- if (DecHelper.checkStatementExceptions(Arrays.asList(new Statement[]{head, stat}))) {
+ if (DecHelper.checkStatementExceptions(Arrays.asList(head, stat))) {
return new SequenceStatement(head, stat);
}
}
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java
index aceb2b8..52118d2 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java
@@ -124,7 +124,6 @@ public class Statement {
// FIXME: used in FlattenStatementsHelper.flattenStatement()! check and remove
//lastBasicType = LASTBASICTYPE_GENERAL;
isMonitorEnter = false;
- ;
containsMonitorExit = false;
for (Map<Integer, List<StatEdge>> map : new Map[]{mapSuccEdges, mapPredEdges}) {
@@ -234,7 +233,7 @@ public class Statement {
// monitorenter and monitorexit
stat.buildMonitorFlags();
- if (stat.type == Statement.TYPE_SWITCH) {
+ if (stat.type == TYPE_SWITCH) {
// special case switch, sorting leaf nodes
((SwitchStatement)stat).sortEdgesAndNodes();
}
@@ -390,7 +389,7 @@ public class Statement {
continueSet.add(edge.getDestination().getBasichead());
}
- if (type == Statement.TYPE_DO) {
+ if (type == TYPE_DO) {
continueSet.remove(first.getBasichead());
}
@@ -513,11 +512,11 @@ public class Statement {
}
public void initExprents() {
- ; // do nothing
+ // do nothing
}
public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
- ; // do nothing
+ // do nothing
}
public Statement getSimpleCopy() {
@@ -804,7 +803,7 @@ public class Statement {
}
public BasicBlockStatement getBasichead() {
- if (type == Statement.TYPE_BASICBLOCK) {
+ if (type == TYPE_BASICBLOCK) {
return (BasicBlockStatement)this;
}
else {
@@ -823,13 +822,12 @@ public class Statement {
}
public boolean hasBasicSuccEdge() {
- boolean res = type == Statement.TYPE_BASICBLOCK || (type == Statement.TYPE_IF &&
- ((IfStatement)this).iftype == IfStatement.IFTYPE_IF) ||
- (type == Statement.TYPE_DO && ((DoStatement)this).getLooptype() != DoStatement.LOOP_DO);
// FIXME: default switch
- return res;
+ return type == TYPE_BASICBLOCK || (type == TYPE_IF &&
+ ((IfStatement)this).iftype == IfStatement.IFTYPE_IF) ||
+ (type == TYPE_DO && ((DoStatement)this).getLooptype() != DoStatement.LOOP_DO);
}
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java
index 7e5a56f..1c52517 100644
--- a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java
+++ b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java
@@ -148,7 +148,7 @@ public class VarDefinitionHelper {
continue;
}
else {
- List<Exprent> lstSpecial = Arrays.asList(new Exprent[]{dstat.getConditionExprent(), dstat.getIncExprent()});
+ List<Exprent> lstSpecial = Arrays.asList(dstat.getConditionExprent(), dstat.getIncExprent());
for (VarExprent var : getAllVars(lstSpecial)) {
if (var.getIndex() == index.intValue()) {
stat = stat.getParent();
diff --git a/src/org/jetbrains/java/decompiler/modules/renamer/IdentifierConverter.java b/src/org/jetbrains/java/decompiler/modules/renamer/IdentifierConverter.java
index a665de8..c8ec379 100644
--- a/src/org/jetbrains/java/decompiler/modules/renamer/IdentifierConverter.java
+++ b/src/org/jetbrains/java/decompiler/modules/renamer/IdentifierConverter.java
@@ -56,7 +56,7 @@ public class IdentifierConverter {
helper = (IIdentifierRenamer)IdentifierConverter.class.getClassLoader().loadClass(user_class).newInstance();
}
catch (Exception ex) {
- ; // ignore errors
+ // ignore errors
}
}