decompiler: cleanup - marked const fields final

master
Egor.Ushakov 10 years ago
parent 9ec79b5701
commit ca7e2dfa1c
  1. 6
      src/org/jetbrains/java/decompiler/code/ConstantsUtil.java
  2. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/ALOAD.java
  3. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/ASTORE.java
  4. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/BIPUSH.java
  5. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/DLOAD.java
  6. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/DSTORE.java
  7. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/FLOAD.java
  8. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/FSTORE.java
  9. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/ILOAD.java
  10. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/ISTORE.java
  11. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/LLOAD.java
  12. 4
      src/org/jetbrains/java/decompiler/code/optinstructions/LSTORE.java
  13. 4
      src/org/jetbrains/java/decompiler/main/ClassWriter.java
  14. 4
      src/org/jetbrains/java/decompiler/main/ClassesProcessor.java
  15. 4
      src/org/jetbrains/java/decompiler/main/DecompilerContext.java
  16. 4
      src/org/jetbrains/java/decompiler/main/Fernflower.java
  17. 2
      src/org/jetbrains/java/decompiler/main/collectors/BytecodeMappingTracer.java
  18. 4
      src/org/jetbrains/java/decompiler/main/collectors/CounterContainer.java
  19. 6
      src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java
  20. 4
      src/org/jetbrains/java/decompiler/main/collectors/VarNamesCollector.java
  21. 4
      src/org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler.java
  22. 12
      src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java
  23. 4
      src/org/jetbrains/java/decompiler/main/rels/NestedMemberAccess.java
  24. 2
      src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java
  25. 6
      src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java
  26. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/PrimitiveExprsList.java
  27. 2
      src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java
  28. 6
      src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.java
  29. 10
      src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorTreeExceptionFilter.java
  30. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java
  31. 6
      src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.java
  32. 2
      src/org/jetbrains/java/decompiler/modules/decompiler/exps/NewExprent.java
  33. 12
      src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.java
  34. 16
      src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAConstructorSparseEx.java
  35. 24
      src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.java
  36. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/BasicBlockStatement.java
  37. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java
  38. 6
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchStatement.java
  39. 8
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/DoStatement.java
  40. 20
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java
  41. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.java
  42. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/stats/SynchronizedStatement.java
  43. 6
      src/org/jetbrains/java/decompiler/modules/decompiler/vars/CheckTypesResult.java
  44. 10
      src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java
  45. 6
      src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarProcessor.java
  46. 8
      src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarTypeProcessor.java
  47. 4
      src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionEdge.java
  48. 6
      src/org/jetbrains/java/decompiler/modules/renamer/ClassWrapperNode.java
  49. 4
      src/org/jetbrains/java/decompiler/modules/renamer/ConverterHelper.java
  50. 8
      src/org/jetbrains/java/decompiler/modules/renamer/PoolInterceptor.java
  51. 6
      src/org/jetbrains/java/decompiler/struct/attr/StructBootstrapMethodsAttribute.java
  52. 4
      src/org/jetbrains/java/decompiler/struct/consts/ConstantPool.java
  53. 33
      src/org/jetbrains/java/decompiler/struct/match/MatchEngine.java
  54. 21
      src/org/jetbrains/java/decompiler/struct/match/MatchNode.java
  55. 16
      src/org/jetbrains/java/decompiler/util/FastFixedSetFactory.java
  56. 12
      src/org/jetbrains/java/decompiler/util/FastSetFactory.java
  57. 16
      src/org/jetbrains/java/decompiler/util/FastSparseSetFactory.java
  58. 10
      src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -69,7 +69,7 @@ public class ConstantsUtil {
} }
private static String[] opcodeNames = { private static final String[] opcodeNames = {
"nop", // "nop", "nop", // "nop",
"aconst_null", // "aconst_null", "aconst_null", // "aconst_null",
"iconst_m1", // "iconst_m1", "iconst_m1", // "iconst_m1",
@ -275,7 +275,7 @@ public class ConstantsUtil {
"jsr_w" // "jsr_w" "jsr_w" // "jsr_w"
}; };
private static Class[] opcodeClasses = { private static final Class[] opcodeClasses = {
null, // "nop", null, // "nop",
null, // "aconst_null", null, // "aconst_null",
null, // "iconst_m1", null, // "iconst_m1",

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class ALOAD extends Instruction { public class ALOAD extends Instruction {
private static int[] opcodes = new int[]{opc_aload_0, opc_aload_1, opc_aload_2, opc_aload_3}; private static final int[] opcodes = new int[]{opc_aload_0, opc_aload_1, opc_aload_2, opc_aload_3};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class ASTORE extends Instruction { public class ASTORE extends Instruction {
private static int[] opcodes = new int[]{opc_astore_0, opc_astore_1, opc_astore_2, opc_astore_3}; private static final int[] opcodes = new int[]{opc_astore_0, opc_astore_1, opc_astore_2, opc_astore_3};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class BIPUSH extends Instruction { public class BIPUSH extends Instruction {
private static int[] opcodes = private static final int[] opcodes =
new int[]{opc_iconst_m1, opc_iconst_0, opc_iconst_1, opc_iconst_2, opc_iconst_3, opc_iconst_4, opc_iconst_5}; new int[]{opc_iconst_m1, opc_iconst_0, opc_iconst_1, opc_iconst_2, opc_iconst_3, opc_iconst_4, opc_iconst_5};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class DLOAD extends Instruction { public class DLOAD extends Instruction {
private static int[] opcodes = new int[]{opc_dload_0, opc_dload_1, opc_dload_2, opc_dload_3}; private static final int[] opcodes = new int[]{opc_dload_0, opc_dload_1, opc_dload_2, opc_dload_3};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class DSTORE extends Instruction { public class DSTORE extends Instruction {
private static int[] opcodes = new int[]{opc_dstore_0, opc_dstore_1, opc_dstore_2, opc_dstore_3}; private static final int[] opcodes = new int[]{opc_dstore_0, opc_dstore_1, opc_dstore_2, opc_dstore_3};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class FLOAD extends Instruction { public class FLOAD extends Instruction {
private static int[] opcodes = new int[]{opc_fload_0, opc_fload_1, opc_fload_2, opc_fload_3}; private static final int[] opcodes = new int[]{opc_fload_0, opc_fload_1, opc_fload_2, opc_fload_3};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class FSTORE extends Instruction { public class FSTORE extends Instruction {
private static int[] opcodes = new int[]{opc_fstore_0, opc_fstore_1, opc_fstore_2, opc_fstore_3}; private static final int[] opcodes = new int[]{opc_fstore_0, opc_fstore_1, opc_fstore_2, opc_fstore_3};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class ILOAD extends Instruction { public class ILOAD extends Instruction {
private static int[] opcodes = new int[]{opc_iload_0, opc_iload_1, opc_iload_2, opc_iload_3}; private static final int[] opcodes = new int[]{opc_iload_0, opc_iload_1, opc_iload_2, opc_iload_3};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class ISTORE extends Instruction { public class ISTORE extends Instruction {
private static int[] opcodes = new int[]{opc_istore_0, opc_istore_1, opc_istore_2, opc_istore_3}; private static final int[] opcodes = new int[]{opc_istore_0, opc_istore_1, opc_istore_2, opc_istore_3};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class LLOAD extends Instruction { public class LLOAD extends Instruction {
private static int[] opcodes = new int[]{opc_lload_0, opc_lload_1, opc_lload_2, opc_lload_3}; private static final int[] opcodes = new int[]{opc_lload_0, opc_lload_1, opc_lload_2, opc_lload_3};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.io.IOException;
public class LSTORE extends Instruction { public class LSTORE extends Instruction {
private static int[] opcodes = new int[]{opc_lstore_0, opc_lstore_1, opc_lstore_2, opc_lstore_3}; private static final int[] opcodes = new int[]{opc_lstore_0, opc_lstore_1, opc_lstore_2, opc_lstore_3};
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);

@ -47,8 +47,8 @@ import java.util.*;
public class ClassWriter { public class ClassWriter {
private ClassReference14Processor ref14processor; private final ClassReference14Processor ref14processor;
private PoolInterceptor interceptor; private final PoolInterceptor interceptor;
public ClassWriter() { public ClassWriter() {
ref14processor = new ClassReference14Processor(); ref14processor = new ClassReference14Processor();

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -43,7 +43,7 @@ public class ClassesProcessor {
public static final int AVERAGE_CLASS_SIZE = 16 * 1024; public static final int AVERAGE_CLASS_SIZE = 16 * 1024;
private Map<String, ClassNode> mapRootClasses = new HashMap<String, ClassNode>(); private final Map<String, ClassNode> mapRootClasses = new HashMap<String, ClassNode>();
public ClassesProcessor(StructContext context) { public ClassesProcessor(StructContext context) {

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -37,7 +37,7 @@ public class DecompilerContext {
public static final String CURRENT_METHOD_WRAPPER = "CURRENT_METHOD_WRAPPER"; public static final String CURRENT_METHOD_WRAPPER = "CURRENT_METHOD_WRAPPER";
public static final String CURRENT_VAR_PROCESSOR = "CURRENT_VAR_PROCESSOR"; public static final String CURRENT_VAR_PROCESSOR = "CURRENT_VAR_PROCESSOR";
private static ThreadLocal<DecompilerContext> currentContext = new ThreadLocal<DecompilerContext>(); private static final ThreadLocal<DecompilerContext> currentContext = new ThreadLocal<DecompilerContext>();
private final Map<String, Object> properties; private final Map<String, Object> properties;
private StructContext structContext; private StructContext structContext;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -31,7 +31,7 @@ import java.util.Map;
public class Fernflower implements IDecompiledData { public class Fernflower implements IDecompiledData {
private StructContext structContext; private final StructContext structContext;
private ClassesProcessor classesProcessor; private ClassesProcessor classesProcessor;
public Fernflower(IBytecodeProvider provider, IResultSaver saver, Map<String, Object> options, IFernflowerLogger logger) { public Fernflower(IBytecodeProvider provider, IResultSaver saver, Map<String, Object> options, IFernflowerLogger logger) {

@ -27,7 +27,7 @@ public class BytecodeMappingTracer {
private StructLineNumberTableAttribute lineNumberTable = null; private StructLineNumberTableAttribute lineNumberTable = null;
// bytecode offset, source line // bytecode offset, source line
private Map<Integer, Integer> mapping = new HashMap<Integer, Integer>(); private final Map<Integer, Integer> mapping = new HashMap<Integer, Integer>();
public BytecodeMappingTracer() { } public BytecodeMappingTracer() { }

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -21,7 +21,7 @@ public class CounterContainer {
public static final int EXPRENT_COUNTER = 1; public static final int EXPRENT_COUNTER = 1;
public static final int VAR_COUNTER = 2; public static final int VAR_COUNTER = 2;
private int[] values = new int[]{1, 1, 1}; private final int[] values = new int[]{1, 1, 1};
public void setCounter(int counter, int value) { public void setCounter(int counter, int value) {
values[counter] = value; values[counter] = value;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -29,8 +29,8 @@ public class ImportCollector {
private static final String JAVA_LANG_PACKAGE = "java.lang"; private static final String JAVA_LANG_PACKAGE = "java.lang";
private Map<String, String> mapSimpleNames = new HashMap<String, String>(); private final Map<String, String> mapSimpleNames = new HashMap<String, String>();
private Set<String> setNotImportedNames = new HashSet<String>(); private final Set<String> setNotImportedNames = new HashSet<String>();
private String currentPackageSlash = ""; private String currentPackageSlash = "";
private String currentPackagePoint = ""; private String currentPackagePoint = "";

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -20,7 +20,7 @@ import java.util.Set;
public class VarNamesCollector { public class VarNamesCollector {
private Set<String> usedNames = new HashSet<String>(); private final Set<String> usedNames = new HashSet<String>();
public VarNamesCollector() { } public VarNamesCollector() { }

@ -113,8 +113,8 @@ public class ConsoleDecompiler implements IBytecodeProvider, IResultSaver {
private final File root; private final File root;
private final Fernflower fernflower; private final Fernflower fernflower;
private Map<String, ZipOutputStream> mapArchiveStreams = new HashMap<String, ZipOutputStream>(); private final Map<String, ZipOutputStream> mapArchiveStreams = new HashMap<String, ZipOutputStream>();
private Map<String, Set<String>> mapArchiveEntries = new HashMap<String, Set<String>>(); private final Map<String, Set<String>> mapArchiveEntries = new HashMap<String, Set<String>>();
@SuppressWarnings("UseOfSystemOutOrSystemErr") @SuppressWarnings("UseOfSystemOutOrSystemErr")
public ConsoleDecompiler(File destination, Map<String, Object> options) { public ConsoleDecompiler(File destination, Map<String, Object> options) {

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -40,11 +40,11 @@ import java.util.Set;
public class ClassWrapper { public class ClassWrapper {
private StructClass classStruct; private final StructClass classStruct;
private Set<String> hiddenMembers = new HashSet<String>(); private final Set<String> hiddenMembers = new HashSet<String>();
private VBStyleCollection<Exprent, String> staticFieldInitializers = new VBStyleCollection<Exprent, String>(); private final VBStyleCollection<Exprent, String> staticFieldInitializers = new VBStyleCollection<Exprent, String>();
private VBStyleCollection<Exprent, String> dynamicFieldInitializers = new VBStyleCollection<Exprent, String>(); private final VBStyleCollection<Exprent, String> dynamicFieldInitializers = new VBStyleCollection<Exprent, String>();
private VBStyleCollection<MethodWrapper, String> methods = new VBStyleCollection<MethodWrapper, String>(); private final VBStyleCollection<MethodWrapper, String> methods = new VBStyleCollection<MethodWrapper, String>();
public ClassWrapper(StructClass classStruct) { public ClassWrapper(StructClass classStruct) {
this.classStruct = classStruct; this.classStruct = classStruct;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -42,7 +42,7 @@ public class NestedMemberAccess {
private static final int METHOD_ACCESS_METHOD = 4; private static final int METHOD_ACCESS_METHOD = 4;
private boolean noSynthFlag; private boolean noSynthFlag;
private Map<MethodWrapper, Integer> mapMethodType = new HashMap<MethodWrapper, Integer>(); private final Map<MethodWrapper, Integer> mapMethodType = new HashMap<MethodWrapper, Integer>();
public void propagateMemberAccess(ClassNode root) { public void propagateMemberAccess(ClassNode root) {

@ -141,7 +141,7 @@ public class ExprProcessor implements CodeConstants {
private static final String[] typeNames = new String[]{"byte", "char", "double", "float", "int", "long", "short", "boolean",}; private static final String[] typeNames = new String[]{"byte", "char", "double", "float", "int", "long", "short", "boolean",};
private VarProcessor varProcessor = (VarProcessor)DecompilerContext.getProperty(DecompilerContext.CURRENT_VAR_PROCESSOR); private final VarProcessor varProcessor = (VarProcessor)DecompilerContext.getProperty(DecompilerContext.CURRENT_VAR_PROCESSOR);
public void processStatement(RootStatement root, StructClass cl) { public void processStatement(RootStatement root, StructClass cl) {

@ -46,10 +46,10 @@ import java.util.Map.Entry;
public class FinallyProcessor { public class FinallyProcessor {
private Map<Integer, Integer> finallyBlockIDs = new HashMap<Integer, Integer>(); private final Map<Integer, Integer> finallyBlockIDs = new HashMap<Integer, Integer>();
private Map<Integer, Integer> catchallBlockIDs = new HashMap<Integer, Integer>(); private final Map<Integer, Integer> catchallBlockIDs = new HashMap<Integer, Integer>();
private VarProcessor varprocessor; private final VarProcessor varprocessor;
public FinallyProcessor(VarProcessor varprocessor) { public FinallyProcessor(VarProcessor varprocessor) {
this.varprocessor = varprocessor; this.varprocessor = varprocessor;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.util.List;
public class PrimitiveExprsList { public class PrimitiveExprsList {
private List<Exprent> lstExprents = new ArrayList<Exprent>(); private final List<Exprent> lstExprents = new ArrayList<Exprent>();
private ExprentStack stack = new ExprentStack(); private ExprentStack stack = new ExprentStack();

@ -53,7 +53,7 @@ public class SimplifyExprentsHelper {
static MatchEngine class14Builder = new MatchEngine(); static MatchEngine class14Builder = new MatchEngine();
private boolean firstInvocation; private final boolean firstInvocation;
public SimplifyExprentsHelper(boolean firstInvocation) { public SimplifyExprentsHelper(boolean firstInvocation) {
this.firstInvocation = firstInvocation; this.firstInvocation = firstInvocation;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -23,9 +23,9 @@ import java.util.List;
public class DominatorEngine { public class DominatorEngine {
private Statement statement; private final Statement statement;
private VBStyleCollection<Integer, Integer> colOrderedIDoms = new VBStyleCollection<Integer, Integer>(); private final VBStyleCollection<Integer, Integer> colOrderedIDoms = new VBStyleCollection<Integer, Integer>();
public DominatorEngine(Statement statement) { public DominatorEngine(Statement statement) {

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -24,19 +24,19 @@ import java.util.Map.Entry;
public class DominatorTreeExceptionFilter { public class DominatorTreeExceptionFilter {
private Statement statement; private final Statement statement;
// idom, nodes // idom, nodes
private Map<Integer, Set<Integer>> mapTreeBranches = new HashMap<Integer, Set<Integer>>(); private final Map<Integer, Set<Integer>> mapTreeBranches = new HashMap<Integer, Set<Integer>>();
// handler, range nodes // handler, range nodes
private Map<Integer, Set<Integer>> mapExceptionRanges = new HashMap<Integer, Set<Integer>>(); private final Map<Integer, Set<Integer>> mapExceptionRanges = new HashMap<Integer, Set<Integer>>();
// handler, head dom // handler, head dom
private Map<Integer, Integer> mapExceptionDoms = new HashMap<Integer, Integer>(); private Map<Integer, Integer> mapExceptionDoms = new HashMap<Integer, Integer>();
// statement, handler, exit nodes // statement, handler, exit nodes
private Map<Integer, Map<Integer, Integer>> mapExceptionRangeUniqueExit = new HashMap<Integer, Map<Integer, Integer>>(); private final Map<Integer, Map<Integer, Integer>> mapExceptionRangeUniqueExit = new HashMap<Integer, Map<Integer, Integer>>();
private DominatorEngine domEngine; private DominatorEngine domEngine;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -30,7 +30,7 @@ public class FastExtendedPostdominanceHelper {
private HashMap<Integer, FastFixedSet<Integer>> mapSupportPoints = new HashMap<Integer, FastFixedSet<Integer>>(); private HashMap<Integer, FastFixedSet<Integer>> mapSupportPoints = new HashMap<Integer, FastFixedSet<Integer>>();
private HashMap<Integer, FastFixedSet<Integer>> mapExtPostdominators = new HashMap<Integer, FastFixedSet<Integer>>(); private final HashMap<Integer, FastFixedSet<Integer>> mapExtPostdominators = new HashMap<Integer, FastFixedSet<Integer>>();
private Statement statement; private Statement statement;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,9 +22,9 @@ import java.util.Set;
public class GenericDominatorEngine { public class GenericDominatorEngine {
private IGraph graph; private final IGraph graph;
private VBStyleCollection<IGraphNode, IGraphNode> colOrderedIDoms = new VBStyleCollection<IGraphNode, IGraphNode>(); private final VBStyleCollection<IGraphNode, IGraphNode> colOrderedIDoms = new VBStyleCollection<IGraphNode, IGraphNode>();
private Set<? extends IGraphNode> setRoots; private Set<? extends IGraphNode> setRoots;

@ -38,7 +38,7 @@ import java.util.Set;
public class NewExprent extends Exprent { public class NewExprent extends Exprent {
private InvocationExprent constructor; private InvocationExprent constructor;
private VarType newType; private final VarType newType;
private List<Exprent> lstDims = new ArrayList<Exprent>(); private List<Exprent> lstDims = new ArrayList<Exprent>();
private List<Exprent> lstArrayElements = new ArrayList<Exprent>(); private List<Exprent> lstArrayElements = new ArrayList<Exprent>();
private boolean directArrayInit; private boolean directArrayInit;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,19 +26,19 @@ import java.util.Map.Entry;
public class FlattenStatementsHelper { public class FlattenStatementsHelper {
// statement.id, node.id(direct), node.id(continue) // statement.id, node.id(direct), node.id(continue)
private Map<Integer, String[]> mapDestinationNodes = new HashMap<Integer, String[]>(); private final Map<Integer, String[]> mapDestinationNodes = new HashMap<Integer, String[]>();
// node.id(source), statement.id(destination), edge type // node.id(source), statement.id(destination), edge type
private List<Edge> listEdges = new ArrayList<Edge>(); private final List<Edge> listEdges = new ArrayList<Edge>();
// node.id(exit), [node.id(source), statement.id(destination)] // node.id(exit), [node.id(source), statement.id(destination)]
private Map<String, List<String[]>> mapShortRangeFinallyPathIds = new HashMap<String, List<String[]>>(); private final Map<String, List<String[]>> mapShortRangeFinallyPathIds = new HashMap<String, List<String[]>>();
// node.id(exit), [node.id(source), statement.id(destination)] // node.id(exit), [node.id(source), statement.id(destination)]
private Map<String, List<String[]>> mapLongRangeFinallyPathIds = new HashMap<String, List<String[]>>(); private final Map<String, List<String[]>> mapLongRangeFinallyPathIds = new HashMap<String, List<String[]>>();
// positive if branches // positive if branches
private Map<String, Integer> mapPosIfBranch = new HashMap<String, Integer>(); private final Map<String, Integer> mapPosIfBranch = new HashMap<String, Integer>();
private DirectGraph graph; private DirectGraph graph;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -42,24 +42,24 @@ import java.util.Map.Entry;
public class SSAConstructorSparseEx { public class SSAConstructorSparseEx {
// node id, var, version // node id, var, version
private HashMap<String, SFormsFastMapDirect> inVarVersions = new HashMap<String, SFormsFastMapDirect>(); private final HashMap<String, SFormsFastMapDirect> inVarVersions = new HashMap<String, SFormsFastMapDirect>();
// node id, var, version (direct branch) // node id, var, version (direct branch)
private HashMap<String, SFormsFastMapDirect> outVarVersions = new HashMap<String, SFormsFastMapDirect>(); private final HashMap<String, SFormsFastMapDirect> outVarVersions = new HashMap<String, SFormsFastMapDirect>();
// node id, var, version (negative branch) // node id, var, version (negative branch)
private HashMap<String, SFormsFastMapDirect> outNegVarVersions = new HashMap<String, SFormsFastMapDirect>(); private final HashMap<String, SFormsFastMapDirect> outNegVarVersions = new HashMap<String, SFormsFastMapDirect>();
// node id, var, version // node id, var, version
private HashMap<String, SFormsFastMapDirect> extraVarVersions = new HashMap<String, SFormsFastMapDirect>(); private final HashMap<String, SFormsFastMapDirect> extraVarVersions = new HashMap<String, SFormsFastMapDirect>();
// (var, version), version // (var, version), version
private HashMap<VarVersionPair, FastSparseSet<Integer>> phi = new HashMap<VarVersionPair, FastSparseSet<Integer>>(); private final HashMap<VarVersionPair, FastSparseSet<Integer>> phi = new HashMap<VarVersionPair, FastSparseSet<Integer>>();
// var, version // var, version
private HashMap<Integer, Integer> lastversion = new HashMap<Integer, Integer>(); private final HashMap<Integer, Integer> lastversion = new HashMap<Integer, Integer>();
private List<VarVersionPair> startVars = new ArrayList<VarVersionPair>(); private final List<VarVersionPair> startVars = new ArrayList<VarVersionPair>();
// set factory // set factory
private FastSparseSetFactory<Integer> factory; private FastSparseSetFactory<Integer> factory;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -40,42 +40,42 @@ import java.util.Map.Entry;
public class SSAUConstructorSparseEx { public class SSAUConstructorSparseEx {
// node id, var, version // node id, var, version
private HashMap<String, SFormsFastMapDirect> inVarVersions = new HashMap<String, SFormsFastMapDirect>(); private final HashMap<String, SFormsFastMapDirect> inVarVersions = new HashMap<String, SFormsFastMapDirect>();
//private HashMap<String, HashMap<Integer, FastSet<Integer>>> inVarVersions = new HashMap<String, HashMap<Integer, FastSet<Integer>>>(); //private HashMap<String, HashMap<Integer, FastSet<Integer>>> inVarVersions = new HashMap<String, HashMap<Integer, FastSet<Integer>>>();
// node id, var, version (direct branch) // node id, var, version (direct branch)
private HashMap<String, SFormsFastMapDirect> outVarVersions = new HashMap<String, SFormsFastMapDirect>(); private final HashMap<String, SFormsFastMapDirect> outVarVersions = new HashMap<String, SFormsFastMapDirect>();
//private HashMap<String, HashMap<Integer, FastSet<Integer>>> outVarVersions = new HashMap<String, HashMap<Integer, FastSet<Integer>>>(); //private HashMap<String, HashMap<Integer, FastSet<Integer>>> outVarVersions = new HashMap<String, HashMap<Integer, FastSet<Integer>>>();
// node id, var, version (negative branch) // node id, var, version (negative branch)
private HashMap<String, SFormsFastMapDirect> outNegVarVersions = new HashMap<String, SFormsFastMapDirect>(); private final HashMap<String, SFormsFastMapDirect> outNegVarVersions = new HashMap<String, SFormsFastMapDirect>();
//private HashMap<String, HashMap<Integer, FastSet<Integer>>> outNegVarVersions = new HashMap<String, HashMap<Integer, FastSet<Integer>>>(); //private HashMap<String, HashMap<Integer, FastSet<Integer>>> outNegVarVersions = new HashMap<String, HashMap<Integer, FastSet<Integer>>>();
// node id, var, version // node id, var, version
private HashMap<String, SFormsFastMapDirect> extraVarVersions = new HashMap<String, SFormsFastMapDirect>(); private final HashMap<String, SFormsFastMapDirect> extraVarVersions = new HashMap<String, SFormsFastMapDirect>();
//private HashMap<String, HashMap<Integer, FastSet<Integer>>> extraVarVersions = new HashMap<String, HashMap<Integer, FastSet<Integer>>>(); //private HashMap<String, HashMap<Integer, FastSet<Integer>>> extraVarVersions = new HashMap<String, HashMap<Integer, FastSet<Integer>>>();
// (var, version), version // (var, version), version
private HashMap<VarVersionPair, HashSet<Integer>> phi = new HashMap<VarVersionPair, HashSet<Integer>>(); private final HashMap<VarVersionPair, HashSet<Integer>> phi = new HashMap<VarVersionPair, HashSet<Integer>>();
// var, version // var, version
private HashMap<Integer, Integer> lastversion = new HashMap<Integer, Integer>(); private final HashMap<Integer, Integer> lastversion = new HashMap<Integer, Integer>();
// version, protected ranges (catch, finally) // version, protected ranges (catch, finally)
private HashMap<VarVersionPair, Integer> mapVersionFirstRange = new HashMap<VarVersionPair, Integer>(); private final HashMap<VarVersionPair, Integer> mapVersionFirstRange = new HashMap<VarVersionPair, Integer>();
// version, version // version, version
private HashMap<VarVersionPair, VarVersionPair> phantomppnodes = new HashMap<VarVersionPair, VarVersionPair>(); // ++ and -- private final HashMap<VarVersionPair, VarVersionPair> phantomppnodes = new HashMap<VarVersionPair, VarVersionPair>(); // ++ and --
// node.id, version, version // node.id, version, version
private HashMap<String, HashMap<VarVersionPair, VarVersionPair>> phantomexitnodes = private final HashMap<String, HashMap<VarVersionPair, VarVersionPair>> phantomexitnodes =
new HashMap<String, HashMap<VarVersionPair, VarVersionPair>>(); // finally exits new HashMap<String, HashMap<VarVersionPair, VarVersionPair>>(); // finally exits
// versions memory dependencies // versions memory dependencies
private VarVersionsGraph ssuversions = new VarVersionsGraph(); private final VarVersionsGraph ssuversions = new VarVersionsGraph();
// field access vars (exprent id, var id) // field access vars (exprent id, var id)
private HashMap<Integer, Integer> mapFieldVars = new HashMap<Integer, Integer>(); private final HashMap<Integer, Integer> mapFieldVars = new HashMap<Integer, Integer>();
// field access counter // field access counter
private int fieldvarcounter = -1; private int fieldvarcounter = -1;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -31,7 +31,7 @@ public class BasicBlockStatement extends Statement {
// private fields // private fields
// ***************************************************************************** // *****************************************************************************
private BasicBlock block; private final BasicBlock block;
// ***************************************************************************** // *****************************************************************************
// constructors // constructors

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -40,7 +40,7 @@ public class CatchAllStatement extends Statement {
private VarExprent monitor; private VarExprent monitor;
private List<VarExprent> vars = new ArrayList<VarExprent>(); private final List<VarExprent> vars = new ArrayList<VarExprent>();
// ***************************************************************************** // *****************************************************************************
// constructors // constructors

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -33,9 +33,9 @@ import java.util.List;
public class CatchStatement extends Statement { public class CatchStatement extends Statement {
private List<List<String>> exctstrings = new ArrayList<List<String>>(); private final List<List<String>> exctstrings = new ArrayList<List<String>>();
private List<VarExprent> vars = new ArrayList<VarExprent>(); private final List<VarExprent> vars = new ArrayList<VarExprent>();
// ***************************************************************************** // *****************************************************************************
// constructors // constructors

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -34,9 +34,9 @@ public class DoStatement extends Statement {
private int looptype; private int looptype;
private List<Exprent> initExprent = new ArrayList<Exprent>(); private final List<Exprent> initExprent = new ArrayList<Exprent>();
private List<Exprent> conditionExprent = new ArrayList<Exprent>(); private final List<Exprent> conditionExprent = new ArrayList<Exprent>();
private List<Exprent> incExprent = new ArrayList<Exprent>(); private final List<Exprent> incExprent = new ArrayList<Exprent>();
// ***************************************************************************** // *****************************************************************************
// constructors // constructors

@ -15,15 +15,6 @@
*/ */
package org.jetbrains.java.decompiler.modules.decompiler.stats; package org.jetbrains.java.decompiler.modules.decompiler.stats;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.jetbrains.java.decompiler.code.CodeConstants; import org.jetbrains.java.decompiler.code.CodeConstants;
import org.jetbrains.java.decompiler.code.InstructionSequence; import org.jetbrains.java.decompiler.code.InstructionSequence;
import org.jetbrains.java.decompiler.main.DecompilerContext; import org.jetbrains.java.decompiler.main.DecompilerContext;
@ -39,6 +30,9 @@ import org.jetbrains.java.decompiler.struct.match.MatchNode;
import org.jetbrains.java.decompiler.struct.match.MatchNode.RuleValue; import org.jetbrains.java.decompiler.struct.match.MatchNode.RuleValue;
import org.jetbrains.java.decompiler.util.VBStyleCollection; import org.jetbrains.java.decompiler.util.VBStyleCollection;
import java.util.*;
import java.util.Map.Entry;
public class Statement implements IMatchable { public class Statement implements IMatchable {
public static final int STATEDGE_ALL = 1 << 31; public static final int STATEDGE_ALL = 1 << 31;
@ -79,11 +73,11 @@ public class Statement implements IMatchable {
// private fields // private fields
// ***************************************************************************** // *****************************************************************************
private Map<Integer, List<StatEdge>> mapSuccEdges = new HashMap<Integer, List<StatEdge>>(); private final Map<Integer, List<StatEdge>> mapSuccEdges = new HashMap<Integer, List<StatEdge>>();
private Map<Integer, List<StatEdge>> mapPredEdges = new HashMap<Integer, List<StatEdge>>(); private final Map<Integer, List<StatEdge>> mapPredEdges = new HashMap<Integer, List<StatEdge>>();
private Map<Integer, List<Statement>> mapSuccStates = new HashMap<Integer, List<Statement>>(); private final Map<Integer, List<Statement>> mapSuccStates = new HashMap<Integer, List<Statement>>();
private Map<Integer, List<Statement>> mapPredStates = new HashMap<Integer, List<Statement>>(); private final Map<Integer, List<Statement>> mapPredStates = new HashMap<Integer, List<Statement>>();
// statement as graph // statement as graph
protected VBStyleCollection<Statement, Integer> stats = new VBStyleCollection<Statement, Integer>(); protected VBStyleCollection<Statement, Integer> stats = new VBStyleCollection<Statement, Integer>();

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -45,7 +45,7 @@ public class SwitchStatement extends Statement {
private StatEdge default_edge; private StatEdge default_edge;
private List<Exprent> headexprent = new ArrayList<Exprent>(); private final List<Exprent> headexprent = new ArrayList<Exprent>();
// ***************************************************************************** // *****************************************************************************
// constructors // constructors

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -30,7 +30,7 @@ public class SynchronizedStatement extends Statement {
private Statement body; private Statement body;
private List<Exprent> headexprent = new ArrayList<Exprent>(); private final List<Exprent> headexprent = new ArrayList<Exprent>();
// ***************************************************************************** // *****************************************************************************
// constructors // constructors

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -23,9 +23,9 @@ import java.util.List;
public class CheckTypesResult { public class CheckTypesResult {
private List<ExprentTypePair> lstMaxTypeExprents = new ArrayList<ExprentTypePair>(); private final List<ExprentTypePair> lstMaxTypeExprents = new ArrayList<ExprentTypePair>();
private List<ExprentTypePair> lstMinTypeExprents = new ArrayList<ExprentTypePair>(); private final List<ExprentTypePair> lstMinTypeExprents = new ArrayList<ExprentTypePair>();
public void addMaxTypeExprent(Exprent exprent, VarType type) { public void addMaxTypeExprent(Exprent exprent, VarType type) {
lstMaxTypeExprents.add(new ExprentTypePair(exprent, type, null)); lstMaxTypeExprents.add(new ExprentTypePair(exprent, type, null));

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -34,14 +34,14 @@ import java.util.Map.Entry;
public class VarDefinitionHelper { public class VarDefinitionHelper {
private HashMap<Integer, Statement> mapVarDefStatements; private final HashMap<Integer, Statement> mapVarDefStatements;
// statement.id, defined vars // statement.id, defined vars
private HashMap<Integer, HashSet<Integer>> mapStatementVars; private final HashMap<Integer, HashSet<Integer>> mapStatementVars;
private HashSet<Integer> implDefVars; private final HashSet<Integer> implDefVars;
private VarProcessor varproc; private final VarProcessor varproc;
public VarDefinitionHelper(Statement root, StructMethod mt, VarProcessor varproc) { public VarDefinitionHelper(Statement root, StructMethod mt, VarProcessor varproc) {

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -29,8 +29,8 @@ public class VarProcessor {
private Map<VarVersionPair, String> mapVarNames = new HashMap<VarVersionPair, String>(); private Map<VarVersionPair, String> mapVarNames = new HashMap<VarVersionPair, String>();
private VarVersionsProcessor varVersions; private VarVersionsProcessor varVersions;
private Map<VarVersionPair, String> thisVars = new HashMap<VarVersionPair, String>(); private final Map<VarVersionPair, String> thisVars = new HashMap<VarVersionPair, String>();
private Set<VarVersionPair> externalVars = new HashSet<VarVersionPair>(); private final Set<VarVersionPair> externalVars = new HashSet<VarVersionPair>();
public void setVarVersions(RootStatement root) { public void setVarVersions(RootStatement root) {
varVersions = new VarVersionsProcessor(); varVersions = new VarVersionsProcessor();

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -39,9 +39,9 @@ public class VarTypeProcessor {
public static final int VAR_EXPLICIT_FINAL = 2; public static final int VAR_EXPLICIT_FINAL = 2;
public static final int VAR_FINAL = 3; public static final int VAR_FINAL = 3;
private Map<VarVersionPair, VarType> mapExprentMinTypes = new HashMap<VarVersionPair, VarType>(); private final Map<VarVersionPair, VarType> mapExprentMinTypes = new HashMap<VarVersionPair, VarType>();
private Map<VarVersionPair, VarType> mapExprentMaxTypes = new HashMap<VarVersionPair, VarType>(); private final Map<VarVersionPair, VarType> mapExprentMaxTypes = new HashMap<VarVersionPair, VarType>();
private Map<VarVersionPair, Integer> mapFinalVars = new HashMap<VarVersionPair, Integer>(); private final Map<VarVersionPair, Integer> mapFinalVars = new HashMap<VarVersionPair, Integer>();
private void setInitVars(RootStatement root) { private void setInitVars(RootStatement root) {
StructMethod mt = (StructMethod)DecompilerContext.getProperty(DecompilerContext.CURRENT_METHOD); StructMethod mt = (StructMethod)DecompilerContext.getProperty(DecompilerContext.CURRENT_METHOD);

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,7 +26,7 @@ public class VarVersionEdge { // FIXME: can be removed?
public VarVersionNode dest; public VarVersionNode dest;
private int hashCode; private final int hashCode;
public VarVersionEdge(int type, VarVersionNode source, VarVersionNode dest) { public VarVersionEdge(int type, VarVersionNode source, VarVersionNode dest) {
this.type = type; this.type = type;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,11 +22,11 @@ import java.util.List;
public class ClassWrapperNode { public class ClassWrapperNode {
private StructClass classStruct; private final StructClass classStruct;
private ClassWrapperNode superclass; private ClassWrapperNode superclass;
private List<ClassWrapperNode> subclasses = new ArrayList<ClassWrapperNode>(); private final List<ClassWrapperNode> subclasses = new ArrayList<ClassWrapperNode>();
public ClassWrapperNode(StructClass cl) { public ClassWrapperNode(StructClass cl) {
this.classStruct = cl; this.classStruct = cl;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -32,7 +32,7 @@ public class ConverterHelper implements IIdentifierRenamer {
private int classCounter = 0; private int classCounter = 0;
private int fieldCounter = 0; private int fieldCounter = 0;
private int methodCounter = 0; private int methodCounter = 0;
private Set<String> setNonStandardClassNames = new HashSet<String>(); private final Set<String> setNonStandardClassNames = new HashSet<String>();
@Override @Override
public boolean toBeRenamed(Type elementType, String className, String element, String descriptor) { public boolean toBeRenamed(Type elementType, String className, String element, String descriptor) {

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -21,11 +21,11 @@ import java.util.HashMap;
public class PoolInterceptor { public class PoolInterceptor {
private IIdentifierRenamer helper; private final IIdentifierRenamer helper;
private HashMap<String, String> mapOldToNewNames = new HashMap<String, String>(); private final HashMap<String, String> mapOldToNewNames = new HashMap<String, String>();
private HashMap<String, String> mapNewToOldNames = new HashMap<String, String>(); private final HashMap<String, String> mapNewToOldNames = new HashMap<String, String>();
public PoolInterceptor(IIdentifierRenamer helper) { public PoolInterceptor(IIdentifierRenamer helper) {
this.helper = helper; this.helper = helper;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,8 +26,8 @@ import java.util.List;
public class StructBootstrapMethodsAttribute extends StructGeneralAttribute { public class StructBootstrapMethodsAttribute extends StructGeneralAttribute {
private List<LinkConstant> methodRefs = new ArrayList<LinkConstant>(); private final List<LinkConstant> methodRefs = new ArrayList<LinkConstant>();
private List<List<PooledConstant>> methodArguments = new ArrayList<List<PooledConstant>>(); private final List<List<PooledConstant>> methodArguments = new ArrayList<List<PooledConstant>>();
@Override @Override
public void initContent(ConstantPool pool) throws IOException { public void initContent(ConstantPool pool) throws IOException {

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -35,7 +35,7 @@ public class ConstantPool implements NewClassNameBuilder {
public static final int METHOD = 2; public static final int METHOD = 2;
private List<PooledConstant> pool = new ArrayList<PooledConstant>(); private List<PooledConstant> pool = new ArrayList<PooledConstant>();
private PoolInterceptor interceptor; private final PoolInterceptor interceptor;
public ConstantPool(DataInputStream in) throws IOException { public ConstantPool(DataInputStream in) throws IOException {

@ -1,3 +1,18 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.struct.match; package org.jetbrains.java.decompiler.struct.match;
import java.util.ArrayList; import java.util.ArrayList;
@ -21,16 +36,16 @@ public class MatchEngine {
private MatchNode rootNode = null; private MatchNode rootNode = null;
private Map<String, Object> variables = new HashMap<String, Object>(); private final Map<String, Object> variables = new HashMap<String, Object>();
private static Map<String, MatchProperties> stat_properties = new HashMap<String, MatchProperties>(); private static final Map<String, MatchProperties> stat_properties = new HashMap<String, MatchProperties>();
private static Map<String, MatchProperties> expr_properties = new HashMap<String, MatchProperties>(); private static final Map<String, MatchProperties> expr_properties = new HashMap<String, MatchProperties>();
private static Map<String, Integer> stat_type = new HashMap<String, Integer>(); private static final Map<String, Integer> stat_type = new HashMap<String, Integer>();
private static Map<String, Integer> expr_type = new HashMap<String, Integer>(); private static final Map<String, Integer> expr_type = new HashMap<String, Integer>();
private static Map<String, Integer> expr_func_type = new HashMap<String, Integer>(); private static final Map<String, Integer> expr_func_type = new HashMap<String, Integer>();
private static Map<String, Integer> expr_exit_type = new HashMap<String, Integer>(); private static final Map<String, Integer> expr_exit_type = new HashMap<String, Integer>();
private static Map<String, Integer> stat_if_type = new HashMap<String, Integer>(); private static final Map<String, Integer> stat_if_type = new HashMap<String, Integer>();
private static Map<String, VarType> expr_const_type = new HashMap<String, VarType>(); private static final Map<String, VarType> expr_const_type = new HashMap<String, VarType>();
static { static {
stat_properties.put("type", MatchProperties.STATEMENT_TYPE); stat_properties.put("type", MatchProperties.STATEMENT_TYPE);

@ -1,3 +1,18 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.struct.match; package org.jetbrains.java.decompiler.struct.match;
import java.util.ArrayList; import java.util.ArrayList;
@ -31,11 +46,11 @@ public class MatchNode {
public static final int MATCHNODE_STATEMENT = 0; public static final int MATCHNODE_STATEMENT = 0;
public static final int MATCHNODE_EXPRENT = 1; public static final int MATCHNODE_EXPRENT = 1;
private int type; private final int type;
private Map<MatchProperties, RuleValue> rules = new HashMap<MatchProperties, RuleValue>(); private final Map<MatchProperties, RuleValue> rules = new HashMap<MatchProperties, RuleValue>();
private List<MatchNode> children = new ArrayList<MatchNode>(); private final List<MatchNode> children = new ArrayList<MatchNode>();
public MatchNode(int type) { public MatchNode(int type) {

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -19,9 +19,9 @@ import java.util.*;
public class FastFixedSetFactory<E> { public class FastFixedSetFactory<E> {
private VBStyleCollection<int[], E> colValuesInternal = new VBStyleCollection<int[], E>(); private final VBStyleCollection<int[], E> colValuesInternal = new VBStyleCollection<int[], E>();
private int dataLength; private final int dataLength;
public FastFixedSetFactory(Collection<E> set) { public FastFixedSetFactory(Collection<E> set) {
@ -59,9 +59,9 @@ public class FastFixedSetFactory<E> {
public static class FastFixedSet<E> implements Iterable<E> { public static class FastFixedSet<E> implements Iterable<E> {
private FastFixedSetFactory<E> factory; private final FastFixedSetFactory<E> factory;
private VBStyleCollection<int[], E> colValuesInternal; private final VBStyleCollection<int[], E> colValuesInternal;
private int[] data; private int[] data;
@ -286,9 +286,9 @@ public class FastFixedSetFactory<E> {
public static class FastFixedSetIterator<E> implements Iterator<E> { public static class FastFixedSetIterator<E> implements Iterator<E> {
private VBStyleCollection<int[], E> colValuesInternal; private final VBStyleCollection<int[], E> colValuesInternal;
private int[] data; private final int[] data;
private int size; private final int size;
private int pointer = -1; private int pointer = -1;
private int next_pointer = -1; private int next_pointer = -1;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.util.Set;
public class FastSetFactory<E> { public class FastSetFactory<E> {
private VBStyleCollection<int[], E> colValuesInternal = new VBStyleCollection<int[], E>(); private final VBStyleCollection<int[], E> colValuesInternal = new VBStyleCollection<int[], E>();
private int lastBlock; private int lastBlock;
@ -89,9 +89,9 @@ public class FastSetFactory<E> {
public static class FastSet<E> implements Iterable<E> { public static class FastSet<E> implements Iterable<E> {
private FastSetFactory<E> factory; private final FastSetFactory<E> factory;
private VBStyleCollection<int[], E> colValuesInternal; private final VBStyleCollection<int[], E> colValuesInternal;
private int[] data; private int[] data;
@ -427,8 +427,8 @@ public class FastSetFactory<E> {
public static class FastSetIterator<E> implements Iterator<E> { public static class FastSetIterator<E> implements Iterator<E> {
private VBStyleCollection<int[], E> colValuesInternal; private final VBStyleCollection<int[], E> colValuesInternal;
private int[] data; private final int[] data;
private int size; private int size;
private int pointer = -1; private int pointer = -1;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ import java.util.Set;
public class FastSparseSetFactory<E> { public class FastSparseSetFactory<E> {
private VBStyleCollection<int[], E> colValuesInternal = new VBStyleCollection<int[], E>(); private final VBStyleCollection<int[], E> colValuesInternal = new VBStyleCollection<int[], E>();
private int lastBlock; private int lastBlock;
@ -90,9 +90,9 @@ public class FastSparseSetFactory<E> {
public static class FastSparseSet<E> implements Iterable<E> { public static class FastSparseSet<E> implements Iterable<E> {
public static final FastSparseSet[] EMPTY_ARRAY = new FastSparseSet[0]; public static final FastSparseSet[] EMPTY_ARRAY = new FastSparseSet[0];
private FastSparseSetFactory<E> factory; private final FastSparseSetFactory<E> factory;
private VBStyleCollection<int[], E> colValuesInternal; private final VBStyleCollection<int[], E> colValuesInternal;
private int[] data; private int[] data;
private int[] next; private int[] next;
@ -478,10 +478,10 @@ public class FastSparseSetFactory<E> {
public static class FastSparseSetIterator<E> implements Iterator<E> { public static class FastSparseSetIterator<E> implements Iterator<E> {
private VBStyleCollection<int[], E> colValuesInternal; private final VBStyleCollection<int[], E> colValuesInternal;
private int[] data; private final int[] data;
private int[] next; private final int[] next;
private int size; private final int size;
private int pointer = -1; private int pointer = -1;
private int next_pointer = -1; private int next_pointer = -1;

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -27,9 +27,9 @@ public class SFormsFastMapDirect {
private int size; private int size;
@SuppressWarnings("unchecked") private FastSparseSet<Integer>[][] elements = new FastSparseSet[3][]; @SuppressWarnings("unchecked") private final FastSparseSet<Integer>[][] elements = new FastSparseSet[3][];
private int[][] next = new int[3][]; private final int[][] next = new int[3][];
public SFormsFastMapDirect() { public SFormsFastMapDirect() {
this(true); this(true);
@ -363,8 +363,8 @@ public class SFormsFastMapDirect {
list.add(new Entry<Integer, FastSparseSet<Integer>>() { list.add(new Entry<Integer, FastSparseSet<Integer>>() {
private Integer var = key; private final Integer var = key;
private FastSparseSet<Integer> val = ent; private final FastSparseSet<Integer> val = ent;
public Integer getKey() { public Integer getKey() {
return var; return var;

Loading…
Cancel
Save