add override

master
Vladimir Krivosheev 6 years ago
parent 9669276a3e
commit 8ee7853268
  1. 3
      src/org/jetbrains/java/decompiler/code/InstructionSequence.java
  2. 3
      src/org/jetbrains/java/decompiler/code/SimpleInstructionSequence.java
  3. 3
      src/org/jetbrains/java/decompiler/code/cfg/BasicBlock.java
  4. 3
      src/org/jetbrains/java/decompiler/main/decompiler/PrintStreamLogger.java
  5. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/ExprentStack.java
  6. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/ExceptionDeobfuscator.java
  7. 7
      src/org/jetbrains/java/decompiler/modules/decompiler/exps/ArrayExprent.java
  8. 5
      src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java
  9. 8
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/BasicBlockStatement.java
  10. 8
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java
  11. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchStatement.java
  12. 6
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/DoStatement.java
  13. 7
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/GeneralStatement.java
  14. 9
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/IfStatement.java
  15. 7
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/RootStatement.java
  16. 8
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/SequenceStatement.java
  17. 13
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.java
  18. 13
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/SynchronizedStatement.java
  19. 3
      src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionNode.java
  20. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionsGraph.java
  21. 6
      src/org/jetbrains/java/decompiler/util/FastFixedSetFactory.java
  22. 6
      src/org/jetbrains/java/decompiler/util/FastSparseSetFactory.java
  23. 4
      src/org/jetbrains/java/decompiler/util/ListStack.java
  24. 5
      src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java
  25. 9
      src/org/jetbrains/java/decompiler/util/VBStyleCollection.java

@ -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; package org.jetbrains.java.decompiler.code;
import org.jetbrains.java.decompiler.main.DecompilerContext; import org.jetbrains.java.decompiler.main.DecompilerContext;
@ -30,6 +30,7 @@ public abstract class InstructionSequence {
// ***************************************************************************** // *****************************************************************************
// to nbe overwritten // to nbe overwritten
@Override
public InstructionSequence clone() { public InstructionSequence clone() {
return null; 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; package org.jetbrains.java.decompiler.code;
import org.jetbrains.java.decompiler.util.VBStyleCollection; import org.jetbrains.java.decompiler.util.VBStyleCollection;
@ -12,6 +12,7 @@ public class SimpleInstructionSequence extends InstructionSequence {
super(collinstr); super(collinstr);
} }
@Override
public SimpleInstructionSequence clone() { public SimpleInstructionSequence clone() {
SimpleInstructionSequence newseq = new SimpleInstructionSequence(collinstr.clone()); SimpleInstructionSequence newseq = new SimpleInstructionSequence(collinstr.clone());
newseq.setPointer(this.getPointer()); 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; package org.jetbrains.java.decompiler.code.cfg;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;
@ -160,6 +160,7 @@ public class BasicBlock implements IGraphNode {
return instrOldOffsets; return instrOldOffsets;
} }
@Override
public List<? extends IGraphNode> getPredecessors() { public List<? extends IGraphNode> getPredecessors() {
List<BasicBlock> lst = new ArrayList<>(preds); List<BasicBlock> lst = new ArrayList<>(preds);
lst.addAll(predExceptions); 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; package org.jetbrains.java.decompiler.main.decompiler;
import org.jetbrains.java.decompiler.main.extern.IFernflowerLogger; import org.jetbrains.java.decompiler.main.extern.IFernflowerLogger;
@ -71,6 +71,7 @@ public class PrintStreamLogger extends IFernflowerLogger {
} }
} }
@Override
public void endMethod() { public void endMethod() {
if (accepts(Severity.INFO)) { if (accepts(Severity.INFO)) {
--indent; --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; package org.jetbrains.java.decompiler.modules.decompiler;
import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent; import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent;
@ -14,11 +14,13 @@ public class ExprentStack extends ListStack<Exprent> {
pointer = list.getPointer(); pointer = list.getPointer();
} }
@Override
public Exprent pop() { public Exprent pop() {
return this.remove(--pointer); return this.remove(--pointer);
} }
@Override
public ExprentStack clone() { public ExprentStack clone() {
return new ExprentStack(this); 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; package org.jetbrains.java.decompiler.modules.decompiler.deobfuscator;
import org.jetbrains.java.decompiler.code.CodeConstants; import org.jetbrains.java.decompiler.code.CodeConstants;
@ -211,10 +211,12 @@ public class ExceptionDeobfuscator {
public static void removeCircularRanges(final ControlFlowGraph graph) { public static void removeCircularRanges(final ControlFlowGraph graph) {
GenericDominatorEngine engine = new GenericDominatorEngine(new IGraph() { GenericDominatorEngine engine = new GenericDominatorEngine(new IGraph() {
@Override
public List<? extends IGraphNode> getReversePostOrderList() { public List<? extends IGraphNode> getReversePostOrderList() {
return graph.getReversePostOrder(); return graph.getReversePostOrder();
} }
@Override
public Set<? extends IGraphNode> getRoots() { public Set<? extends IGraphNode> getRoots() {
return new HashSet<>(Collections.singletonList(graph.getFirst())); return new HashSet<>(Collections.singletonList(graph.getFirst()));
} }

@ -1,6 +1,4 @@
/* // 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.
* 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.
*/
package org.jetbrains.java.decompiler.modules.decompiler.exps; package org.jetbrains.java.decompiler.modules.decompiler.exps;
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer; import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
@ -44,10 +42,12 @@ public class ArrayExprent extends Exprent {
} }
} }
@Override
public int getExprentUse() { public int getExprentUse() {
return array.getExprentUse() & index.getExprentUse() & Exprent.MULTIPLE_USES; return array.getExprentUse() & index.getExprentUse() & Exprent.MULTIPLE_USES;
} }
@Override
public CheckTypesResult checkExprTypeBounds() { public CheckTypesResult checkExprTypeBounds() {
CheckTypesResult result = new CheckTypesResult(); CheckTypesResult result = new CheckTypesResult();
result.addMinTypeExprent(index, VarType.VARTYPE_BYTECHAR); result.addMinTypeExprent(index, VarType.VARTYPE_BYTECHAR);
@ -55,6 +55,7 @@ public class ArrayExprent extends Exprent {
return result; return result;
} }
@Override
public List<Exprent> getAllExprents() { public List<Exprent> getAllExprents() {
List<Exprent> lst = new ArrayList<>(); List<Exprent> lst = new ArrayList<>();
lst.add(array); lst.add(array);

@ -1,6 +1,4 @@
/* // 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.
* 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.
*/
package org.jetbrains.java.decompiler.modules.decompiler.exps; package org.jetbrains.java.decompiler.modules.decompiler.exps;
import org.jetbrains.java.decompiler.code.CodeConstants; import org.jetbrains.java.decompiler.code.CodeConstants;
@ -97,6 +95,7 @@ public class ConstExprent extends Exprent {
return Exprent.MULTIPLE_USES | Exprent.SIDE_EFFECTS_FREE; return Exprent.MULTIPLE_USES | Exprent.SIDE_EFFECTS_FREE;
} }
@Override
public List<Exprent> getAllExprents() { public List<Exprent> getAllExprents() {
return new ArrayList<>(); return new ArrayList<>();
} }

@ -1,6 +1,4 @@
/* // 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.
* 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.
*/
package org.jetbrains.java.decompiler.modules.decompiler.stats; package org.jetbrains.java.decompiler.modules.decompiler.stats;
import org.jetbrains.java.decompiler.code.CodeConstants; 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.SimpleInstructionSequence;
import org.jetbrains.java.decompiler.code.cfg.BasicBlock; import org.jetbrains.java.decompiler.code.cfg.BasicBlock;
import org.jetbrains.java.decompiler.main.DecompilerContext; 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.BytecodeMappingTracer;
import org.jetbrains.java.decompiler.main.collectors.CounterContainer; import org.jetbrains.java.decompiler.main.collectors.CounterContainer;
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor; import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
import org.jetbrains.java.decompiler.util.TextBuffer;
public class BasicBlockStatement extends Statement { public class BasicBlockStatement extends Statement {
@ -55,12 +53,14 @@ public class BasicBlockStatement extends Statement {
// public methods // public methods
// ***************************************************************************** // *****************************************************************************
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
TextBuffer tb = ExprProcessor.listToJava(varDefinitions, indent, tracer); TextBuffer tb = ExprProcessor.listToJava(varDefinitions, indent, tracer);
tb.append(ExprProcessor.listToJava(exprents, indent, tracer)); tb.append(ExprProcessor.listToJava(exprents, indent, tracer));
return tb; return tb;
} }
@Override
public Statement getSimpleCopy() { public Statement getSimpleCopy() {
BasicBlock newblock = new BasicBlock( BasicBlock newblock = new BasicBlock(

@ -1,6 +1,4 @@
/* // 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.
* 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.
*/
package org.jetbrains.java.decompiler.modules.decompiler.stats; package org.jetbrains.java.decompiler.modules.decompiler.stats;
import org.jetbrains.java.decompiler.code.CodeConstants; import org.jetbrains.java.decompiler.code.CodeConstants;
@ -96,6 +94,7 @@ public class CatchAllStatement extends Statement {
return null; return null;
} }
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
String new_line_separator = DecompilerContext.getNewLineSeparator(); String new_line_separator = DecompilerContext.getNewLineSeparator();
@ -146,6 +145,7 @@ public class CatchAllStatement extends Statement {
return buf; return buf;
} }
@Override
public void replaceStatement(Statement oldstat, Statement newstat) { public void replaceStatement(Statement oldstat, Statement newstat) {
if (handler == oldstat) { if (handler == oldstat) {
@ -155,6 +155,7 @@ public class CatchAllStatement extends Statement {
super.replaceStatement(oldstat, newstat); super.replaceStatement(oldstat, newstat);
} }
@Override
public Statement getSimpleCopy() { public Statement getSimpleCopy() {
CatchAllStatement cas = new CatchAllStatement(); CatchAllStatement cas = new CatchAllStatement();
@ -176,6 +177,7 @@ public class CatchAllStatement extends Statement {
return cas; return cas;
} }
@Override
public void initSimpleCopy() { public void initSimpleCopy() {
first = stats.get(0); first = stats.get(0);
handler = stats.get(1); 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.CodeConstants;
import org.jetbrains.java.decompiler.code.cfg.BasicBlock; import org.jetbrains.java.decompiler.code.cfg.BasicBlock;
import org.jetbrains.java.decompiler.main.DecompilerContext; 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.BytecodeMappingTracer;
import org.jetbrains.java.decompiler.main.collectors.CounterContainer; import org.jetbrains.java.decompiler.main.collectors.CounterContainer;
import org.jetbrains.java.decompiler.modules.decompiler.DecHelper; 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.StatEdge;
import org.jetbrains.java.decompiler.modules.decompiler.exps.VarExprent; import org.jetbrains.java.decompiler.modules.decompiler.exps.VarExprent;
import org.jetbrains.java.decompiler.struct.gen.VarType; import org.jetbrains.java.decompiler.struct.gen.VarType;
import org.jetbrains.java.decompiler.util.TextBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -130,6 +130,7 @@ public class CatchStatement extends Statement {
return null; return null;
} }
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
TextBuffer buf = new TextBuffer(); TextBuffer buf = new TextBuffer();
@ -178,6 +179,7 @@ public class CatchStatement extends Statement {
return buf; return buf;
} }
@Override
public Statement getSimpleCopy() { public Statement getSimpleCopy() {
CatchStatement cs = new CatchStatement(); 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. // 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; 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.main.collectors.BytecodeMappingTracer;
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor; import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
import org.jetbrains.java.decompiler.modules.decompiler.StatEdge; import org.jetbrains.java.decompiler.modules.decompiler.StatEdge;
import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent; import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent;
import org.jetbrains.java.decompiler.util.TextBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -77,6 +77,7 @@ public class DoStatement extends Statement {
return null; return null;
} }
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
TextBuffer buf = new TextBuffer(); TextBuffer buf = new TextBuffer();
@ -126,6 +127,7 @@ public class DoStatement extends Statement {
return buf; return buf;
} }
@Override
public List<Object> getSequentialObjects() { public List<Object> getSequentialObjects() {
List<Object> lst = new ArrayList<>(); List<Object> lst = new ArrayList<>();
@ -152,6 +154,7 @@ public class DoStatement extends Statement {
return lst; return lst;
} }
@Override
public void replaceExprent(Exprent oldexpr, Exprent newexpr) { public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
if (initExprent.get(0) == oldexpr) { if (initExprent.get(0) == oldexpr) {
initExprent.set(0, newexpr); initExprent.set(0, newexpr);
@ -164,6 +167,7 @@ public class DoStatement extends Statement {
} }
} }
@Override
public Statement getSimpleCopy() { public Statement getSimpleCopy() {
return new DoStatement(); return new DoStatement();
} }

@ -1,10 +1,8 @@
/* // 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.
* 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.
*/
package org.jetbrains.java.decompiler.modules.decompiler.stats; 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.main.collectors.BytecodeMappingTracer;
import org.jetbrains.java.decompiler.util.TextBuffer;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
@ -41,6 +39,7 @@ public class GeneralStatement extends Statement {
// public methods // public methods
// ***************************************************************************** // *****************************************************************************
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
TextBuffer buf = new TextBuffer(); 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. // 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; 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.main.collectors.BytecodeMappingTracer;
import org.jetbrains.java.decompiler.modules.decompiler.DecHelper; import org.jetbrains.java.decompiler.modules.decompiler.DecHelper;
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor; 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.IMatchable;
import org.jetbrains.java.decompiler.struct.match.MatchEngine; import org.jetbrains.java.decompiler.struct.match.MatchEngine;
import org.jetbrains.java.decompiler.struct.match.MatchNode; import org.jetbrains.java.decompiler.struct.match.MatchNode;
import org.jetbrains.java.decompiler.util.TextBuffer;
import org.jetbrains.java.decompiler.util.TextUtil; import org.jetbrains.java.decompiler.util.TextUtil;
import java.util.ArrayList; import java.util.ArrayList;
@ -187,6 +187,7 @@ public class IfStatement extends Statement {
return null; return null;
} }
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
TextBuffer buf = new TextBuffer(); TextBuffer buf = new TextBuffer();
@ -266,6 +267,7 @@ public class IfStatement extends Statement {
return buf; return buf;
} }
@Override
public void initExprents() { public void initExprents() {
IfExprent ifexpr = (IfExprent)first.getExprents().remove(first.getExprents().size() - 1); IfExprent ifexpr = (IfExprent)first.getExprents().remove(first.getExprents().size() - 1);
@ -278,6 +280,7 @@ public class IfStatement extends Statement {
headexprent.set(0, ifexpr); headexprent.set(0, ifexpr);
} }
@Override
public List<Object> getSequentialObjects() { public List<Object> getSequentialObjects() {
List<Object> lst = new ArrayList<>(stats); List<Object> lst = new ArrayList<>(stats);
@ -286,12 +289,14 @@ public class IfStatement extends Statement {
return lst; return lst;
} }
@Override
public void replaceExprent(Exprent oldexpr, Exprent newexpr) { public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
if (headexprent.get(0) == oldexpr) { if (headexprent.get(0) == oldexpr) {
headexprent.set(0, newexpr); headexprent.set(0, newexpr);
} }
} }
@Override
public void replaceStatement(Statement oldstat, Statement newstat) { public void replaceStatement(Statement oldstat, Statement newstat) {
super.replaceStatement(oldstat, newstat); super.replaceStatement(oldstat, newstat);
@ -324,6 +329,7 @@ public class IfStatement extends Statement {
} }
} }
@Override
public Statement getSimpleCopy() { public Statement getSimpleCopy() {
IfStatement is = new IfStatement(); IfStatement is = new IfStatement();
@ -333,6 +339,7 @@ public class IfStatement extends Statement {
return is; return is;
} }
@Override
public void initSimpleCopy() { public void initSimpleCopy() {
first = stats.get(0); first = stats.get(0);

@ -1,11 +1,9 @@
/* // 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.
* 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.
*/
package org.jetbrains.java.decompiler.modules.decompiler.stats; 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.main.collectors.BytecodeMappingTracer;
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor; import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
import org.jetbrains.java.decompiler.util.TextBuffer;
public class RootStatement extends Statement { public class RootStatement extends Statement {
private final DummyExitStatement dummyExit; private final DummyExitStatement dummyExit;
@ -20,6 +18,7 @@ public class RootStatement extends Statement {
first.setParent(this); first.setParent(this);
} }
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
return ExprProcessor.listToJava(varDefinitions, indent, tracer).append(first.toJava(indent, tracer)); return ExprProcessor.listToJava(varDefinitions, indent, tracer).append(first.toJava(indent, tracer));
} }

@ -1,13 +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.
* 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.
*/
package org.jetbrains.java.decompiler.modules.decompiler.stats; 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.main.collectors.BytecodeMappingTracer;
import org.jetbrains.java.decompiler.modules.decompiler.DecHelper; import org.jetbrains.java.decompiler.modules.decompiler.DecHelper;
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor; import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
import org.jetbrains.java.decompiler.modules.decompiler.StatEdge; import org.jetbrains.java.decompiler.modules.decompiler.StatEdge;
import org.jetbrains.java.decompiler.util.TextBuffer;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -86,6 +84,7 @@ public class SequenceStatement extends Statement {
return null; return null;
} }
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
TextBuffer buf = new TextBuffer(); TextBuffer buf = new TextBuffer();
boolean islabeled = isLabeled(); boolean islabeled = isLabeled();
@ -122,6 +121,7 @@ public class SequenceStatement extends Statement {
return buf; return buf;
} }
@Override
public Statement getSimpleCopy() { public Statement getSimpleCopy() {
return new SequenceStatement(); return new SequenceStatement();
} }

@ -1,12 +1,9 @@
/* // 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.
* 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.
*/
package org.jetbrains.java.decompiler.modules.decompiler.stats; package org.jetbrains.java.decompiler.modules.decompiler.stats;
import org.jetbrains.java.decompiler.code.SwitchInstruction; import org.jetbrains.java.decompiler.code.SwitchInstruction;
import org.jetbrains.java.decompiler.code.cfg.BasicBlock; import org.jetbrains.java.decompiler.code.cfg.BasicBlock;
import org.jetbrains.java.decompiler.main.DecompilerContext; 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.BytecodeMappingTracer;
import org.jetbrains.java.decompiler.main.collectors.CounterContainer; import org.jetbrains.java.decompiler.main.collectors.CounterContainer;
import org.jetbrains.java.decompiler.modules.decompiler.DecHelper; 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.FieldExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.SwitchExprent; import org.jetbrains.java.decompiler.modules.decompiler.exps.SwitchExprent;
import org.jetbrains.java.decompiler.struct.gen.VarType; import org.jetbrains.java.decompiler.struct.gen.VarType;
import org.jetbrains.java.decompiler.util.TextBuffer;
import java.util.*; import java.util.*;
@ -97,6 +95,7 @@ public class SwitchStatement extends Statement {
return null; return null;
} }
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
SwitchHelper.simplify(this); SwitchHelper.simplify(this);
@ -153,6 +152,7 @@ public class SwitchStatement extends Statement {
return buf; return buf;
} }
@Override
public void initExprents() { public void initExprents() {
SwitchExprent swexpr = (SwitchExprent)first.getExprents().remove(first.getExprents().size() - 1); SwitchExprent swexpr = (SwitchExprent)first.getExprents().remove(first.getExprents().size() - 1);
swexpr.setCaseValues(caseValues); swexpr.setCaseValues(caseValues);
@ -160,6 +160,7 @@ public class SwitchStatement extends Statement {
headexprent.set(0, swexpr); headexprent.set(0, swexpr);
} }
@Override
public List<Object> getSequentialObjects() { public List<Object> getSequentialObjects() {
List<Object> lst = new ArrayList<>(stats); List<Object> lst = new ArrayList<>(stats);
@ -168,12 +169,14 @@ public class SwitchStatement extends Statement {
return lst; return lst;
} }
@Override
public void replaceExprent(Exprent oldexpr, Exprent newexpr) { public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
if (headexprent.get(0) == oldexpr) { if (headexprent.get(0) == oldexpr) {
headexprent.set(0, newexpr); headexprent.set(0, newexpr);
} }
} }
@Override
public void replaceStatement(Statement oldstat, Statement newstat) { public void replaceStatement(Statement oldstat, Statement newstat) {
for (int i = 0; i < caseStatements.size(); i++) { for (int i = 0; i < caseStatements.size(); i++) {
@ -185,10 +188,12 @@ public class SwitchStatement extends Statement {
super.replaceStatement(oldstat, newstat); super.replaceStatement(oldstat, newstat);
} }
@Override
public Statement getSimpleCopy() { public Statement getSimpleCopy() {
return new SwitchStatement(); return new SwitchStatement();
} }
@Override
public void initSimpleCopy() { public void initSimpleCopy() {
first = stats.get(0); first = stats.get(0);
default_edge = first.getSuccessorEdges(Statement.STATEDGE_DIRECT_ALL).get(0); default_edge = first.getSuccessorEdges(Statement.STATEDGE_DIRECT_ALL).get(0);

@ -1,16 +1,14 @@
/* // 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.
* 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.
*/
package org.jetbrains.java.decompiler.modules.decompiler.stats; package org.jetbrains.java.decompiler.modules.decompiler.stats;
import org.jetbrains.java.decompiler.code.CodeConstants; import org.jetbrains.java.decompiler.code.CodeConstants;
import org.jetbrains.java.decompiler.code.cfg.BasicBlock; 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.main.collectors.BytecodeMappingTracer;
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor; import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
import org.jetbrains.java.decompiler.modules.decompiler.SequenceHelper; import org.jetbrains.java.decompiler.modules.decompiler.SequenceHelper;
import org.jetbrains.java.decompiler.modules.decompiler.StatEdge; import org.jetbrains.java.decompiler.modules.decompiler.StatEdge;
import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent; import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent;
import org.jetbrains.java.decompiler.util.TextBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -58,6 +56,7 @@ public class SynchronizedStatement extends Statement {
// public methods // public methods
// ***************************************************************************** // *****************************************************************************
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) { public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
TextBuffer buf = new TextBuffer(); TextBuffer buf = new TextBuffer();
buf.append(ExprProcessor.listToJava(varDefinitions, indent, tracer)); buf.append(ExprProcessor.listToJava(varDefinitions, indent, tracer));
@ -88,10 +87,12 @@ public class SynchronizedStatement extends Statement {
} }
} }
@Override
public void initExprents() { public void initExprents() {
headexprent.set(0, first.getExprents().remove(first.getExprents().size() - 1)); headexprent.set(0, first.getExprents().remove(first.getExprents().size() - 1));
} }
@Override
public List<Object> getSequentialObjects() { public List<Object> getSequentialObjects() {
List<Object> lst = new ArrayList<>(stats); List<Object> lst = new ArrayList<>(stats);
@ -100,12 +101,14 @@ public class SynchronizedStatement extends Statement {
return lst; return lst;
} }
@Override
public void replaceExprent(Exprent oldexpr, Exprent newexpr) { public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
if (headexprent.get(0) == oldexpr) { if (headexprent.get(0) == oldexpr) {
headexprent.set(0, newexpr); headexprent.set(0, newexpr);
} }
} }
@Override
public void replaceStatement(Statement oldstat, Statement newstat) { public void replaceStatement(Statement oldstat, Statement newstat) {
if (body == oldstat) { if (body == oldstat) {
@ -122,10 +125,12 @@ public class SynchronizedStatement extends Statement {
stats.removeWithKey(exc.id); stats.removeWithKey(exc.id);
} }
@Override
public Statement getSimpleCopy() { public Statement getSimpleCopy() {
return new SynchronizedStatement(); return new SynchronizedStatement();
} }
@Override
public void initSimpleCopy() { public void initSimpleCopy() {
first = stats.get(0); first = stats.get(0);
body = stats.get(1); 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; package org.jetbrains.java.decompiler.modules.decompiler.vars;
import org.jetbrains.java.decompiler.modules.decompiler.decompose.IGraphNode; import org.jetbrains.java.decompiler.modules.decompiler.decompose.IGraphNode;
@ -31,6 +31,7 @@ public class VarVersionNode implements IGraphNode {
this.version = version; this.version = version;
} }
@Override
public List<IGraphNode> getPredecessors() { public List<IGraphNode> getPredecessors() {
List<IGraphNode> lst = new ArrayList<>(preds.size()); List<IGraphNode> lst = new ArrayList<>(preds.size());
for (VarVersionEdge edge : preds) { 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; package org.jetbrains.java.decompiler.modules.decompiler.vars;
import org.jetbrains.java.decompiler.modules.decompiler.decompose.GenericDominatorEngine; import org.jetbrains.java.decompiler.modules.decompiler.decompose.GenericDominatorEngine;
@ -72,10 +72,12 @@ public class VarVersionsGraph {
} }
engine = new GenericDominatorEngine(new IGraph() { engine = new GenericDominatorEngine(new IGraph() {
@Override
public List<? extends IGraphNode> getReversePostOrderList() { public List<? extends IGraphNode> getReversePostOrderList() {
return getReversedPostOrder(roots); return getReversedPostOrder(roots);
} }
@Override
public Set<? extends IGraphNode> getRoots() { public Set<? extends IGraphNode> getRoots() {
return new HashSet<IGraphNode>(roots); 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; package org.jetbrains.java.decompiler.util;
import java.util.Collection; import java.util.Collection;
@ -174,6 +174,7 @@ public class FastFixedSetFactory<E> {
return true; return true;
} }
@Override
public Iterator<E> iterator() { public Iterator<E> iterator() {
return new FastFixedSetIterator<>(this); return new FastFixedSetIterator<>(this);
} }
@ -288,11 +289,13 @@ public class FastFixedSetFactory<E> {
return -1; return -1;
} }
@Override
public boolean hasNext() { public boolean hasNext() {
next_pointer = getNextIndex(pointer); next_pointer = getNextIndex(pointer);
return (next_pointer >= 0); return (next_pointer >= 0);
} }
@Override
public E next() { public E next() {
if (next_pointer >= 0) { if (next_pointer >= 0) {
pointer = next_pointer; pointer = next_pointer;
@ -308,6 +311,7 @@ public class FastFixedSetFactory<E> {
return pointer < size ? colValuesInternal.getKey(pointer) : null; return pointer < size ? colValuesInternal.getKey(pointer) : null;
} }
@Override
public void remove() { public void remove() {
int[] index = colValuesInternal.get(pointer); int[] index = colValuesInternal.get(pointer);
data[index[0]] &= ~index[1]; 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; package org.jetbrains.java.decompiler.util;
import java.util.Collection; import java.util.Collection;
@ -317,6 +317,7 @@ public class FastSparseSetFactory<E> {
return data.length == 0 || (next[0] == 0 && data[0] == 0); return data.length == 0 || (next[0] == 0 && data[0] == 0);
} }
@Override
public Iterator<E> iterator() { public Iterator<E> iterator() {
return new FastSparseSetIterator<>(this); return new FastSparseSetIterator<>(this);
} }
@ -407,11 +408,13 @@ public class FastSparseSetFactory<E> {
return -1; return -1;
} }
@Override
public boolean hasNext() { public boolean hasNext() {
next_pointer = getNextIndex(pointer); next_pointer = getNextIndex(pointer);
return (next_pointer >= 0); return (next_pointer >= 0);
} }
@Override
public E next() { public E next() {
if (next_pointer >= 0) { if (next_pointer >= 0) {
pointer = next_pointer; pointer = next_pointer;
@ -427,6 +430,7 @@ public class FastSparseSetFactory<E> {
return pointer < size ? colValuesInternal.getKey(pointer) : null; return pointer < size ? colValuesInternal.getKey(pointer) : null;
} }
@Override
public void remove() { public void remove() {
int[] index = colValuesInternal.get(pointer); int[] index = colValuesInternal.get(pointer);
data[index[0]] &= ~index[1]; 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; package org.jetbrains.java.decompiler.util;
import java.util.ArrayList; import java.util.ArrayList;
@ -14,6 +14,7 @@ public class ListStack<T> extends ArrayList<T> {
super(list); super(list);
} }
@Override
@SuppressWarnings("MethodDoesntCallSuperMethod") @SuppressWarnings("MethodDoesntCallSuperMethod")
public ListStack<T> clone() { public ListStack<T> clone() {
ListStack<T> copy = new ListStack<>(this); ListStack<T> copy = new ListStack<>(this);
@ -62,6 +63,7 @@ public class ListStack<T> extends ArrayList<T> {
pointer++; pointer++;
} }
@Override
public void clear() { public void clear() {
super.clear(); super.clear();
pointer = 0; 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; package org.jetbrains.java.decompiler.util;
import org.jetbrains.java.decompiler.modules.decompiler.exps.VarExprent; import org.jetbrains.java.decompiler.modules.decompiler.exps.VarExprent;
@ -348,14 +348,17 @@ public class SFormsFastMapDirect {
private final Integer var = key; private final Integer var = key;
private final FastSparseSet<Integer> val = ent; private final FastSparseSet<Integer> val = ent;
@Override
public Integer getKey() { public Integer getKey() {
return var; return var;
} }
@Override
public FastSparseSet<Integer> getValue() { public FastSparseSet<Integer> getValue() {
return val; return val;
} }
@Override
public FastSparseSet<Integer> setValue(FastSparseSet<Integer> newvalue) { public FastSparseSet<Integer> setValue(FastSparseSet<Integer> newvalue) {
return null; 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; package org.jetbrains.java.decompiler.util;
import java.util.ArrayList; import java.util.ArrayList;
@ -21,16 +21,19 @@ public class VBStyleCollection<E, K> extends ArrayList<E> {
map = new HashMap<>(initialCapacity); map = new HashMap<>(initialCapacity);
} }
@Override
public boolean add(E element) { public boolean add(E element) {
lstKeys.add(null); lstKeys.add(null);
super.add(element); super.add(element);
return true; return true;
} }
@Override
public boolean remove(Object element) { // TODO: error on void remove(E element) public boolean remove(Object element) { // TODO: error on void remove(E element)
throw new RuntimeException("not implemented!"); throw new RuntimeException("not implemented!");
} }
@Override
public boolean addAll(Collection<? extends E> c) { public boolean addAll(Collection<? extends E> c) {
for (int i = c.size() - 1; i >= 0; i--) { for (int i = c.size() - 1; i >= 0; i--) {
lstKeys.add(null); lstKeys.add(null);
@ -67,6 +70,7 @@ public class VBStyleCollection<E, K> extends ArrayList<E> {
return null; return null;
} }
@Override
public void add(int index, E element) { public void add(int index, E element) {
addToListIndex(index, 1); addToListIndex(index, 1);
lstKeys.add(index, null); lstKeys.add(index, null);
@ -88,6 +92,7 @@ public class VBStyleCollection<E, K> extends ArrayList<E> {
map.remove(key); map.remove(key);
} }
@Override
public E remove(int index) { public E remove(int index) {
addToListIndex(index + 1, -1); addToListIndex(index + 1, -1);
K obj = lstKeys.get(index); K obj = lstKeys.get(index);
@ -118,12 +123,14 @@ public class VBStyleCollection<E, K> extends ArrayList<E> {
return map.containsKey(key); return map.containsKey(key);
} }
@Override
public void clear() { public void clear() {
map.clear(); map.clear();
lstKeys.clear(); lstKeys.clear();
super.clear(); super.clear();
} }
@Override
public VBStyleCollection<E, K> clone() { public VBStyleCollection<E, K> clone() {
VBStyleCollection<E, K> c = new VBStyleCollection<>(); VBStyleCollection<E, K> c = new VBStyleCollection<>();
c.addAll(new ArrayList<>(this)); c.addAll(new ArrayList<>(this));

Loading…
Cancel
Save