Not used IntegerHolder class removed (#8747)
Motivation: IntergerHolder was left from some old days and not used anymore. Modification: Remove IntergerHolder from the codebase. Result: Removed unused code
This commit is contained in:
parent
45c0ea543f
commit
91e7e3d8c9
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright 2014 The Netty Project
|
||||
*
|
||||
* The Netty Project licenses this file to you 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 io.netty.util.internal;
|
||||
|
||||
/**
|
||||
* @deprecated For removal in netty 4.2
|
||||
*/
|
||||
@Deprecated
|
||||
public final class IntegerHolder {
|
||||
public int value;
|
||||
}
|
@ -144,9 +144,6 @@ public final class InternalThreadLocalMap extends UnpaddedInternalThreadLocalMap
|
||||
if (handlerSharableCache != null) {
|
||||
count ++;
|
||||
}
|
||||
if (counterHashCode != null) {
|
||||
count ++;
|
||||
}
|
||||
if (random != null) {
|
||||
count ++;
|
||||
}
|
||||
@ -196,7 +193,7 @@ public final class InternalThreadLocalMap extends UnpaddedInternalThreadLocalMap
|
||||
public Map<Charset, CharsetEncoder> charsetEncoderCache() {
|
||||
Map<Charset, CharsetEncoder> cache = charsetEncoderCache;
|
||||
if (cache == null) {
|
||||
charsetEncoderCache = cache = new IdentityHashMap<Charset, CharsetEncoder>();
|
||||
charsetEncoderCache = cache = new IdentityHashMap<>();
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
@ -204,7 +201,7 @@ public final class InternalThreadLocalMap extends UnpaddedInternalThreadLocalMap
|
||||
public Map<Charset, CharsetDecoder> charsetDecoderCache() {
|
||||
Map<Charset, CharsetDecoder> cache = charsetDecoderCache;
|
||||
if (cache == null) {
|
||||
charsetDecoderCache = cache = new IdentityHashMap<Charset, CharsetDecoder>();
|
||||
charsetDecoderCache = cache = new IdentityHashMap<>();
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
@ -217,7 +214,7 @@ public final class InternalThreadLocalMap extends UnpaddedInternalThreadLocalMap
|
||||
public <E> ArrayList<E> arrayList(int minCapacity) {
|
||||
ArrayList<E> list = (ArrayList<E>) arrayList;
|
||||
if (list == null) {
|
||||
arrayList = new ArrayList<Object>(minCapacity);
|
||||
arrayList = new ArrayList<>(minCapacity);
|
||||
return (ArrayList<E>) arrayList;
|
||||
}
|
||||
list.clear();
|
||||
@ -244,7 +241,7 @@ public final class InternalThreadLocalMap extends UnpaddedInternalThreadLocalMap
|
||||
public Map<Class<?>, TypeParameterMatcher> typeParameterMatcherGetCache() {
|
||||
Map<Class<?>, TypeParameterMatcher> cache = typeParameterMatcherGetCache;
|
||||
if (cache == null) {
|
||||
typeParameterMatcherGetCache = cache = new IdentityHashMap<Class<?>, TypeParameterMatcher>();
|
||||
typeParameterMatcherGetCache = cache = new IdentityHashMap<>();
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
@ -252,26 +249,16 @@ public final class InternalThreadLocalMap extends UnpaddedInternalThreadLocalMap
|
||||
public Map<Class<?>, Map<String, TypeParameterMatcher>> typeParameterMatcherFindCache() {
|
||||
Map<Class<?>, Map<String, TypeParameterMatcher>> cache = typeParameterMatcherFindCache;
|
||||
if (cache == null) {
|
||||
typeParameterMatcherFindCache = cache = new IdentityHashMap<Class<?>, Map<String, TypeParameterMatcher>>();
|
||||
typeParameterMatcherFindCache = cache = new IdentityHashMap<>();
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public IntegerHolder counterHashCode() {
|
||||
return counterHashCode;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setCounterHashCode(IntegerHolder counterHashCode) {
|
||||
this.counterHashCode = counterHashCode;
|
||||
}
|
||||
|
||||
public Map<Class<?>, Boolean> handlerSharableCache() {
|
||||
Map<Class<?>, Boolean> cache = handlerSharableCache;
|
||||
if (cache == null) {
|
||||
// Start with small capacity to keep memory overhead as low as possible.
|
||||
handlerSharableCache = cache = new WeakHashMap<Class<?>, Boolean>(4);
|
||||
handlerSharableCache = cache = new WeakHashMap<>(4);
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
*/
|
||||
class UnpaddedInternalThreadLocalMap {
|
||||
|
||||
static final ThreadLocal<InternalThreadLocalMap> slowThreadLocalMap = new ThreadLocal<InternalThreadLocalMap>();
|
||||
static final ThreadLocal<InternalThreadLocalMap> slowThreadLocalMap = new ThreadLocal<>();
|
||||
static final AtomicInteger nextIndex = new AtomicInteger();
|
||||
|
||||
/** Used by {@link FastThreadLocal} */
|
||||
@ -42,7 +42,6 @@ class UnpaddedInternalThreadLocalMap {
|
||||
int futureListenerStackDepth;
|
||||
int localChannelReaderStackDepth;
|
||||
Map<Class<?>, Boolean> handlerSharableCache;
|
||||
IntegerHolder counterHashCode;
|
||||
ThreadLocalRandom random;
|
||||
Map<Class<?>, TypeParameterMatcher> typeParameterMatcherGetCache;
|
||||
Map<Class<?>, Map<String, TypeParameterMatcher>> typeParameterMatcherFindCache;
|
||||
|
Loading…
Reference in New Issue
Block a user