Collections.addAll applied; some more warnings fixed

master
Tagir Valeev 7 years ago
parent 893450cdb3
commit 7f63baab37
  1. 3
      src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java
  2. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/SequenceHelper.java
  3. 32
      src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java
  4. 3
      src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/ExceptionDeobfuscator.java
  5. 3
      src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java

@ -898,8 +898,7 @@ public class FinallyProcessor {
newblock.setSeq(seq);
newblock.getInstrOldOffsets().addAll(oldOffsets);
List<BasicBlock> lstTemp = new ArrayList<>();
lstTemp.addAll(sample.getSuccs());
List<BasicBlock> lstTemp = new ArrayList<>(sample.getSuccs());
// move successors
for (BasicBlock suc : lstTemp) {

@ -18,7 +18,6 @@ package org.jetbrains.java.decompiler.modules.decompiler;
import org.jetbrains.java.decompiler.code.cfg.BasicBlock;
import org.jetbrains.java.decompiler.main.DecompilerContext;
import org.jetbrains.java.decompiler.main.collectors.CounterContainer;
import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent;
import org.jetbrains.java.decompiler.modules.decompiler.stats.BasicBlockStatement;
import org.jetbrains.java.decompiler.modules.decompiler.stats.SequenceStatement;
import org.jetbrains.java.decompiler.modules.decompiler.stats.Statement;
@ -39,8 +38,7 @@ public class SequenceHelper {
if (stat.type == Statement.TYPE_SEQUENCE) {
List<Statement> lst = new ArrayList<>();
lst.addAll(stat.getStats());
List<Statement> lst = new ArrayList<>(stat.getStats());
boolean unfolded = false;

@ -15,30 +15,12 @@
*/
package org.jetbrains.java.decompiler.modules.decompiler;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import org.jetbrains.java.decompiler.code.CodeConstants;
import org.jetbrains.java.decompiler.main.ClassesProcessor.ClassNode;
import org.jetbrains.java.decompiler.main.DecompilerContext;
import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences;
import org.jetbrains.java.decompiler.main.rels.ClassWrapper;
import org.jetbrains.java.decompiler.modules.decompiler.exps.ArrayExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.AssignmentExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.ConstExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.ExitExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.FieldExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.MonitorExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.NewExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.VarExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.*;
import org.jetbrains.java.decompiler.modules.decompiler.sforms.SSAConstructorSparseEx;
import org.jetbrains.java.decompiler.modules.decompiler.stats.IfStatement;
import org.jetbrains.java.decompiler.modules.decompiler.stats.Statement;
@ -49,6 +31,9 @@ import org.jetbrains.java.decompiler.struct.match.MatchEngine;
import org.jetbrains.java.decompiler.util.FastSparseSetFactory.FastSparseSet;
import org.jetbrains.java.decompiler.util.InterpreterUtil;
import java.util.*;
import java.util.Map.Entry;
public class SimplifyExprentsHelper {
static final MatchEngine class14Builder = new MatchEngine();
@ -813,8 +798,7 @@ public class SimplifyExprentsHelper {
}
if (found) {
List<Exprent> data = new ArrayList<>();
data.addAll(stif.getFirst().getExprents());
List<Exprent> data = new ArrayList<>(stif.getFirst().getExprents());
data.add(new AssignmentExprent(ifvar, new FunctionExprent(FunctionExprent.FUNCTION_IIF,
Arrays.asList(
@ -859,8 +843,7 @@ public class SimplifyExprentsHelper {
return false;
}
List<Exprent> data = new ArrayList<>();
data.addAll(stif.getFirst().getExprents());
List<Exprent> data = new ArrayList<>(stif.getFirst().getExprents());
data.add(new ExitExprent(ifex.getExitType(), new FunctionExprent(FunctionExprent.FUNCTION_IIF,
Arrays.asList(
@ -927,8 +910,7 @@ public class SimplifyExprentsHelper {
assfirst.replaceExprent(assfirst.getRight(), new ConstExprent(VarType.VARTYPE_CLASS, class_name, null));
List<Exprent> data = new ArrayList<>();
data.addAll(stat.getFirst().getExprents());
List<Exprent> data = new ArrayList<>(stat.getFirst().getExprents());
stat.setExprents(data);

@ -172,9 +172,8 @@ public class ExceptionDeobfuscator {
BasicBlock emptyblock = new BasicBlock(++graph.last_id);
graph.getBlocks().addWithKey(emptyblock, emptyblock.id);
List<BasicBlock> lstTemp = new ArrayList<>();
// only exception predecessors considered
lstTemp.addAll(handler.getPredExceptions());
List<BasicBlock> lstTemp = new ArrayList<>(handler.getPredExceptions());
// replace predecessors
for (BasicBlock pred : lstTemp) {

@ -413,8 +413,7 @@ public class FunctionExprent extends Exprent {
@Override
public List<Exprent> getAllExprents() {
List<Exprent> lst = new ArrayList<>();
lst.addAll(lstOperands);
List<Exprent> lst = new ArrayList<>(lstOperands);
return lst;
}

Loading…
Cancel
Save