add override
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.code;
|
||||
|
||||
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||
@@ -30,6 +30,7 @@ public abstract class InstructionSequence {
|
||||
// *****************************************************************************
|
||||
|
||||
// to nbe overwritten
|
||||
@Override
|
||||
public InstructionSequence clone() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.code;
|
||||
|
||||
import org.jetbrains.java.decompiler.util.VBStyleCollection;
|
||||
@@ -12,6 +12,7 @@ public class SimpleInstructionSequence extends InstructionSequence {
|
||||
super(collinstr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimpleInstructionSequence clone() {
|
||||
SimpleInstructionSequence newseq = new SimpleInstructionSequence(collinstr.clone());
|
||||
newseq.setPointer(this.getPointer());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.code.cfg;
|
||||
|
||||
import org.jetbrains.java.decompiler.code.Instruction;
|
||||
@@ -160,6 +160,7 @@ public class BasicBlock implements IGraphNode {
|
||||
return instrOldOffsets;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends IGraphNode> getPredecessors() {
|
||||
List<BasicBlock> lst = new ArrayList<>(preds);
|
||||
lst.addAll(predExceptions);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.main.decompiler;
|
||||
|
||||
import org.jetbrains.java.decompiler.main.extern.IFernflowerLogger;
|
||||
@@ -71,6 +71,7 @@ public class PrintStreamLogger extends IFernflowerLogger {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endMethod() {
|
||||
if (accepts(Severity.INFO)) {
|
||||
--indent;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler;
|
||||
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent;
|
||||
@@ -14,11 +14,13 @@ public class ExprentStack extends ListStack<Exprent> {
|
||||
pointer = list.getPointer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Exprent pop() {
|
||||
|
||||
return this.remove(--pointer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExprentStack clone() {
|
||||
return new ExprentStack(this);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.deobfuscator;
|
||||
|
||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
@@ -211,10 +211,12 @@ public class ExceptionDeobfuscator {
|
||||
public static void removeCircularRanges(final ControlFlowGraph graph) {
|
||||
|
||||
GenericDominatorEngine engine = new GenericDominatorEngine(new IGraph() {
|
||||
@Override
|
||||
public List<? extends IGraphNode> getReversePostOrderList() {
|
||||
return graph.getReversePostOrder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<? extends IGraphNode> getRoots() {
|
||||
return new HashSet<>(Collections.singletonList(graph.getFirst()));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.exps;
|
||||
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
@@ -44,10 +42,12 @@ public class ArrayExprent extends Exprent {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExprentUse() {
|
||||
return array.getExprentUse() & index.getExprentUse() & Exprent.MULTIPLE_USES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CheckTypesResult checkExprTypeBounds() {
|
||||
CheckTypesResult result = new CheckTypesResult();
|
||||
result.addMinTypeExprent(index, VarType.VARTYPE_BYTECHAR);
|
||||
@@ -55,6 +55,7 @@ public class ArrayExprent extends Exprent {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Exprent> getAllExprents() {
|
||||
List<Exprent> lst = new ArrayList<>();
|
||||
lst.add(array);
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.exps;
|
||||
|
||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
@@ -97,6 +95,7 @@ public class ConstExprent extends Exprent {
|
||||
return Exprent.MULTIPLE_USES | Exprent.SIDE_EFFECTS_FREE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Exprent> getAllExprents() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.stats;
|
||||
|
||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
@@ -8,10 +6,10 @@ import org.jetbrains.java.decompiler.code.Instruction;
|
||||
import org.jetbrains.java.decompiler.code.SimpleInstructionSequence;
|
||||
import org.jetbrains.java.decompiler.code.cfg.BasicBlock;
|
||||
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.CounterContainer;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
|
||||
public class BasicBlockStatement extends Statement {
|
||||
|
||||
@@ -55,12 +53,14 @@ public class BasicBlockStatement extends Statement {
|
||||
// public methods
|
||||
// *****************************************************************************
|
||||
|
||||
@Override
|
||||
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
TextBuffer tb = ExprProcessor.listToJava(varDefinitions, indent, tracer);
|
||||
tb.append(ExprProcessor.listToJava(exprents, indent, tracer));
|
||||
return tb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement getSimpleCopy() {
|
||||
|
||||
BasicBlock newblock = new BasicBlock(
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.stats;
|
||||
|
||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
@@ -96,6 +94,7 @@ public class CatchAllStatement extends Statement {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
String new_line_separator = DecompilerContext.getNewLineSeparator();
|
||||
|
||||
@@ -146,6 +145,7 @@ public class CatchAllStatement extends Statement {
|
||||
return buf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceStatement(Statement oldstat, Statement newstat) {
|
||||
|
||||
if (handler == oldstat) {
|
||||
@@ -155,6 +155,7 @@ public class CatchAllStatement extends Statement {
|
||||
super.replaceStatement(oldstat, newstat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement getSimpleCopy() {
|
||||
|
||||
CatchAllStatement cas = new CatchAllStatement();
|
||||
@@ -176,6 +177,7 @@ public class CatchAllStatement extends Statement {
|
||||
return cas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initSimpleCopy() {
|
||||
first = stats.get(0);
|
||||
handler = stats.get(1);
|
||||
|
||||
@@ -4,7 +4,6 @@ package org.jetbrains.java.decompiler.modules.decompiler.stats;
|
||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
import org.jetbrains.java.decompiler.code.cfg.BasicBlock;
|
||||
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.CounterContainer;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.DecHelper;
|
||||
@@ -12,6 +11,7 @@ import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.StatEdge;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.exps.VarExprent;
|
||||
import org.jetbrains.java.decompiler.struct.gen.VarType;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -130,6 +130,7 @@ public class CatchStatement extends Statement {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
TextBuffer buf = new TextBuffer();
|
||||
|
||||
@@ -178,6 +179,7 @@ public class CatchStatement extends Statement {
|
||||
return buf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement getSimpleCopy() {
|
||||
CatchStatement cs = new CatchStatement();
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.stats;
|
||||
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.StatEdge;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -77,6 +77,7 @@ public class DoStatement extends Statement {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
TextBuffer buf = new TextBuffer();
|
||||
|
||||
@@ -126,6 +127,7 @@ public class DoStatement extends Statement {
|
||||
return buf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getSequentialObjects() {
|
||||
|
||||
List<Object> lst = new ArrayList<>();
|
||||
@@ -152,6 +154,7 @@ public class DoStatement extends Statement {
|
||||
return lst;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
|
||||
if (initExprent.get(0) == oldexpr) {
|
||||
initExprent.set(0, newexpr);
|
||||
@@ -164,6 +167,7 @@ public class DoStatement extends Statement {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement getSimpleCopy() {
|
||||
return new DoStatement();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.stats;
|
||||
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
@@ -41,6 +39,7 @@ public class GeneralStatement extends Statement {
|
||||
// public methods
|
||||
// *****************************************************************************
|
||||
|
||||
@Override
|
||||
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
TextBuffer buf = new TextBuffer();
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.stats;
|
||||
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.DecHelper;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
@@ -11,6 +10,7 @@ import org.jetbrains.java.decompiler.modules.decompiler.exps.IfExprent;
|
||||
import org.jetbrains.java.decompiler.struct.match.IMatchable;
|
||||
import org.jetbrains.java.decompiler.struct.match.MatchEngine;
|
||||
import org.jetbrains.java.decompiler.struct.match.MatchNode;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.util.TextUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -187,6 +187,7 @@ public class IfStatement extends Statement {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
TextBuffer buf = new TextBuffer();
|
||||
|
||||
@@ -266,6 +267,7 @@ public class IfStatement extends Statement {
|
||||
return buf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initExprents() {
|
||||
|
||||
IfExprent ifexpr = (IfExprent)first.getExprents().remove(first.getExprents().size() - 1);
|
||||
@@ -278,6 +280,7 @@ public class IfStatement extends Statement {
|
||||
headexprent.set(0, ifexpr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getSequentialObjects() {
|
||||
|
||||
List<Object> lst = new ArrayList<>(stats);
|
||||
@@ -286,12 +289,14 @@ public class IfStatement extends Statement {
|
||||
return lst;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
|
||||
if (headexprent.get(0) == oldexpr) {
|
||||
headexprent.set(0, newexpr);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceStatement(Statement oldstat, Statement newstat) {
|
||||
|
||||
super.replaceStatement(oldstat, newstat);
|
||||
@@ -324,6 +329,7 @@ public class IfStatement extends Statement {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement getSimpleCopy() {
|
||||
|
||||
IfStatement is = new IfStatement();
|
||||
@@ -333,6 +339,7 @@ public class IfStatement extends Statement {
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initSimpleCopy() {
|
||||
|
||||
first = stats.get(0);
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.stats;
|
||||
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
|
||||
public class RootStatement extends Statement {
|
||||
private final DummyExitStatement dummyExit;
|
||||
@@ -20,6 +18,7 @@ public class RootStatement extends Statement {
|
||||
first.setParent(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
return ExprProcessor.listToJava(varDefinitions, indent, tracer).append(first.toJava(indent, tracer));
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.stats;
|
||||
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.DecHelper;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.StatEdge;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -86,6 +84,7 @@ public class SequenceStatement extends Statement {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
TextBuffer buf = new TextBuffer();
|
||||
boolean islabeled = isLabeled();
|
||||
@@ -122,6 +121,7 @@ public class SequenceStatement extends Statement {
|
||||
return buf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement getSimpleCopy() {
|
||||
return new SequenceStatement();
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.stats;
|
||||
|
||||
import org.jetbrains.java.decompiler.code.SwitchInstruction;
|
||||
import org.jetbrains.java.decompiler.code.cfg.BasicBlock;
|
||||
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.CounterContainer;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.DecHelper;
|
||||
@@ -18,6 +15,7 @@ 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.SwitchExprent;
|
||||
import org.jetbrains.java.decompiler.struct.gen.VarType;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -97,6 +95,7 @@ public class SwitchStatement extends Statement {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
SwitchHelper.simplify(this);
|
||||
|
||||
@@ -153,6 +152,7 @@ public class SwitchStatement extends Statement {
|
||||
return buf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initExprents() {
|
||||
SwitchExprent swexpr = (SwitchExprent)first.getExprents().remove(first.getExprents().size() - 1);
|
||||
swexpr.setCaseValues(caseValues);
|
||||
@@ -160,6 +160,7 @@ public class SwitchStatement extends Statement {
|
||||
headexprent.set(0, swexpr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getSequentialObjects() {
|
||||
|
||||
List<Object> lst = new ArrayList<>(stats);
|
||||
@@ -168,12 +169,14 @@ public class SwitchStatement extends Statement {
|
||||
return lst;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
|
||||
if (headexprent.get(0) == oldexpr) {
|
||||
headexprent.set(0, newexpr);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceStatement(Statement oldstat, Statement newstat) {
|
||||
|
||||
for (int i = 0; i < caseStatements.size(); i++) {
|
||||
@@ -185,10 +188,12 @@ public class SwitchStatement extends Statement {
|
||||
super.replaceStatement(oldstat, newstat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement getSimpleCopy() {
|
||||
return new SwitchStatement();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initSimpleCopy() {
|
||||
first = stats.get(0);
|
||||
default_edge = first.getSuccessorEdges(Statement.STATEDGE_DIRECT_ALL).get(0);
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.stats;
|
||||
|
||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||
import org.jetbrains.java.decompiler.code.cfg.BasicBlock;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.SequenceHelper;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.StatEdge;
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent;
|
||||
import org.jetbrains.java.decompiler.util.TextBuffer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -58,6 +56,7 @@ public class SynchronizedStatement extends Statement {
|
||||
// public methods
|
||||
// *****************************************************************************
|
||||
|
||||
@Override
|
||||
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
|
||||
TextBuffer buf = new TextBuffer();
|
||||
buf.append(ExprProcessor.listToJava(varDefinitions, indent, tracer));
|
||||
@@ -88,10 +87,12 @@ public class SynchronizedStatement extends Statement {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initExprents() {
|
||||
headexprent.set(0, first.getExprents().remove(first.getExprents().size() - 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getSequentialObjects() {
|
||||
|
||||
List<Object> lst = new ArrayList<>(stats);
|
||||
@@ -100,12 +101,14 @@ public class SynchronizedStatement extends Statement {
|
||||
return lst;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
|
||||
if (headexprent.get(0) == oldexpr) {
|
||||
headexprent.set(0, newexpr);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceStatement(Statement oldstat, Statement newstat) {
|
||||
|
||||
if (body == oldstat) {
|
||||
@@ -122,10 +125,12 @@ public class SynchronizedStatement extends Statement {
|
||||
stats.removeWithKey(exc.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement getSimpleCopy() {
|
||||
return new SynchronizedStatement();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initSimpleCopy() {
|
||||
first = stats.get(0);
|
||||
body = stats.get(1);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.vars;
|
||||
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.decompose.IGraphNode;
|
||||
@@ -31,6 +31,7 @@ public class VarVersionNode implements IGraphNode {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IGraphNode> getPredecessors() {
|
||||
List<IGraphNode> lst = new ArrayList<>(preds.size());
|
||||
for (VarVersionEdge edge : preds) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.modules.decompiler.vars;
|
||||
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.decompose.GenericDominatorEngine;
|
||||
@@ -72,10 +72,12 @@ public class VarVersionsGraph {
|
||||
}
|
||||
|
||||
engine = new GenericDominatorEngine(new IGraph() {
|
||||
@Override
|
||||
public List<? extends IGraphNode> getReversePostOrderList() {
|
||||
return getReversedPostOrder(roots);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<? extends IGraphNode> getRoots() {
|
||||
return new HashSet<IGraphNode>(roots);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.util;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -174,6 +174,7 @@ public class FastFixedSetFactory<E> {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
return new FastFixedSetIterator<>(this);
|
||||
}
|
||||
@@ -288,11 +289,13 @@ public class FastFixedSetFactory<E> {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
next_pointer = getNextIndex(pointer);
|
||||
return (next_pointer >= 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E next() {
|
||||
if (next_pointer >= 0) {
|
||||
pointer = next_pointer;
|
||||
@@ -308,6 +311,7 @@ public class FastFixedSetFactory<E> {
|
||||
return pointer < size ? colValuesInternal.getKey(pointer) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
int[] index = colValuesInternal.get(pointer);
|
||||
data[index[0]] &= ~index[1];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.util;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -317,6 +317,7 @@ public class FastSparseSetFactory<E> {
|
||||
return data.length == 0 || (next[0] == 0 && data[0] == 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
return new FastSparseSetIterator<>(this);
|
||||
}
|
||||
@@ -407,11 +408,13 @@ public class FastSparseSetFactory<E> {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
next_pointer = getNextIndex(pointer);
|
||||
return (next_pointer >= 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E next() {
|
||||
if (next_pointer >= 0) {
|
||||
pointer = next_pointer;
|
||||
@@ -427,6 +430,7 @@ public class FastSparseSetFactory<E> {
|
||||
return pointer < size ? colValuesInternal.getKey(pointer) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
int[] index = colValuesInternal.get(pointer);
|
||||
data[index[0]] &= ~index[1];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -14,6 +14,7 @@ public class ListStack<T> extends ArrayList<T> {
|
||||
super(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("MethodDoesntCallSuperMethod")
|
||||
public ListStack<T> clone() {
|
||||
ListStack<T> copy = new ListStack<>(this);
|
||||
@@ -62,6 +63,7 @@ public class ListStack<T> extends ArrayList<T> {
|
||||
pointer++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
super.clear();
|
||||
pointer = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.util;
|
||||
|
||||
import org.jetbrains.java.decompiler.modules.decompiler.exps.VarExprent;
|
||||
@@ -348,14 +348,17 @@ public class SFormsFastMapDirect {
|
||||
private final Integer var = key;
|
||||
private final FastSparseSet<Integer> val = ent;
|
||||
|
||||
@Override
|
||||
public Integer getKey() {
|
||||
return var;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FastSparseSet<Integer> getValue() {
|
||||
return val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FastSparseSet<Integer> setValue(FastSparseSet<Integer> newvalue) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.decompiler.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -21,16 +21,19 @@ public class VBStyleCollection<E, K> extends ArrayList<E> {
|
||||
map = new HashMap<>(initialCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(E element) {
|
||||
lstKeys.add(null);
|
||||
super.add(element);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Object element) { // TODO: error on void remove(E element)
|
||||
throw new RuntimeException("not implemented!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAll(Collection<? extends E> c) {
|
||||
for (int i = c.size() - 1; i >= 0; i--) {
|
||||
lstKeys.add(null);
|
||||
@@ -67,6 +70,7 @@ public class VBStyleCollection<E, K> extends ArrayList<E> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(int index, E element) {
|
||||
addToListIndex(index, 1);
|
||||
lstKeys.add(index, null);
|
||||
@@ -88,6 +92,7 @@ public class VBStyleCollection<E, K> extends ArrayList<E> {
|
||||
map.remove(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E remove(int index) {
|
||||
addToListIndex(index + 1, -1);
|
||||
K obj = lstKeys.get(index);
|
||||
@@ -118,12 +123,14 @@ public class VBStyleCollection<E, K> extends ArrayList<E> {
|
||||
return map.containsKey(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
map.clear();
|
||||
lstKeys.clear();
|
||||
super.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VBStyleCollection<E, K> clone() {
|
||||
VBStyleCollection<E, K> c = new VBStyleCollection<>();
|
||||
c.addAll(new ArrayList<>(this));
|
||||
|
||||
Reference in New Issue
Block a user