No effective change - add final modifier

This commit is contained in:
Robin Bygrave
2015-07-31 14:02:38 +12:00
parent deed0bb01d
commit 90886193c0
42 changed files with 75 additions and 81 deletions
@@ -24,7 +24,7 @@ class DRawSqlParser {
private int placeHolderAndWhere;
private int placeHolderHaving;
private int placeHolderAndHaving;
private boolean hasPlaceHolders;
private final boolean hasPlaceHolders;
private int selectPos = -1;
private int distinctPos = -1;
@@ -45,7 +45,7 @@ public final class EntityBeanIntercept implements Serializable {
/**
* The actual entity bean that 'owns' this intercept.
*/
private EntityBean owner;
private final EntityBean owner;
private EntityBean embeddedOwner;
private int embeddedOwnerIndex;
@@ -72,7 +72,7 @@ public final class EntityBeanIntercept implements Serializable {
/**
* Used when a bean is partially filled.
*/
private boolean[] loadedProps;
private final boolean[] loadedProps;
private boolean fullyLoadedBean;
@@ -74,7 +74,7 @@ public interface PersistenceContext {
* The bean was previously deleted from this persistence context (can't hit
* L2 cache).
*/
public static WithOption DELETED = new WithOption(true);
public static final WithOption DELETED = new WithOption(true);
private final boolean deleted;
private final Object bean;
@@ -36,7 +36,7 @@ public enum PersistBatch {
INHERIT(false);
boolean forInsert;
final boolean forInsert;
PersistBatch(boolean forInsert) {
this.forInsert = forInsert;
@@ -19,7 +19,7 @@ import com.fasterxml.jackson.core.JsonToken;
class EJsonReader {
static JsonFactory json = new JsonFactory();
static final JsonFactory json = new JsonFactory();
@SuppressWarnings("unchecked")
static Map<String, Object> parseObject(String json, boolean modifyAware) throws IOException {
@@ -19,7 +19,7 @@ class EJsonWriter {
/**
* Base jsonFactory implementation used when it is not passed in.
*/
static JsonFactory jsonFactory = new JsonFactory();
static final JsonFactory jsonFactory = new JsonFactory();
static String write(Object object) throws IOException {
StringWriter writer = new StringWriter(200);
@@ -13,7 +13,7 @@ import java.util.Map;
*/
public class JsonReadOptions {
protected Map<String, JsonReadBeanVisitor<?>> visitorMap;
protected final Map<String, JsonReadBeanVisitor<?>> visitorMap;
protected Object objectMapper;
@@ -34,22 +34,22 @@ public class Packet {
/**
* The type of Packet.
*/
protected short packetType;
protected final short packetType;
/**
* The PacketId.
*/
protected long packetId;
protected final long packetId;
/**
* The timestamp the Packet was created.
*/
protected long timestamp;
protected final long timestamp;
/**
* The EbeanServer name this relates to if relevant.
*/
protected String serverName;
protected final String serverName;
protected ByteArrayOutputStream buffer;
protected DataOutputStream dataOut;
@@ -16,7 +16,7 @@ import java.util.List;
*/
public class IncomingPacketsLastAck {
private HashMap<String,MessageAck> lastAckMap = new HashMap<String, MessageAck>();
private final HashMap<String,MessageAck> lastAckMap = new HashMap<String, MessageAck>();
public String toString() {
return lastAckMap.values().toString();
@@ -103,9 +103,9 @@ public class IncomingPacketsProcessed {
/**
* Packets received out of order.
*/
private ArrayList<Long> outOfOrderList = new ArrayList<Long>();
private final ArrayList<Long> outOfOrderList = new ArrayList<Long>();
private HashMap<Long,Integer> resendCountMap = new HashMap<Long,Integer>();
private final HashMap<Long,Integer> resendCountMap = new HashMap<Long,Integer>();
public GotAllPoint(String memberKey, int maxResendIncoming) {
this.memberKey = memberKey;
@@ -102,12 +102,12 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
* Packets are cleared from the outgoingPacketsCache quicker at the cost of
* sending more packets.
*/
private long managerSleepMillis;
private final long managerSleepMillis;
/**
* When true then packets are still sent out even when the cluster has no other online members.
*/
private boolean sendWithNoMembers;
private final boolean sendWithNoMembers;
/**
* The current minAcked packetId processed by the managerThread.
@@ -143,7 +143,7 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
/**
* The max time we go without sending any packets.
*/
private int lastSendTimeFreqMillis;
private final int lastSendTimeFreqMillis;
/**
* The last time the cluster status was logged.
@@ -153,7 +153,7 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
/**
* The max time we go before logging the cluster status.
*/
private int lastStatusTimeFreqMillis;
private final int lastStatusTimeFreqMillis;
private long totalTxnEventsSent;
@@ -57,7 +57,7 @@ public class McastListener implements Runnable {
private DatagramPacket pack;
private byte[] receiveBuffer;
private final byte[] receiveBuffer;
private volatile boolean shutdown;
private volatile boolean shutdownComplete;
@@ -7,7 +7,7 @@ public class OutgoingPacketsAcked {
private long minimumGotAllPacketId;
private Map<String, GroupMemberAck> recievedByMap = new HashMap<String, GroupMemberAck>();
private final Map<String, GroupMemberAck> recievedByMap = new HashMap<String, GroupMemberAck>();
public int getGroupSize() {
synchronized (this) {
@@ -11,7 +11,7 @@ import java.util.HashMap;
*/
public final class InternString {
private static HashMap<String,String> map = new HashMap<String,String>();
private static final HashMap<String,String> map = new HashMap<String,String>();
/**
@@ -37,7 +37,7 @@ public class DRawSqlSelectBuilder {
private int placeHolderAndWhere;
private int placeHolderHaving;
private int placeHolderAndHaving;
private boolean hasPlaceHolders;
private final boolean hasPlaceHolders;
private int selectPos = -1;
private int fromPos = -1;
@@ -51,7 +51,7 @@ public class DRawSqlSelectBuilder {
private boolean havingExprAnd;
private int havingExprPos = -1;
private String tableAlias;
private final String tableAlias;
public DRawSqlSelectBuilder(NamingConvention namingConvention, BeanDescriptor<?> desc, DRawSqlMeta sqlSelectMeta) {
@@ -21,7 +21,7 @@ public class ManyType {
SET(Set.class),
MAP(null);
Class<? extends Collection> type;
final Class<? extends Collection> type;
Underlying(Class<? extends Collection> type) {
this.type = type;
@@ -19,7 +19,7 @@ public class InsertTimestampFactory {
final GeneratedInsertLong longTime = new GeneratedInsertLong();
Map<Class<?>, GeneratedProperty> map = new HashMap<Class<?>, GeneratedProperty>();
final Map<Class<?>, GeneratedProperty> map = new HashMap<Class<?>, GeneratedProperty>();
public InsertTimestampFactory() {
map.put(Timestamp.class, new GeneratedInsertTimestamp());
@@ -99,13 +99,13 @@ public class DeployBeanDescriptor<T> {
/**
* The EntityBean type used to create new EntityBeans.
*/
private Class<T> beanType;
private final Class<T> beanType;
private List<BeanPersistController> persistControllers = new ArrayList<BeanPersistController>(2);
private List<BeanPersistListener> persistListeners = new ArrayList<BeanPersistListener>(2);
private List<BeanQueryAdapter> queryAdapters = new ArrayList<BeanQueryAdapter>(2);
private final List<BeanPersistController> persistControllers = new ArrayList<BeanPersistController>(2);
private final List<BeanPersistListener> persistListeners = new ArrayList<BeanPersistListener>(2);
private final List<BeanQueryAdapter> queryAdapters = new ArrayList<BeanQueryAdapter>(2);
private CacheOptions cacheOptions = new CacheOptions();
private final CacheOptions cacheOptions = new CacheOptions();
/**
* If set overrides the find implementation. Server side only.
@@ -115,7 +115,7 @@ public class DeployBeanDescriptor<T> {
/**
* The table joins for this bean. Server side only.
*/
private ArrayList<DeployTableJoin> tableJoinList = new ArrayList<DeployTableJoin>(2);
private final ArrayList<DeployTableJoin> tableJoinList = new ArrayList<DeployTableJoin>(2);
/**
* Inheritance information. Server side only.
@@ -15,7 +15,7 @@ public class DeployBeanEmbedded {
/**
* A map of property names to dbColumns.
*/
Map<String,String> propMap = new HashMap<String, String>();
final Map<String,String> propMap = new HashMap<String, String>();
/**
* Set a property name to use a specific dbColumn.
@@ -162,7 +162,7 @@ public class DeployBeanProperty {
/**
* The bean type.
*/
private Class<?> propertyType;
private final Class<?> propertyType;
/**
* Set for Non-JDBC types to provide logical to db type conversion.
@@ -190,7 +190,7 @@ public class DeployBeanProperty {
/**
* Extra deployment parameters.
*/
private HashMap<String, String> extraAttributeMap = new HashMap<String, String>();
private final HashMap<String, String> extraAttributeMap = new HashMap<String, String>();
/**
* The method used to read the property.
@@ -16,7 +16,7 @@ public abstract class DeployBeanPropertyAssoc<T> extends DeployBeanProperty {
/**
* Persist settings.
*/
BeanCascadeInfo cascadeInfo = new BeanCascadeInfo();
final BeanCascadeInfo cascadeInfo = new BeanCascadeInfo();
/**
* The join table information.
@@ -26,7 +26,7 @@ public abstract class DeployBeanPropertyAssoc<T> extends DeployBeanProperty {
/**
* Join between the beans.
*/
DeployTableJoin tableJoin = new DeployTableJoin();
final DeployTableJoin tableJoin = new DeployTableJoin();
/**
* Whether the associated join type should be an outer join.
@@ -38,7 +38,7 @@ public class DeployBeanPropertyAssocMany<T> extends DeployBeanPropertyAssoc<T> {
/**
* The type of the many, set, list or map.
*/
ManyType manyType;
final ManyType manyType;
/**
* Create this property.
@@ -36,7 +36,7 @@ public class DeployTableJoin {
/**
* The list of properties mapped to this joined table.
*/
private ArrayList<DeployBeanProperty> properties = new ArrayList<DeployBeanProperty>();
private final ArrayList<DeployBeanProperty> properties = new ArrayList<DeployBeanProperty>();
/**
* The list of join column pairs. Used to generate the on clause.
@@ -46,7 +46,7 @@ public class DeployTableJoin {
/**
* The persist cascade info.
*/
private BeanCascadeInfo cascadeInfo = new BeanCascadeInfo();
private final BeanCascadeInfo cascadeInfo = new BeanCascadeInfo();
private InheritInfo inheritInfo;
@@ -20,9 +20,9 @@ public class DeployTableJoinColumn {
*/
String foreignDbColumn;
boolean insertable;
boolean updateable;
final boolean insertable;
final boolean updateable;
/**
* Construct when automatically determining the join.
@@ -28,11 +28,11 @@ public class DeployInheritInfo {
private String discriminatorWhere;
private Class<?> type;
private final Class<?> type;
private Class<?> parent;
private ArrayList<DeployInheritInfo> children = new ArrayList<DeployInheritInfo>();
private final ArrayList<DeployInheritInfo> children = new ArrayList<DeployInheritInfo>();
/**
* Create for a given type.
@@ -15,7 +15,7 @@ public final class ElFilter<T> implements Filter<T> {
private final BeanDescriptor<T> beanDescriptor;
private ArrayList<ElMatcher<T>> matches = new ArrayList<ElMatcher<T>>();
private final ArrayList<ElMatcher<T>> matches = new ArrayList<ElMatcher<T>>();
private int maxRows;
@@ -16,7 +16,7 @@ public class FilterExprPath implements Serializable {
/**
* The path of the filterMany.
*/
private String path;
private final String path;
public FilterExprPath(String path) {
this.path = path;
@@ -14,9 +14,9 @@ public class FileResourceContent implements ResourceContent {
/**
* The underlying file.
*/
File file;
final File file;
String entryName;
final String entryName;
/**
* Create with a File and the entryName.
@@ -10,9 +10,9 @@ public class FileResourceSource extends AbstractResourceSource implements Resour
/**
* The directory name.
*/
String directory;
String baseDir;
final String directory;
final String baseDir;
/**
* Create the source based on a directory name.
@@ -27,7 +27,7 @@ public class Dnode {
ArrayList<Dnode> children;
LinkedHashMap<String, String> attrList = new LinkedHashMap<String, String>();
final LinkedHashMap<String, String> attrList = new LinkedHashMap<String, String>();
/**
* Create a node.
@@ -29,7 +29,7 @@ public class DnodeParser extends DefaultHandler {
/**
* Used to stack the nodes.
*/
Stack<Dnode> stack = new Stack<Dnode>();
final Stack<Dnode> stack = new Stack<Dnode>();
/**
* The class used to construct new nodes. Should be Dnode or a subtype of
@@ -5,10 +5,10 @@ package com.avaje.ebeaninternal.server.lib.util;
*/
public class MailAddress {
String alias;
String emailAddress;
final String alias;
final String emailAddress;
/**
* Create an address with an optional alias.
@@ -9,12 +9,12 @@ public class MailEvent {
/**
* The error indicating a send failure.
*/
Throwable error;
final Throwable error;
/**
* The message that was sent.
*/
MailMessage message;
final MailMessage message;
/**
@@ -10,16 +10,11 @@ import java.util.List;
* A simple test message that can be sent via smtp.
*/
public class MailMessage {
// /**
// * The subject text.
// */
// String subject;
/**
* The body content.
*/
ArrayList<String> bodylines;
final ArrayList<String> bodylines;
/**
* The sender email address.
@@ -29,7 +24,7 @@ public class MailMessage {
/**
* The headers.
*/
HashMap<String,String> header = new HashMap<String, String>();
final HashMap<String,String> header = new HashMap<String, String>();
/**
* the recipient of the email.
@@ -39,7 +34,7 @@ public class MailMessage {
/**
* The list of recipients.
*/
ArrayList<MailAddress> recipientList = new ArrayList<MailAddress>();
final ArrayList<MailAddress> recipientList = new ArrayList<MailAddress>();
/**
* Create the message.
@@ -21,7 +21,7 @@ public class MailSender implements Runnable {
int traceLevel = 0;
Socket sserver;
String server;
final String server;
BufferedReader in;
@@ -6,8 +6,8 @@ import java.util.LinkedHashMap;
* Utility String class that supports String manipulation functions.
*/
public class MapFromString {
LinkedHashMap<String,String> map = new LinkedHashMap<String,String>();
final LinkedHashMap<String,String> map = new LinkedHashMap<String,String>();
String mapToString;
@@ -34,7 +34,7 @@ public class MimeTypeHelper {
}
private static ResourceBundle resources = ResourceBundle.getBundle("com.avaje.lib.util.mimetypes");
private static final ResourceBundle resources = ResourceBundle.getBundle("com.avaje.lib.util.mimetypes");
}
@@ -38,7 +38,7 @@ public class DefaultSqlRow implements SqlRow {
/**
* The underlying map of property data.
*/
Map<String, Object> map;
final Map<String, Object> map;
/**
* Create with a specific Map implementation.
@@ -9,7 +9,7 @@ import com.avaje.ebeaninternal.server.transaction.TransactionMap.State;
*/
public final class DefaultTransactionThreadLocal {
private static ThreadLocal<TransactionMap> local = new ThreadLocal<TransactionMap>() {
private static final ThreadLocal<TransactionMap> local = new ThreadLocal<TransactionMap>() {
protected synchronized TransactionMap initialValue() {
return new TransactionMap();
}
@@ -12,12 +12,11 @@ import javax.transaction.UserTransaction;
*/
public class JtaTransaction extends JdbcTransaction {
private UserTransaction userTransaction;
private final UserTransaction userTransaction;
private boolean commmitted = false;
private boolean newTransaction = false;
private boolean commmitted;
private boolean newTransaction;
/**
* Create the JtaTransaction.
@@ -16,13 +16,13 @@ import java.util.Map;
*/
public final class ImmutableCompoundTypeBuilder {
private static ThreadLocal<ImmutableCompoundTypeBuilder> local = new ThreadLocal<ImmutableCompoundTypeBuilder>() {
private static final ThreadLocal<ImmutableCompoundTypeBuilder> local = new ThreadLocal<ImmutableCompoundTypeBuilder>() {
protected synchronized ImmutableCompoundTypeBuilder initialValue() {
return new ImmutableCompoundTypeBuilder();
}
};
private Map<Class<?>, Entry> entryMap = new HashMap<Class<?>, Entry>();
private final Map<Class<?>, Entry> entryMap = new HashMap<Class<?>, Entry>();
/**
* Clear the cache of partial compound objects.
@@ -38,7 +38,7 @@ public class FilterExpressionList<T> extends DefaultExpressionList<T> {
return pathPrefix;
}
private String notAllowedMessage = "This method is not allowed on a filter";
private final String notAllowedMessage = "This method is not allowed on a filter";
@Override
public ExpressionList<T> filterMany(String prop) {