Made SoftWrapper fields final.

This commit is contained in:
Martijn van Groningen 2013-02-04 14:47:36 +01:00
parent 8109d13733
commit bc667c378e
1 changed files with 16 additions and 16 deletions

View File

@ -71,7 +71,7 @@ public class CacheRecycler {
// ----- ExtTHashMap ----- // ----- ExtTHashMap -----
private static SoftWrapper<Queue<ExtTHashMap>> hashMap = new SoftWrapper<Queue<ExtTHashMap>>(); private final static SoftWrapper<Queue<ExtTHashMap>> hashMap = new SoftWrapper<Queue<ExtTHashMap>>();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <K, V> ExtTHashMap<K, V> popHashMap() { public static <K, V> ExtTHashMap<K, V> popHashMap() {
@ -98,7 +98,7 @@ public class CacheRecycler {
// ----- THashSet ----- // ----- THashSet -----
private static SoftWrapper<Queue<THashSet>> hashSet = new SoftWrapper<Queue<THashSet>>(); private final static SoftWrapper<Queue<THashSet>> hashSet = new SoftWrapper<Queue<THashSet>>();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> THashSet<T> popHashSet() { public static <T> THashSet<T> popHashSet() {
@ -125,7 +125,7 @@ public class CacheRecycler {
// ------ ExtTDoubleObjectHashMap ----- // ------ ExtTDoubleObjectHashMap -----
private static SoftWrapper<Queue<ExtTDoubleObjectHashMap>> doubleObjectHashMap = new SoftWrapper<Queue<ExtTDoubleObjectHashMap>>(); private final static SoftWrapper<Queue<ExtTDoubleObjectHashMap>> doubleObjectHashMap = new SoftWrapper<Queue<ExtTDoubleObjectHashMap>>();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> ExtTDoubleObjectHashMap<T> popDoubleObjectMap() { public static <T> ExtTDoubleObjectHashMap<T> popDoubleObjectMap() {
@ -152,7 +152,7 @@ public class CacheRecycler {
// ----- ExtTLongObjectHashMap ---- // ----- ExtTLongObjectHashMap ----
private static SoftWrapper<Queue<ExtTLongObjectHashMap>> longObjectHashMap = new SoftWrapper<Queue<ExtTLongObjectHashMap>>(); private final static SoftWrapper<Queue<ExtTLongObjectHashMap>> longObjectHashMap = new SoftWrapper<Queue<ExtTLongObjectHashMap>>();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> ExtTLongObjectHashMap<T> popLongObjectMap() { public static <T> ExtTLongObjectHashMap<T> popLongObjectMap() {
@ -179,7 +179,7 @@ public class CacheRecycler {
// ----- TLongLongHashMap ---- // ----- TLongLongHashMap ----
private static SoftWrapper<Queue<TLongLongHashMap>> longLongHashMap = new SoftWrapper<Queue<TLongLongHashMap>>(); private final static SoftWrapper<Queue<TLongLongHashMap>> longLongHashMap = new SoftWrapper<Queue<TLongLongHashMap>>();
public static TLongLongHashMap popLongLongMap() { public static TLongLongHashMap popLongLongMap() {
Queue<TLongLongHashMap> ref = longLongHashMap.get(); Queue<TLongLongHashMap> ref = longLongHashMap.get();
@ -205,7 +205,7 @@ public class CacheRecycler {
// ----- TIntIntHashMap ---- // ----- TIntIntHashMap ----
private static SoftWrapper<Queue<TIntIntHashMap>> intIntHashMap = new SoftWrapper<Queue<TIntIntHashMap>>(); private final static SoftWrapper<Queue<TIntIntHashMap>> intIntHashMap = new SoftWrapper<Queue<TIntIntHashMap>>();
public static TIntIntHashMap popIntIntMap() { public static TIntIntHashMap popIntIntMap() {
@ -233,7 +233,7 @@ public class CacheRecycler {
// ----- TFloatIntHashMap --- // ----- TFloatIntHashMap ---
private static SoftWrapper<Queue<TFloatIntHashMap>> floatIntHashMap = new SoftWrapper<Queue<TFloatIntHashMap>>(); private final static SoftWrapper<Queue<TFloatIntHashMap>> floatIntHashMap = new SoftWrapper<Queue<TFloatIntHashMap>>();
public static TFloatIntHashMap popFloatIntMap() { public static TFloatIntHashMap popFloatIntMap() {
@ -261,7 +261,7 @@ public class CacheRecycler {
// ----- TDoubleIntHashMap --- // ----- TDoubleIntHashMap ---
private static SoftWrapper<Queue<TDoubleIntHashMap>> doubleIntHashMap = new SoftWrapper<Queue<TDoubleIntHashMap>>(); private final static SoftWrapper<Queue<TDoubleIntHashMap>> doubleIntHashMap = new SoftWrapper<Queue<TDoubleIntHashMap>>();
public static TDoubleIntHashMap popDoubleIntMap() { public static TDoubleIntHashMap popDoubleIntMap() {
@ -289,7 +289,7 @@ public class CacheRecycler {
// ----- TByteIntHashMap --- // ----- TByteIntHashMap ---
private static SoftWrapper<Queue<TByteIntHashMap>> byteIntHashMap = new SoftWrapper<Queue<TByteIntHashMap>>(); private final static SoftWrapper<Queue<TByteIntHashMap>> byteIntHashMap = new SoftWrapper<Queue<TByteIntHashMap>>();
public static TByteIntHashMap popByteIntMap() { public static TByteIntHashMap popByteIntMap() {
@ -316,7 +316,7 @@ public class CacheRecycler {
// ----- TShortIntHashMap --- // ----- TShortIntHashMap ---
private static SoftWrapper<Queue<TShortIntHashMap>> shortIntHashMap = new SoftWrapper<Queue<TShortIntHashMap>>(); private final static SoftWrapper<Queue<TShortIntHashMap>> shortIntHashMap = new SoftWrapper<Queue<TShortIntHashMap>>();
public static TShortIntHashMap popShortIntMap() { public static TShortIntHashMap popShortIntMap() {
@ -344,7 +344,7 @@ public class CacheRecycler {
// ----- TLongIntHashMap ---- // ----- TLongIntHashMap ----
private static SoftWrapper<Queue<TLongIntHashMap>> longIntHashMap = new SoftWrapper<Queue<TLongIntHashMap>>(); private final static SoftWrapper<Queue<TLongIntHashMap>> longIntHashMap = new SoftWrapper<Queue<TLongIntHashMap>>();
public static TLongIntHashMap popLongIntMap() { public static TLongIntHashMap popLongIntMap() {
@ -371,7 +371,7 @@ public class CacheRecycler {
// ------ TObjectIntHashMap ----- // ------ TObjectIntHashMap -----
private static SoftWrapper<Queue<TObjectIntHashMap>> objectIntHashMap = new SoftWrapper<Queue<TObjectIntHashMap>>(); private final static SoftWrapper<Queue<TObjectIntHashMap>> objectIntHashMap = new SoftWrapper<Queue<TObjectIntHashMap>>();
@SuppressWarnings({"unchecked"}) @SuppressWarnings({"unchecked"})
@ -399,7 +399,7 @@ public class CacheRecycler {
// ------ TIntObjectHashMap ----- // ------ TIntObjectHashMap -----
private static SoftWrapper<Queue<TIntObjectHashMap>> intObjectHashMap = new SoftWrapper<Queue<TIntObjectHashMap>>(); private final static SoftWrapper<Queue<TIntObjectHashMap>> intObjectHashMap = new SoftWrapper<Queue<TIntObjectHashMap>>();
@SuppressWarnings({"unchecked"}) @SuppressWarnings({"unchecked"})
@ -427,7 +427,7 @@ public class CacheRecycler {
// ------ TObjectFloatHashMap ----- // ------ TObjectFloatHashMap -----
private static SoftWrapper<Queue<TObjectFloatHashMap>> objectFloatHashMap = new SoftWrapper<Queue<TObjectFloatHashMap>>(); private final static SoftWrapper<Queue<TObjectFloatHashMap>> objectFloatHashMap = new SoftWrapper<Queue<TObjectFloatHashMap>>();
@SuppressWarnings({"unchecked"}) @SuppressWarnings({"unchecked"})
public static <T> TObjectFloatHashMap<T> popObjectFloatMap() { public static <T> TObjectFloatHashMap<T> popObjectFloatMap() {
@ -454,7 +454,7 @@ public class CacheRecycler {
// ----- int[] ----- // ----- int[] -----
private static SoftWrapper<Queue<Object[]>> objectArray = new SoftWrapper<Queue<Object[]>>(); private final static SoftWrapper<Queue<Object[]>> objectArray = new SoftWrapper<Queue<Object[]>>();
public static Object[] popObjectArray(int size) { public static Object[] popObjectArray(int size) {
size = size < 100 ? 100 : size; size = size < 100 ? 100 : size;
@ -483,7 +483,7 @@ public class CacheRecycler {
} }
private static SoftWrapper<Queue<int[]>> intArray = new SoftWrapper<Queue<int[]>>(); private final static SoftWrapper<Queue<int[]>> intArray = new SoftWrapper<Queue<int[]>>();
public static int[] popIntArray(int size) { public static int[] popIntArray(int size) {
return popIntArray(size, 0); return popIntArray(size, 0);