decompiler: cleanup - marked const fields final

This commit is contained in:
Egor.Ushakov
2015-03-26 15:26:52 +03:00
parent 9ec79b5701
commit ca7e2dfa1c
58 changed files with 220 additions and 196 deletions

View File

@@ -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();

View File

@@ -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<String, ClassNode> mapRootClasses = new HashMap<String, ClassNode>();
private final Map<String, ClassNode> mapRootClasses = new HashMap<String, ClassNode>();
public ClassesProcessor(StructContext context) {

View File

@@ -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<DecompilerContext> currentContext = new ThreadLocal<DecompilerContext>();
private static final ThreadLocal<DecompilerContext> currentContext = new ThreadLocal<DecompilerContext>();
private final Map<String, Object> properties;
private StructContext structContext;

View File

@@ -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<String, Object> options, IFernflowerLogger logger) {

View File

@@ -27,7 +27,7 @@ public class BytecodeMappingTracer {
private StructLineNumberTableAttribute lineNumberTable = null;
// 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() { }

View File

@@ -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;

View File

@@ -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<String, String> mapSimpleNames = new HashMap<String, String>();
private Set<String> setNotImportedNames = new HashSet<String>();
private final Map<String, String> mapSimpleNames = new HashMap<String, String>();
private final Set<String> setNotImportedNames = new HashSet<String>();
private String currentPackageSlash = "";
private String currentPackagePoint = "";

View File

@@ -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<String> usedNames = new HashSet<String>();
private final Set<String> usedNames = new HashSet<String>();
public VarNamesCollector() { }

View File

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

View File

@@ -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<String> hiddenMembers = new HashSet<String>();
private VBStyleCollection<Exprent, String> staticFieldInitializers = new VBStyleCollection<Exprent, String>();
private VBStyleCollection<Exprent, String> dynamicFieldInitializers = new VBStyleCollection<Exprent, String>();
private VBStyleCollection<MethodWrapper, String> methods = new VBStyleCollection<MethodWrapper, String>();
private final StructClass classStruct;
private final Set<String> hiddenMembers = new HashSet<String>();
private final VBStyleCollection<Exprent, String> staticFieldInitializers = new VBStyleCollection<Exprent, String>();
private final VBStyleCollection<Exprent, String> dynamicFieldInitializers = new VBStyleCollection<Exprent, String>();
private final VBStyleCollection<MethodWrapper, String> methods = new VBStyleCollection<MethodWrapper, String>();
public ClassWrapper(StructClass classStruct) {
this.classStruct = classStruct;

View File

@@ -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<MethodWrapper, Integer> mapMethodType = new HashMap<MethodWrapper, Integer>();
private final Map<MethodWrapper, Integer> mapMethodType = new HashMap<MethodWrapper, Integer>();
public void propagateMemberAccess(ClassNode root) {