From ca7e2dfa1ca48fafe8130b6c5d7ba37ee59fe694 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Thu, 26 Mar 2015 15:26:52 +0300 Subject: [PATCH] decompiler: cleanup - marked const fields final --- .../java/decompiler/code/ConstantsUtil.java | 6 ++-- .../code/optinstructions/ALOAD.java | 4 +-- .../code/optinstructions/ASTORE.java | 4 +-- .../code/optinstructions/BIPUSH.java | 4 +-- .../code/optinstructions/DLOAD.java | 4 +-- .../code/optinstructions/DSTORE.java | 4 +-- .../code/optinstructions/FLOAD.java | 4 +-- .../code/optinstructions/FSTORE.java | 4 +-- .../code/optinstructions/ILOAD.java | 4 +-- .../code/optinstructions/ISTORE.java | 4 +-- .../code/optinstructions/LLOAD.java | 4 +-- .../code/optinstructions/LSTORE.java | 4 +-- .../java/decompiler/main/ClassWriter.java | 4 +-- .../decompiler/main/ClassesProcessor.java | 4 +-- .../decompiler/main/DecompilerContext.java | 4 +-- .../java/decompiler/main/Fernflower.java | 4 +-- .../collectors/BytecodeMappingTracer.java | 2 +- .../main/collectors/CounterContainer.java | 4 +-- .../main/collectors/ImportCollector.java | 6 ++-- .../main/collectors/VarNamesCollector.java | 4 +-- .../main/decompiler/ConsoleDecompiler.java | 4 +-- .../decompiler/main/rels/ClassWrapper.java | 12 +++---- .../main/rels/NestedMemberAccess.java | 4 +-- .../modules/decompiler/ExprProcessor.java | 2 +- .../modules/decompiler/FinallyProcessor.java | 6 ++-- .../decompiler/PrimitiveExprsList.java | 4 +-- .../decompiler/SimplifyExprentsHelper.java | 2 +- .../decompiler/decompose/DominatorEngine.java | 6 ++-- .../DominatorTreeExceptionFilter.java | 10 +++--- .../FastExtendedPostdominanceHelper.java | 4 +-- .../decompose/GenericDominatorEngine.java | 6 ++-- .../modules/decompiler/exps/NewExprent.java | 2 +- .../sforms/FlattenStatementsHelper.java | 12 +++---- .../sforms/SSAConstructorSparseEx.java | 16 ++++----- .../sforms/SSAUConstructorSparseEx.java | 24 +++++++------- .../decompiler/stats/BasicBlockStatement.java | 4 +-- .../decompiler/stats/CatchAllStatement.java | 4 +-- .../decompiler/stats/CatchStatement.java | 6 ++-- .../modules/decompiler/stats/DoStatement.java | 8 ++--- .../modules/decompiler/stats/Statement.java | 20 ++++------- .../decompiler/stats/SwitchStatement.java | 4 +-- .../stats/SynchronizedStatement.java | 4 +-- .../decompiler/vars/CheckTypesResult.java | 6 ++-- .../decompiler/vars/VarDefinitionHelper.java | 10 +++--- .../modules/decompiler/vars/VarProcessor.java | 6 ++-- .../decompiler/vars/VarTypeProcessor.java | 8 ++--- .../decompiler/vars/VarVersionEdge.java | 4 +-- .../modules/renamer/ClassWrapperNode.java | 6 ++-- .../modules/renamer/ConverterHelper.java | 4 +-- .../modules/renamer/PoolInterceptor.java | 8 ++--- .../attr/StructBootstrapMethodsAttribute.java | 6 ++-- .../struct/consts/ConstantPool.java | 4 +-- .../decompiler/struct/match/MatchEngine.java | 33 ++++++++++++++----- .../decompiler/struct/match/MatchNode.java | 21 ++++++++++-- .../decompiler/util/FastFixedSetFactory.java | 16 ++++----- .../java/decompiler/util/FastSetFactory.java | 12 +++---- .../decompiler/util/FastSparseSetFactory.java | 16 ++++----- .../decompiler/util/SFormsFastMapDirect.java | 10 +++--- 58 files changed, 220 insertions(+), 196 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/code/ConstantsUtil.java b/src/org/jetbrains/java/decompiler/code/ConstantsUtil.java index 79eecdf..b9a30a5 100644 --- a/src/org/jetbrains/java/decompiler/code/ConstantsUtil.java +++ b/src/org/jetbrains/java/decompiler/code/ConstantsUtil.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"); * 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", "aconst_null", // "aconst_null", "iconst_m1", // "iconst_m1", @@ -275,7 +275,7 @@ public class ConstantsUtil { "jsr_w" // "jsr_w" }; - private static Class[] opcodeClasses = { + private static final Class[] opcodeClasses = { null, // "nop", null, // "aconst_null", null, // "iconst_m1", diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/ALOAD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/ALOAD.java index 788795e..7923b84 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/ALOAD.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/ALOAD.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"); * 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 { - 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 { int index = getOperand(0); diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/ASTORE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/ASTORE.java index 40336f4..046f34a 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/ASTORE.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/ASTORE.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"); * 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 { - 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 { int index = getOperand(0); diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/BIPUSH.java b/src/org/jetbrains/java/decompiler/code/optinstructions/BIPUSH.java index 4686051..2ccebd4 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/BIPUSH.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/BIPUSH.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"); * 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 { - 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}; public void writeToStream(DataOutputStream out, int offset) throws IOException { diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/DLOAD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/DLOAD.java index 7630185..fa97db2 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/DLOAD.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/DLOAD.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"); * 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 { - 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 { int index = getOperand(0); diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/DSTORE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/DSTORE.java index 2bdb749..10e1283 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/DSTORE.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/DSTORE.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"); * 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 { - 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 { int index = getOperand(0); diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/FLOAD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/FLOAD.java index 8a89dff..c775ec8 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/FLOAD.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/FLOAD.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"); * 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 { - 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 { int index = getOperand(0); diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/FSTORE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/FSTORE.java index 9061913..c76b374 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/FSTORE.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/FSTORE.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"); * 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 { - 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 { int index = getOperand(0); diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/ILOAD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/ILOAD.java index 24b95ff..d328e23 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/ILOAD.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/ILOAD.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"); * 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 { - 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 { int index = getOperand(0); diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/ISTORE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/ISTORE.java index 5907538..4ee2d49 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/ISTORE.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/ISTORE.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"); * 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 { - 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 { int index = getOperand(0); diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/LLOAD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/LLOAD.java index 6e50659..8381d8c 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/LLOAD.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/LLOAD.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"); * 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 { - 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 { int index = getOperand(0); diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/LSTORE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/LSTORE.java index 9095f04..bed5f7e 100644 --- a/src/org/jetbrains/java/decompiler/code/optinstructions/LSTORE.java +++ b/src/org/jetbrains/java/decompiler/code/optinstructions/LSTORE.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"); * 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 { - 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 { int index = getOperand(0); diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index 03318a9..afa2473 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -47,8 +47,8 @@ import java.util.*; public class ClassWriter { - private ClassReference14Processor ref14processor; - private PoolInterceptor interceptor; + private final ClassReference14Processor ref14processor; + private final PoolInterceptor interceptor; public ClassWriter() { ref14processor = new ClassReference14Processor(); diff --git a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java index 4f155e5..d345b71 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.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"); * 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; - private Map mapRootClasses = new HashMap(); + private final Map mapRootClasses = new HashMap(); public ClassesProcessor(StructContext context) { diff --git a/src/org/jetbrains/java/decompiler/main/DecompilerContext.java b/src/org/jetbrains/java/decompiler/main/DecompilerContext.java index d672ddc..15c6e40 100644 --- a/src/org/jetbrains/java/decompiler/main/DecompilerContext.java +++ b/src/org/jetbrains/java/decompiler/main/DecompilerContext.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"); * 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_VAR_PROCESSOR = "CURRENT_VAR_PROCESSOR"; - private static ThreadLocal currentContext = new ThreadLocal(); + private static final ThreadLocal currentContext = new ThreadLocal(); private final Map properties; private StructContext structContext; diff --git a/src/org/jetbrains/java/decompiler/main/Fernflower.java b/src/org/jetbrains/java/decompiler/main/Fernflower.java index 15baac5..e355ee9 100644 --- a/src/org/jetbrains/java/decompiler/main/Fernflower.java +++ b/src/org/jetbrains/java/decompiler/main/Fernflower.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"); * 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 { - private StructContext structContext; + private final StructContext structContext; private ClassesProcessor classesProcessor; public Fernflower(IBytecodeProvider provider, IResultSaver saver, Map options, IFernflowerLogger logger) { diff --git a/src/org/jetbrains/java/decompiler/main/collectors/BytecodeMappingTracer.java b/src/org/jetbrains/java/decompiler/main/collectors/BytecodeMappingTracer.java index 84ca0b7..e25cca2 100644 --- a/src/org/jetbrains/java/decompiler/main/collectors/BytecodeMappingTracer.java +++ b/src/org/jetbrains/java/decompiler/main/collectors/BytecodeMappingTracer.java @@ -27,7 +27,7 @@ public class BytecodeMappingTracer { private StructLineNumberTableAttribute lineNumberTable = null; // bytecode offset, source line - private Map mapping = new HashMap(); + private final Map mapping = new HashMap(); public BytecodeMappingTracer() { } diff --git a/src/org/jetbrains/java/decompiler/main/collectors/CounterContainer.java b/src/org/jetbrains/java/decompiler/main/collectors/CounterContainer.java index 04d50a7..3fa3fd2 100644 --- a/src/org/jetbrains/java/decompiler/main/collectors/CounterContainer.java +++ b/src/org/jetbrains/java/decompiler/main/collectors/CounterContainer.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"); * 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 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) { values[counter] = value; diff --git a/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java b/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java index c7d8317..05dc835 100644 --- a/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java +++ b/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.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"); * 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 Map mapSimpleNames = new HashMap(); - private Set setNotImportedNames = new HashSet(); + private final Map mapSimpleNames = new HashMap(); + private final Set setNotImportedNames = new HashSet(); private String currentPackageSlash = ""; private String currentPackagePoint = ""; diff --git a/src/org/jetbrains/java/decompiler/main/collectors/VarNamesCollector.java b/src/org/jetbrains/java/decompiler/main/collectors/VarNamesCollector.java index d84a77e..33bf42c 100644 --- a/src/org/jetbrains/java/decompiler/main/collectors/VarNamesCollector.java +++ b/src/org/jetbrains/java/decompiler/main/collectors/VarNamesCollector.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"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import java.util.Set; public class VarNamesCollector { - private Set usedNames = new HashSet(); + private final Set usedNames = new HashSet(); public VarNamesCollector() { } diff --git a/src/org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler.java b/src/org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler.java index 1dfb487..7924b1c 100644 --- a/src/org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler.java +++ b/src/org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler.java @@ -113,8 +113,8 @@ public class ConsoleDecompiler implements IBytecodeProvider, IResultSaver { private final File root; private final Fernflower fernflower; - private Map mapArchiveStreams = new HashMap(); - private Map> mapArchiveEntries = new HashMap>(); + private final Map mapArchiveStreams = new HashMap(); + private final Map> mapArchiveEntries = new HashMap>(); @SuppressWarnings("UseOfSystemOutOrSystemErr") public ConsoleDecompiler(File destination, Map options) { diff --git a/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java b/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java index 9388cf0..1b4a134 100644 --- a/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java +++ b/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.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"); * you may not use this file except in compliance with the License. @@ -40,11 +40,11 @@ import java.util.Set; public class ClassWrapper { - private StructClass classStruct; - private Set hiddenMembers = new HashSet(); - private VBStyleCollection staticFieldInitializers = new VBStyleCollection(); - private VBStyleCollection dynamicFieldInitializers = new VBStyleCollection(); - private VBStyleCollection methods = new VBStyleCollection(); + private final StructClass classStruct; + private final Set hiddenMembers = new HashSet(); + private final VBStyleCollection staticFieldInitializers = new VBStyleCollection(); + private final VBStyleCollection dynamicFieldInitializers = new VBStyleCollection(); + private final VBStyleCollection methods = new VBStyleCollection(); public ClassWrapper(StructClass classStruct) { this.classStruct = classStruct; diff --git a/src/org/jetbrains/java/decompiler/main/rels/NestedMemberAccess.java b/src/org/jetbrains/java/decompiler/main/rels/NestedMemberAccess.java index f102644..3fa8128 100644 --- a/src/org/jetbrains/java/decompiler/main/rels/NestedMemberAccess.java +++ b/src/org/jetbrains/java/decompiler/main/rels/NestedMemberAccess.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"); * 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 boolean noSynthFlag; - private Map mapMethodType = new HashMap(); + private final Map mapMethodType = new HashMap(); public void propagateMemberAccess(ClassNode root) { diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java index 64ea41e..9296bb3 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java @@ -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 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) { diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java index 3e2be78..9f1c11b 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java @@ -46,10 +46,10 @@ import java.util.Map.Entry; public class FinallyProcessor { - private Map finallyBlockIDs = new HashMap(); - private Map catchallBlockIDs = new HashMap(); + private final Map finallyBlockIDs = new HashMap(); + private final Map catchallBlockIDs = new HashMap(); - private VarProcessor varprocessor; + private final VarProcessor varprocessor; public FinallyProcessor(VarProcessor varprocessor) { this.varprocessor = varprocessor; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/PrimitiveExprsList.java b/src/org/jetbrains/java/decompiler/modules/decompiler/PrimitiveExprsList.java index 6dbc887..0a1831e 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/PrimitiveExprsList.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/PrimitiveExprsList.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"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import java.util.List; public class PrimitiveExprsList { - private List lstExprents = new ArrayList(); + private final List lstExprents = new ArrayList(); private ExprentStack stack = new ExprentStack(); diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java index a855ffe..97c7d72 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java @@ -53,7 +53,7 @@ public class SimplifyExprentsHelper { static MatchEngine class14Builder = new MatchEngine(); - private boolean firstInvocation; + private final boolean firstInvocation; public SimplifyExprentsHelper(boolean firstInvocation) { this.firstInvocation = firstInvocation; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.java b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.java index aeab0d2..a61d44c 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.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"); * you may not use this file except in compliance with the License. @@ -23,9 +23,9 @@ import java.util.List; public class DominatorEngine { - private Statement statement; + private final Statement statement; - private VBStyleCollection colOrderedIDoms = new VBStyleCollection(); + private final VBStyleCollection colOrderedIDoms = new VBStyleCollection(); public DominatorEngine(Statement statement) { diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorTreeExceptionFilter.java b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorTreeExceptionFilter.java index c11d5bf..89e6849 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorTreeExceptionFilter.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorTreeExceptionFilter.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"); * you may not use this file except in compliance with the License. @@ -24,19 +24,19 @@ import java.util.Map.Entry; public class DominatorTreeExceptionFilter { - private Statement statement; + private final Statement statement; // idom, nodes - private Map> mapTreeBranches = new HashMap>(); + private final Map> mapTreeBranches = new HashMap>(); // handler, range nodes - private Map> mapExceptionRanges = new HashMap>(); + private final Map> mapExceptionRanges = new HashMap>(); // handler, head dom private Map mapExceptionDoms = new HashMap(); // statement, handler, exit nodes - private Map> mapExceptionRangeUniqueExit = new HashMap>(); + private final Map> mapExceptionRangeUniqueExit = new HashMap>(); private DominatorEngine domEngine; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java index b3c4806..52338f9 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.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"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ public class FastExtendedPostdominanceHelper { private HashMap> mapSupportPoints = new HashMap>(); - private HashMap> mapExtPostdominators = new HashMap>(); + private final HashMap> mapExtPostdominators = new HashMap>(); private Statement statement; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.java b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.java index c6eb357..fa5ccf3 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.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"); * you may not use this file except in compliance with the License. @@ -22,9 +22,9 @@ import java.util.Set; public class GenericDominatorEngine { - private IGraph graph; + private final IGraph graph; - private VBStyleCollection colOrderedIDoms = new VBStyleCollection(); + private final VBStyleCollection colOrderedIDoms = new VBStyleCollection(); private Set setRoots; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/NewExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/NewExprent.java index 91cc24e..b5ecd9e 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/NewExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/NewExprent.java @@ -38,7 +38,7 @@ import java.util.Set; public class NewExprent extends Exprent { private InvocationExprent constructor; - private VarType newType; + private final VarType newType; private List lstDims = new ArrayList(); private List lstArrayElements = new ArrayList(); private boolean directArrayInit; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.java index 05d2f33..c2019ab 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.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"); * you may not use this file except in compliance with the License. @@ -26,19 +26,19 @@ import java.util.Map.Entry; public class FlattenStatementsHelper { // statement.id, node.id(direct), node.id(continue) - private Map mapDestinationNodes = new HashMap(); + private final Map mapDestinationNodes = new HashMap(); // node.id(source), statement.id(destination), edge type - private List listEdges = new ArrayList(); + private final List listEdges = new ArrayList(); // node.id(exit), [node.id(source), statement.id(destination)] - private Map> mapShortRangeFinallyPathIds = new HashMap>(); + private final Map> mapShortRangeFinallyPathIds = new HashMap>(); // node.id(exit), [node.id(source), statement.id(destination)] - private Map> mapLongRangeFinallyPathIds = new HashMap>(); + private final Map> mapLongRangeFinallyPathIds = new HashMap>(); // positive if branches - private Map mapPosIfBranch = new HashMap(); + private final Map mapPosIfBranch = new HashMap(); private DirectGraph graph; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAConstructorSparseEx.java b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAConstructorSparseEx.java index 2419359..76a973f 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAConstructorSparseEx.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAConstructorSparseEx.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"); * you may not use this file except in compliance with the License. @@ -42,24 +42,24 @@ import java.util.Map.Entry; public class SSAConstructorSparseEx { // node id, var, version - private HashMap inVarVersions = new HashMap(); + private final HashMap inVarVersions = new HashMap(); // node id, var, version (direct branch) - private HashMap outVarVersions = new HashMap(); + private final HashMap outVarVersions = new HashMap(); // node id, var, version (negative branch) - private HashMap outNegVarVersions = new HashMap(); + private final HashMap outNegVarVersions = new HashMap(); // node id, var, version - private HashMap extraVarVersions = new HashMap(); + private final HashMap extraVarVersions = new HashMap(); // (var, version), version - private HashMap> phi = new HashMap>(); + private final HashMap> phi = new HashMap>(); // var, version - private HashMap lastversion = new HashMap(); + private final HashMap lastversion = new HashMap(); - private List startVars = new ArrayList(); + private final List startVars = new ArrayList(); // set factory private FastSparseSetFactory factory; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.java b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.java index b039d91..95cefcf 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.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"); * you may not use this file except in compliance with the License. @@ -40,42 +40,42 @@ import java.util.Map.Entry; public class SSAUConstructorSparseEx { // node id, var, version - private HashMap inVarVersions = new HashMap(); + private final HashMap inVarVersions = new HashMap(); //private HashMap>> inVarVersions = new HashMap>>(); // node id, var, version (direct branch) - private HashMap outVarVersions = new HashMap(); + private final HashMap outVarVersions = new HashMap(); //private HashMap>> outVarVersions = new HashMap>>(); // node id, var, version (negative branch) - private HashMap outNegVarVersions = new HashMap(); + private final HashMap outNegVarVersions = new HashMap(); //private HashMap>> outNegVarVersions = new HashMap>>(); // node id, var, version - private HashMap extraVarVersions = new HashMap(); + private final HashMap extraVarVersions = new HashMap(); //private HashMap>> extraVarVersions = new HashMap>>(); // (var, version), version - private HashMap> phi = new HashMap>(); + private final HashMap> phi = new HashMap>(); // var, version - private HashMap lastversion = new HashMap(); + private final HashMap lastversion = new HashMap(); // version, protected ranges (catch, finally) - private HashMap mapVersionFirstRange = new HashMap(); + private final HashMap mapVersionFirstRange = new HashMap(); // version, version - private HashMap phantomppnodes = new HashMap(); // ++ and -- + private final HashMap phantomppnodes = new HashMap(); // ++ and -- // node.id, version, version - private HashMap> phantomexitnodes = + private final HashMap> phantomexitnodes = new HashMap>(); // finally exits // versions memory dependencies - private VarVersionsGraph ssuversions = new VarVersionsGraph(); + private final VarVersionsGraph ssuversions = new VarVersionsGraph(); // field access vars (exprent id, var id) - private HashMap mapFieldVars = new HashMap(); + private final HashMap mapFieldVars = new HashMap(); // field access counter private int fieldvarcounter = -1; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/BasicBlockStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/BasicBlockStatement.java index 048d245..762fd01 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/BasicBlockStatement.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/BasicBlockStatement.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"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ public class BasicBlockStatement extends Statement { // private fields // ***************************************************************************** - private BasicBlock block; + private final BasicBlock block; // ***************************************************************************** // constructors diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java index a3d597d..812ed10 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.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"); * 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 List vars = new ArrayList(); + private final List vars = new ArrayList(); // ***************************************************************************** // constructors diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchStatement.java index 57b76ca..0d782cd 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchStatement.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchStatement.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"); * 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 { - private List> exctstrings = new ArrayList>(); + private final List> exctstrings = new ArrayList>(); - private List vars = new ArrayList(); + private final List vars = new ArrayList(); // ***************************************************************************** // constructors diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/DoStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/DoStatement.java index 00e4a45..ef5ea76 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/DoStatement.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/DoStatement.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"); * 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 List initExprent = new ArrayList(); - private List conditionExprent = new ArrayList(); - private List incExprent = new ArrayList(); + private final List initExprent = new ArrayList(); + private final List conditionExprent = new ArrayList(); + private final List incExprent = new ArrayList(); // ***************************************************************************** // constructors diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java index 186ca68..25a5cee 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java @@ -15,15 +15,6 @@ */ 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.InstructionSequence; 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.util.VBStyleCollection; +import java.util.*; +import java.util.Map.Entry; + public class Statement implements IMatchable { public static final int STATEDGE_ALL = 1 << 31; @@ -79,11 +73,11 @@ public class Statement implements IMatchable { // private fields // ***************************************************************************** - private Map> mapSuccEdges = new HashMap>(); - private Map> mapPredEdges = new HashMap>(); + private final Map> mapSuccEdges = new HashMap>(); + private final Map> mapPredEdges = new HashMap>(); - private Map> mapSuccStates = new HashMap>(); - private Map> mapPredStates = new HashMap>(); + private final Map> mapSuccStates = new HashMap>(); + private final Map> mapPredStates = new HashMap>(); // statement as graph protected VBStyleCollection stats = new VBStyleCollection(); diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.java index a2b4463..5916490 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.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"); * 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 List headexprent = new ArrayList(); + private final List headexprent = new ArrayList(); // ***************************************************************************** // constructors diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SynchronizedStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SynchronizedStatement.java index d32b9d7..3460e14 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SynchronizedStatement.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SynchronizedStatement.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"); * 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 List headexprent = new ArrayList(); + private final List headexprent = new ArrayList(); // ***************************************************************************** // constructors diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/CheckTypesResult.java b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/CheckTypesResult.java index 08c32ec..8c5e58d 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/CheckTypesResult.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/CheckTypesResult.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"); * you may not use this file except in compliance with the License. @@ -23,9 +23,9 @@ import java.util.List; public class CheckTypesResult { - private List lstMaxTypeExprents = new ArrayList(); + private final List lstMaxTypeExprents = new ArrayList(); - private List lstMinTypeExprents = new ArrayList(); + private final List lstMinTypeExprents = new ArrayList(); public void addMaxTypeExprent(Exprent exprent, VarType type) { lstMaxTypeExprents.add(new ExprentTypePair(exprent, type, null)); diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java index 23a4e8d..23b1c5e 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.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"); * you may not use this file except in compliance with the License. @@ -34,14 +34,14 @@ import java.util.Map.Entry; public class VarDefinitionHelper { - private HashMap mapVarDefStatements; + private final HashMap mapVarDefStatements; // statement.id, defined vars - private HashMap> mapStatementVars; + private final HashMap> mapStatementVars; - private HashSet implDefVars; + private final HashSet implDefVars; - private VarProcessor varproc; + private final VarProcessor varproc; public VarDefinitionHelper(Statement root, StructMethod mt, VarProcessor varproc) { diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarProcessor.java index 1e78895..ce81474 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarProcessor.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"); * you may not use this file except in compliance with the License. @@ -29,8 +29,8 @@ public class VarProcessor { private Map mapVarNames = new HashMap(); private VarVersionsProcessor varVersions; - private Map thisVars = new HashMap(); - private Set externalVars = new HashSet(); + private final Map thisVars = new HashMap(); + private final Set externalVars = new HashSet(); public void setVarVersions(RootStatement root) { varVersions = new VarVersionsProcessor(); diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarTypeProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarTypeProcessor.java index e2bc5fb..d6c746b 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarTypeProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarTypeProcessor.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"); * 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_FINAL = 3; - private Map mapExprentMinTypes = new HashMap(); - private Map mapExprentMaxTypes = new HashMap(); - private Map mapFinalVars = new HashMap(); + private final Map mapExprentMinTypes = new HashMap(); + private final Map mapExprentMaxTypes = new HashMap(); + private final Map mapFinalVars = new HashMap(); private void setInitVars(RootStatement root) { StructMethod mt = (StructMethod)DecompilerContext.getProperty(DecompilerContext.CURRENT_METHOD); diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionEdge.java b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionEdge.java index 9d97982..3ae444e 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionEdge.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionEdge.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"); * 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; - private int hashCode; + private final int hashCode; public VarVersionEdge(int type, VarVersionNode source, VarVersionNode dest) { this.type = type; diff --git a/src/org/jetbrains/java/decompiler/modules/renamer/ClassWrapperNode.java b/src/org/jetbrains/java/decompiler/modules/renamer/ClassWrapperNode.java index 273579a..566508b 100644 --- a/src/org/jetbrains/java/decompiler/modules/renamer/ClassWrapperNode.java +++ b/src/org/jetbrains/java/decompiler/modules/renamer/ClassWrapperNode.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"); * you may not use this file except in compliance with the License. @@ -22,11 +22,11 @@ import java.util.List; public class ClassWrapperNode { - private StructClass classStruct; + private final StructClass classStruct; private ClassWrapperNode superclass; - private List subclasses = new ArrayList(); + private final List subclasses = new ArrayList(); public ClassWrapperNode(StructClass cl) { this.classStruct = cl; diff --git a/src/org/jetbrains/java/decompiler/modules/renamer/ConverterHelper.java b/src/org/jetbrains/java/decompiler/modules/renamer/ConverterHelper.java index 142c6b0..5912e6e 100644 --- a/src/org/jetbrains/java/decompiler/modules/renamer/ConverterHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/renamer/ConverterHelper.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"); * 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 fieldCounter = 0; private int methodCounter = 0; - private Set setNonStandardClassNames = new HashSet(); + private final Set setNonStandardClassNames = new HashSet(); @Override public boolean toBeRenamed(Type elementType, String className, String element, String descriptor) { diff --git a/src/org/jetbrains/java/decompiler/modules/renamer/PoolInterceptor.java b/src/org/jetbrains/java/decompiler/modules/renamer/PoolInterceptor.java index 74e2ed8..7d589cc 100644 --- a/src/org/jetbrains/java/decompiler/modules/renamer/PoolInterceptor.java +++ b/src/org/jetbrains/java/decompiler/modules/renamer/PoolInterceptor.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"); * you may not use this file except in compliance with the License. @@ -21,11 +21,11 @@ import java.util.HashMap; public class PoolInterceptor { - private IIdentifierRenamer helper; + private final IIdentifierRenamer helper; - private HashMap mapOldToNewNames = new HashMap(); + private final HashMap mapOldToNewNames = new HashMap(); - private HashMap mapNewToOldNames = new HashMap(); + private final HashMap mapNewToOldNames = new HashMap(); public PoolInterceptor(IIdentifierRenamer helper) { this.helper = helper; diff --git a/src/org/jetbrains/java/decompiler/struct/attr/StructBootstrapMethodsAttribute.java b/src/org/jetbrains/java/decompiler/struct/attr/StructBootstrapMethodsAttribute.java index 840acc7..597bc7a 100644 --- a/src/org/jetbrains/java/decompiler/struct/attr/StructBootstrapMethodsAttribute.java +++ b/src/org/jetbrains/java/decompiler/struct/attr/StructBootstrapMethodsAttribute.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"); * 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 { - private List methodRefs = new ArrayList(); - private List> methodArguments = new ArrayList>(); + private final List methodRefs = new ArrayList(); + private final List> methodArguments = new ArrayList>(); @Override public void initContent(ConstantPool pool) throws IOException { diff --git a/src/org/jetbrains/java/decompiler/struct/consts/ConstantPool.java b/src/org/jetbrains/java/decompiler/struct/consts/ConstantPool.java index bc03aa4..6dc010d 100644 --- a/src/org/jetbrains/java/decompiler/struct/consts/ConstantPool.java +++ b/src/org/jetbrains/java/decompiler/struct/consts/ConstantPool.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"); * 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; private List pool = new ArrayList(); - private PoolInterceptor interceptor; + private final PoolInterceptor interceptor; public ConstantPool(DataInputStream in) throws IOException { diff --git a/src/org/jetbrains/java/decompiler/struct/match/MatchEngine.java b/src/org/jetbrains/java/decompiler/struct/match/MatchEngine.java index 56bc2bf..bdef810 100644 --- a/src/org/jetbrains/java/decompiler/struct/match/MatchEngine.java +++ b/src/org/jetbrains/java/decompiler/struct/match/MatchEngine.java @@ -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; import java.util.ArrayList; @@ -21,16 +36,16 @@ public class MatchEngine { private MatchNode rootNode = null; - private Map variables = new HashMap(); + private final Map variables = new HashMap(); - private static Map stat_properties = new HashMap(); - private static Map expr_properties = new HashMap(); - private static Map stat_type = new HashMap(); - private static Map expr_type = new HashMap(); - private static Map expr_func_type = new HashMap(); - private static Map expr_exit_type = new HashMap(); - private static Map stat_if_type = new HashMap(); - private static Map expr_const_type = new HashMap(); + private static final Map stat_properties = new HashMap(); + private static final Map expr_properties = new HashMap(); + private static final Map stat_type = new HashMap(); + private static final Map expr_type = new HashMap(); + private static final Map expr_func_type = new HashMap(); + private static final Map expr_exit_type = new HashMap(); + private static final Map stat_if_type = new HashMap(); + private static final Map expr_const_type = new HashMap(); static { stat_properties.put("type", MatchProperties.STATEMENT_TYPE); diff --git a/src/org/jetbrains/java/decompiler/struct/match/MatchNode.java b/src/org/jetbrains/java/decompiler/struct/match/MatchNode.java index e598820..34de504 100644 --- a/src/org/jetbrains/java/decompiler/struct/match/MatchNode.java +++ b/src/org/jetbrains/java/decompiler/struct/match/MatchNode.java @@ -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; import java.util.ArrayList; @@ -31,11 +46,11 @@ public class MatchNode { public static final int MATCHNODE_STATEMENT = 0; public static final int MATCHNODE_EXPRENT = 1; - private int type; + private final int type; - private Map rules = new HashMap(); + private final Map rules = new HashMap(); - private List children = new ArrayList(); + private final List children = new ArrayList(); public MatchNode(int type) { diff --git a/src/org/jetbrains/java/decompiler/util/FastFixedSetFactory.java b/src/org/jetbrains/java/decompiler/util/FastFixedSetFactory.java index a26b77e..09ce36b 100644 --- a/src/org/jetbrains/java/decompiler/util/FastFixedSetFactory.java +++ b/src/org/jetbrains/java/decompiler/util/FastFixedSetFactory.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"); * you may not use this file except in compliance with the License. @@ -19,9 +19,9 @@ import java.util.*; public class FastFixedSetFactory { - private VBStyleCollection colValuesInternal = new VBStyleCollection(); + private final VBStyleCollection colValuesInternal = new VBStyleCollection(); - private int dataLength; + private final int dataLength; public FastFixedSetFactory(Collection set) { @@ -59,9 +59,9 @@ public class FastFixedSetFactory { public static class FastFixedSet implements Iterable { - private FastFixedSetFactory factory; + private final FastFixedSetFactory factory; - private VBStyleCollection colValuesInternal; + private final VBStyleCollection colValuesInternal; private int[] data; @@ -286,9 +286,9 @@ public class FastFixedSetFactory { public static class FastFixedSetIterator implements Iterator { - private VBStyleCollection colValuesInternal; - private int[] data; - private int size; + private final VBStyleCollection colValuesInternal; + private final int[] data; + private final int size; private int pointer = -1; private int next_pointer = -1; diff --git a/src/org/jetbrains/java/decompiler/util/FastSetFactory.java b/src/org/jetbrains/java/decompiler/util/FastSetFactory.java index e9cce03..833629b 100644 --- a/src/org/jetbrains/java/decompiler/util/FastSetFactory.java +++ b/src/org/jetbrains/java/decompiler/util/FastSetFactory.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"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import java.util.Set; public class FastSetFactory { - private VBStyleCollection colValuesInternal = new VBStyleCollection(); + private final VBStyleCollection colValuesInternal = new VBStyleCollection(); private int lastBlock; @@ -89,9 +89,9 @@ public class FastSetFactory { public static class FastSet implements Iterable { - private FastSetFactory factory; + private final FastSetFactory factory; - private VBStyleCollection colValuesInternal; + private final VBStyleCollection colValuesInternal; private int[] data; @@ -427,8 +427,8 @@ public class FastSetFactory { public static class FastSetIterator implements Iterator { - private VBStyleCollection colValuesInternal; - private int[] data; + private final VBStyleCollection colValuesInternal; + private final int[] data; private int size; private int pointer = -1; diff --git a/src/org/jetbrains/java/decompiler/util/FastSparseSetFactory.java b/src/org/jetbrains/java/decompiler/util/FastSparseSetFactory.java index 64e98a0..d94d059 100644 --- a/src/org/jetbrains/java/decompiler/util/FastSparseSetFactory.java +++ b/src/org/jetbrains/java/decompiler/util/FastSparseSetFactory.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"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import java.util.Set; public class FastSparseSetFactory { - private VBStyleCollection colValuesInternal = new VBStyleCollection(); + private final VBStyleCollection colValuesInternal = new VBStyleCollection(); private int lastBlock; @@ -90,9 +90,9 @@ public class FastSparseSetFactory { public static class FastSparseSet implements Iterable { public static final FastSparseSet[] EMPTY_ARRAY = new FastSparseSet[0]; - private FastSparseSetFactory factory; + private final FastSparseSetFactory factory; - private VBStyleCollection colValuesInternal; + private final VBStyleCollection colValuesInternal; private int[] data; private int[] next; @@ -478,10 +478,10 @@ public class FastSparseSetFactory { public static class FastSparseSetIterator implements Iterator { - private VBStyleCollection colValuesInternal; - private int[] data; - private int[] next; - private int size; + private final VBStyleCollection colValuesInternal; + private final int[] data; + private final int[] next; + private final int size; private int pointer = -1; private int next_pointer = -1; diff --git a/src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java b/src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java index b70dede..fd9d5c4 100644 --- a/src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java +++ b/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"); * you may not use this file except in compliance with the License. @@ -27,9 +27,9 @@ public class SFormsFastMapDirect { private int size; - @SuppressWarnings("unchecked") private FastSparseSet[][] elements = new FastSparseSet[3][]; + @SuppressWarnings("unchecked") private final FastSparseSet[][] elements = new FastSparseSet[3][]; - private int[][] next = new int[3][]; + private final int[][] next = new int[3][]; public SFormsFastMapDirect() { this(true); @@ -363,8 +363,8 @@ public class SFormsFastMapDirect { list.add(new Entry>() { - private Integer var = key; - private FastSparseSet val = ent; + private final Integer var = key; + private final FastSparseSet val = ent; public Integer getKey() { return var;