fix all ConstantName style error. Constant names are required to be written in uppercase letters and separated by underscores

pull/1224/head
DDDreame 2 years ago
parent 3e2aecf1aa
commit 773983df7f

@ -33,7 +33,7 @@ import java.util.List;
*/
public class ExtensionInvoker {
private static final ExtensionRegistry registry = ExtensionRegistry.getInstance();
private static final ExtensionRegistry REGISTRY = ExtensionRegistry.getInstance();
public static <T extends IExtension, E> List<E> reduceExecute(Class<T> targetClz,
ExtensionCallback<T, E> callback) {
@ -47,7 +47,7 @@ public class ExtensionInvoker {
Assert.isTrue(IExtension.class.isAssignableFrom(targetClz),
"can not execute extension point. please implement base extension interface(" + IExtension.class.getName() + ") first.");
List<IExtension> realizations = registry.find(targetClz);
List<IExtension> realizations = REGISTRY.find(targetClz);
if (CollectionUtil.isEmpty(realizations)) {
realizations = new ArrayList<>(ServiceLoaderRegistry.getSingletonServiceInstances(targetClz));
}

@ -31,7 +31,7 @@ import java.util.concurrent.ConcurrentHashMap;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ClassRegistry {
private static final Map<String, Class<?>> serverRegister = new ConcurrentHashMap<>();
private static final Map<String, Class<?>> SERVER_REGISTER = new ConcurrentHashMap<>();
/**
* get a Obj in Registry center <br>
@ -40,7 +40,7 @@ public class ClassRegistry {
* @return t element
*/
public static Class<?> get(String s) {
return serverRegister.get(s);
return SERVER_REGISTER.get(s);
}
/**
@ -53,7 +53,7 @@ public class ClassRegistry {
* @return final mapped value
*/
public static Class<?> set(String s, Class<?> cls) {
return serverRegister.putIfAbsent(s, cls);
return SERVER_REGISTER.putIfAbsent(s, cls);
}
/**
@ -64,13 +64,13 @@ public class ClassRegistry {
* @param cls element
*/
public static Class<?> put(String s, Class<?> cls) {
return serverRegister.put(s, cls);
return SERVER_REGISTER.put(s, cls);
}
/**
* clear
*/
public static void clear() {
serverRegister.clear();
SERVER_REGISTER.clear();
}
}

@ -60,7 +60,7 @@ public final class NettyClientSupport {
/**
* the cache for client
*/
private static final Map<InetSocketAddress, Client> clientMap = new ConcurrentHashMap<>();
private static final Map<InetSocketAddress, Client> CLIENT_MAP = new ConcurrentHashMap<>();
/**
* Obtain the client connected to the server through the server address. If the client does not exist, create one
@ -70,7 +70,7 @@ public final class NettyClientSupport {
* @return Client
*/
public static Client getClient(InetSocketAddress address, HandlerManager<ChannelHandler> handlerManager) {
return clientMap.computeIfAbsent(address, a -> {
return CLIENT_MAP.computeIfAbsent(address, a -> {
NettyClientPoolHandler handler = (handlerManager instanceof NettyClientPoolHandler)
? (NettyClientPoolHandler) handlerManager
: new NettyClientPoolHandler();
@ -98,7 +98,7 @@ public final class NettyClientSupport {
* @param address the address
*/
public static void closeClient(InetSocketAddress address) {
Client client = clientMap.remove(address);
Client client = CLIENT_MAP.remove(address);
Optional.ofNullable(client)
.ifPresent(c -> {
try {

@ -38,8 +38,8 @@ import java.util.concurrent.locks.LockSupport;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ResultHolder {
private static final Map<String, Object> map = new ConcurrentHashMap<>();
private static final Map<String, Thread> threadMap = new HashMap<>();
private static final Map<String, Object> MAP = new ConcurrentHashMap<>();
private static final Map<String, Thread> THREAD_MAP = new HashMap<>();
/**
* Writes when the client receives a response
@ -51,7 +51,7 @@ public class ResultHolder {
if (log.isDebugEnabled()) {
log.debug("Write the result, wake up the thread");
}
map.put(key, o);
MAP.put(key, o);
}
/**
@ -64,7 +64,7 @@ public class ResultHolder {
if (log.isDebugEnabled()) {
log.debug("Write thread, waiting to wake up");
}
threadMap.put(key, t);
THREAD_MAP.put(key, t);
}
/**
@ -76,7 +76,7 @@ public class ResultHolder {
if (log.isDebugEnabled()) {
log.debug("The future has been fetched, wake up the thread");
}
Thread thread = threadMap.remove(key);
Thread thread = THREAD_MAP.remove(key);
LockSupport.unpark(thread);
}
@ -93,7 +93,7 @@ public class ResultHolder {
if (log.isDebugEnabled()) {
log.debug("Get the future");
}
return (T) map.remove(key);
return (T) MAP.remove(key);
}
}

Loading…
Cancel
Save