You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/04/14 11:30:08 UTC
[tomcat] 08/08: Code clean-up - no functional change
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 8e92da0ace64e2261e5582d68189e3d57d8e00b1
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Apr 14 12:25:59 2023 +0100
Code clean-up - no functional change
---
java/javax/el/BeanELResolver.java | 12 ++++++------
java/javax/el/ELContext.java | 10 +++++-----
java/javax/el/ELManager.java | 2 +-
java/javax/el/ExpressionFactory.java | 14 +++++++-------
java/javax/el/ImportHandler.java | 12 ++++++------
java/javax/el/LambdaExpression.java | 4 ++--
java/javax/el/MapELResolver.java | 18 +++++++++---------
java/javax/el/StandardELContext.java | 14 +++++++-------
java/javax/el/StaticFieldELResolver.java | 8 ++++----
java/javax/el/Util.java | 6 +++---
10 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/java/javax/el/BeanELResolver.java b/java/javax/el/BeanELResolver.java
index 10d428aa51..38f74081f6 100644
--- a/java/javax/el/BeanELResolver.java
+++ b/java/javax/el/BeanELResolver.java
@@ -53,7 +53,7 @@ public class BeanELResolver extends ELResolver {
private final boolean readOnly;
- private final ConcurrentCache<String, BeanProperties> cache = new ConcurrentCache<>(CACHE_SIZE);
+ private final ConcurrentCache<String,BeanProperties> cache = new ConcurrentCache<>(CACHE_SIZE);
/**
* Creates a writable instance of the standard JavaBean resolver.
@@ -144,8 +144,8 @@ public class BeanELResolver extends ELResolver {
// Find the matching method
Method matchingMethod = Util.findMethod(context, base.getClass(), base, methodName, paramTypes, params);
- Object[] parameters = Util.buildParameters(context, matchingMethod.getParameterTypes(),
- matchingMethod.isVarArgs(), params);
+ Object[] parameters =
+ Util.buildParameters(context, matchingMethod.getParameterTypes(), matchingMethod.isVarArgs(), params);
Object result = null;
try {
@@ -204,7 +204,7 @@ public class BeanELResolver extends ELResolver {
}
static final class BeanProperties {
- private final Map<String, BeanProperty> properties;
+ private final Map<String,BeanProperty> properties;
private final Class<?> type;
@@ -325,8 +325,8 @@ public class BeanELResolver extends ELResolver {
private static final class ConcurrentCache<K, V> {
private final int size;
- private final Map<K, V> eden;
- private final Map<K, V> longterm;
+ private final Map<K,V> eden;
+ private final Map<K,V> longterm;
ConcurrentCache(int size) {
this.size = size;
diff --git a/java/javax/el/ELContext.java b/java/javax/el/ELContext.java
index 5a1cbdbf9e..ac9d5fa2ea 100644
--- a/java/javax/el/ELContext.java
+++ b/java/javax/el/ELContext.java
@@ -30,7 +30,7 @@ public abstract class ELContext {
private Locale locale;
- private Map<Class<?>, Object> map;
+ private Map<Class<?>,Object> map;
private boolean resolved;
@@ -38,7 +38,7 @@ public abstract class ELContext {
private List<EvaluationListener> listeners;
- private Deque<Map<String, Object>> lambdaArguments = new ArrayDeque<>();
+ private Deque<Map<String,Object>> lambdaArguments = new ArrayDeque<>();
public ELContext() {
this.resolved = false;
@@ -235,7 +235,7 @@ public abstract class ELContext {
* @since EL 3.0
*/
public boolean isLambdaArgument(String name) {
- for (Map<String, Object> arguments : lambdaArguments) {
+ for (Map<String,Object> arguments : lambdaArguments) {
if (arguments.containsKey(name)) {
return true;
}
@@ -253,7 +253,7 @@ public abstract class ELContext {
* @since EL 3.0
*/
public Object getLambdaArgument(String name) {
- for (Map<String, Object> arguments : lambdaArguments) {
+ for (Map<String,Object> arguments : lambdaArguments) {
Object result = arguments.get(name);
if (result != null) {
return result;
@@ -270,7 +270,7 @@ public abstract class ELContext {
*
* @since EL 3.0
*/
- public void enterLambdaScope(Map<String, Object> arguments) {
+ public void enterLambdaScope(Map<String,Object> arguments) {
lambdaArguments.push(arguments);
}
diff --git a/java/javax/el/ELManager.java b/java/javax/el/ELManager.java
index 6b3cf7bc74..15677c72bf 100644
--- a/java/javax/el/ELManager.java
+++ b/java/javax/el/ELManager.java
@@ -73,7 +73,7 @@ public class ELManager {
}
public Object defineBean(String name, Object bean) {
- Map<String, Object> localBeans = getELContext().getLocalBeans();
+ Map<String,Object> localBeans = getELContext().getLocalBeans();
if (bean == null) {
return localBeans.remove(name);
diff --git a/java/javax/el/ExpressionFactory.java b/java/javax/el/ExpressionFactory.java
index 77007f875d..c8fb87b1e6 100644
--- a/java/javax/el/ExpressionFactory.java
+++ b/java/javax/el/ExpressionFactory.java
@@ -48,13 +48,13 @@ public abstract class ExpressionFactory {
private static final String PROPERTY_FILE;
private static final CacheValue nullTcclFactory = new CacheValue();
- private static final Map<CacheKey, CacheValue> factoryCache = new ConcurrentHashMap<>();
+ private static final Map<CacheKey,CacheValue> factoryCache = new ConcurrentHashMap<>();
static {
if (IS_SECURITY_ENABLED) {
- PROPERTY_FILE = AccessController
- .doPrivileged((PrivilegedAction<String>) () -> System.getProperty("java.home") + File.separator +
- "lib" + File.separator + "el.properties");
+ PROPERTY_FILE =
+ AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty("java.home") +
+ File.separator + "lib" + File.separator + "el.properties");
} else {
PROPERTY_FILE = System.getProperty("java.home") + File.separator + "lib" + File.separator + "el.properties";
}
@@ -226,7 +226,7 @@ public abstract class ExpressionFactory {
*
* @since EL 3.0
*/
- public Map<String, Method> getInitFunctionMap() {
+ public Map<String,Method> getInitFunctionMap() {
return null;
}
@@ -307,8 +307,8 @@ public abstract class ExpressionFactory {
className = getClassNameServices(tccl);
if (className == null) {
if (IS_SECURITY_ENABLED) {
- className = AccessController
- .doPrivileged((PrivilegedAction<String>) ExpressionFactory::getClassNameJreDir);
+ className =
+ AccessController.doPrivileged((PrivilegedAction<String>) ExpressionFactory::getClassNameJreDir);
} else {
// Second el.properties file
className = getClassNameJreDir();
diff --git a/java/javax/el/ImportHandler.java b/java/javax/el/ImportHandler.java
index a653a855c4..f200c6df32 100644
--- a/java/javax/el/ImportHandler.java
+++ b/java/javax/el/ImportHandler.java
@@ -31,7 +31,7 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class ImportHandler {
- private static final Map<String, Set<String>> standardPackages = new HashMap<>();
+ private static final Map<String,Set<String>> standardPackages = new HashMap<>();
static {
// Servlet 4.0
@@ -273,10 +273,10 @@ public class ImportHandler {
}
- private Map<String, Set<String>> packageNames = new ConcurrentHashMap<>();
- private Map<String, String> classNames = new ConcurrentHashMap<>();
- private Map<String, Class<?>> clazzes = new ConcurrentHashMap<>();
- private Map<String, Class<?>> statics = new ConcurrentHashMap<>();
+ private Map<String,Set<String>> packageNames = new ConcurrentHashMap<>();
+ private Map<String,String> classNames = new ConcurrentHashMap<>();
+ private Map<String,Class<?>> clazzes = new ConcurrentHashMap<>();
+ private Map<String,Class<?>> statics = new ConcurrentHashMap<>();
public ImportHandler() {
@@ -399,7 +399,7 @@ public class ImportHandler {
// Search the package imports - note there may be multiple matches
// (which correctly triggers an error)
- for (Map.Entry<String, Set<String>> entry : packageNames.entrySet()) {
+ for (Map.Entry<String,Set<String>> entry : packageNames.entrySet()) {
if (!entry.getValue().isEmpty()) {
// Standard package where we know all the class names
if (!entry.getValue().contains(name)) {
diff --git a/java/javax/el/LambdaExpression.java b/java/javax/el/LambdaExpression.java
index cd07fdc9d2..a87d73122b 100644
--- a/java/javax/el/LambdaExpression.java
+++ b/java/javax/el/LambdaExpression.java
@@ -25,7 +25,7 @@ public class LambdaExpression {
private final List<String> formalParameters;
private final ValueExpression expression;
- private final Map<String, Object> nestedArguments = new HashMap<>();
+ private final Map<String,Object> nestedArguments = new HashMap<>();
private ELContext context = null;
public LambdaExpression(List<String> formalParameters, ValueExpression expression) {
@@ -61,7 +61,7 @@ public class LambdaExpression {
// Build the argument map
// Start with the arguments from any outer expressions so if there is
// any overlap the local arguments have priority
- Map<String, Object> lambdaArguments = new HashMap<>(nestedArguments);
+ Map<String,Object> lambdaArguments = new HashMap<>(nestedArguments);
for (int i = 0; i < formalParamCount; i++) {
lambdaArguments.put(formalParameters.get(i), args[i]);
}
diff --git a/java/javax/el/MapELResolver.java b/java/javax/el/MapELResolver.java
index 67f8000c48..9c5e9adf6e 100644
--- a/java/javax/el/MapELResolver.java
+++ b/java/javax/el/MapELResolver.java
@@ -43,7 +43,7 @@ public class MapELResolver extends ELResolver {
public Class<?> getType(ELContext context, Object base, Object property) {
Objects.requireNonNull(context);
- if (base instanceof Map<?, ?>) {
+ if (base instanceof Map<?,?>) {
context.setPropertyResolved(base, property);
return Object.class;
}
@@ -55,9 +55,9 @@ public class MapELResolver extends ELResolver {
public Object getValue(ELContext context, Object base, Object property) {
Objects.requireNonNull(context);
- if (base instanceof Map<?, ?>) {
+ if (base instanceof Map<?,?>) {
context.setPropertyResolved(base, property);
- return ((Map<?, ?>) base).get(property);
+ return ((Map<?,?>) base).get(property);
}
return null;
@@ -67,7 +67,7 @@ public class MapELResolver extends ELResolver {
public void setValue(ELContext context, Object base, Object property, Object value) {
Objects.requireNonNull(context);
- if (base instanceof Map<?, ?>) {
+ if (base instanceof Map<?,?>) {
context.setPropertyResolved(base, property);
if (this.readOnly) {
@@ -77,7 +77,7 @@ public class MapELResolver extends ELResolver {
try {
@SuppressWarnings("unchecked") // Must be OK
- Map<Object, Object> map = ((Map<Object, Object>) base);
+ Map<Object,Object> map = ((Map<Object,Object>) base);
map.put(property, value);
} catch (UnsupportedOperationException e) {
throw new PropertyNotWritableException(e);
@@ -89,7 +89,7 @@ public class MapELResolver extends ELResolver {
public boolean isReadOnly(ELContext context, Object base, Object property) {
Objects.requireNonNull(context);
- if (base instanceof Map<?, ?>) {
+ if (base instanceof Map<?,?>) {
context.setPropertyResolved(base, property);
return this.readOnly || UNMODIFIABLE.equals(base.getClass());
}
@@ -99,8 +99,8 @@ public class MapELResolver extends ELResolver {
@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- if (base instanceof Map<?, ?>) {
- Iterator<?> itr = ((Map<?, ?>) base).keySet().iterator();
+ if (base instanceof Map<?,?>) {
+ Iterator<?> itr = ((Map<?,?>) base).keySet().iterator();
List<FeatureDescriptor> feats = new ArrayList<>();
Object key;
FeatureDescriptor desc;
@@ -124,7 +124,7 @@ public class MapELResolver extends ELResolver {
@Override
public Class<?> getCommonPropertyType(ELContext context, Object base) {
- if (base instanceof Map<?, ?>) {
+ if (base instanceof Map<?,?>) {
return Object.class;
}
return null;
diff --git a/java/javax/el/StandardELContext.java b/java/javax/el/StandardELContext.java
index 3185c5cd34..aa9180ec17 100644
--- a/java/javax/el/StandardELContext.java
+++ b/java/javax/el/StandardELContext.java
@@ -30,7 +30,7 @@ public class StandardELContext extends ELContext {
private final FunctionMapper functionMapper;
private final CompositeELResolver standardResolver;
private final CompositeELResolver customResolvers;
- private final Map<String, Object> localBeans = new HashMap<>();
+ private final Map<String,Object> localBeans = new HashMap<>();
public StandardELContext(ExpressionFactory factory) {
@@ -109,14 +109,14 @@ public class StandardELContext extends ELContext {
}
- Map<String, Object> getLocalBeans() {
+ Map<String,Object> getLocalBeans() {
return localBeans;
}
private static class StandardVariableMapper extends VariableMapper {
- private Map<String, ValueExpression> vars;
+ private Map<String,ValueExpression> vars;
@Override
public ValueExpression resolveVariable(String variable) {
@@ -142,9 +142,9 @@ public class StandardELContext extends ELContext {
private static class StandardBeanNameResolver extends BeanNameResolver {
- private final Map<String, Object> beans;
+ private final Map<String,Object> beans;
- StandardBeanNameResolver(Map<String, Object> beans) {
+ StandardBeanNameResolver(Map<String,Object> beans) {
this.beans = beans;
}
@@ -177,9 +177,9 @@ public class StandardELContext extends ELContext {
private static class StandardFunctionMapper extends FunctionMapper {
- private final Map<String, Method> methods = new HashMap<>();
+ private final Map<String,Method> methods = new HashMap<>();
- StandardFunctionMapper(Map<String, Method> initFunctionMap) {
+ StandardFunctionMapper(Map<String,Method> initFunctionMap) {
if (initFunctionMap != null) {
methods.putAll(initFunctionMap);
}
diff --git a/java/javax/el/StaticFieldELResolver.java b/java/javax/el/StaticFieldELResolver.java
index 41365a2414..d1e1b3ffa9 100644
--- a/java/javax/el/StaticFieldELResolver.java
+++ b/java/javax/el/StaticFieldELResolver.java
@@ -88,8 +88,8 @@ public class StaticFieldELResolver extends ELResolver {
if ("<init>".equals(methodName)) {
Constructor<?> match = Util.findConstructor(context, clazz, paramTypes, params);
- Object[] parameters = Util.buildParameters(context, match.getParameterTypes(), match.isVarArgs(),
- params);
+ Object[] parameters =
+ Util.buildParameters(context, match.getParameterTypes(), match.isVarArgs(), params);
Object result = null;
@@ -116,8 +116,8 @@ public class StaticFieldELResolver extends ELResolver {
Util.message(context, "staticFieldELResolver.methodNotFound", methodName, clazz.getName()));
}
- Object[] parameters = Util.buildParameters(context, match.getParameterTypes(), match.isVarArgs(),
- params);
+ Object[] parameters =
+ Util.buildParameters(context, match.getParameterTypes(), match.isVarArgs(), params);
Object result = null;
try {
diff --git a/java/javax/el/Util.java b/java/javax/el/Util.java
index 753521e000..e263f9d41d 100644
--- a/java/javax/el/Util.java
+++ b/java/javax/el/Util.java
@@ -102,7 +102,7 @@ class Util {
private static final CacheValue nullTcclFactory = new CacheValue();
- private static final Map<CacheKey, CacheValue> factoryCache = new ConcurrentHashMap<>();
+ private static final Map<CacheKey,CacheValue> factoryCache = new ConcurrentHashMap<>();
/**
* Provides a per class loader cache of ExpressionFactory instances without pinning any in memory as that could
@@ -241,7 +241,7 @@ class Util {
private static <T> Wrapper<T> findWrapper(ELContext context, Class<?> clazz, List<Wrapper<T>> wrappers, String name,
Class<?>[] paramTypes, Object[] paramValues) {
- Map<Wrapper<T>, MatchResult> candidates = new HashMap<>();
+ Map<Wrapper<T>,MatchResult> candidates = new HashMap<>();
int paramCount = paramTypes.length;
@@ -355,7 +355,7 @@ class Util {
MatchResult bestMatch = new MatchResult(true, 0, 0, 0, 0, true);
Wrapper<T> match = null;
boolean multiple = false;
- for (Map.Entry<Wrapper<T>, MatchResult> entry : candidates.entrySet()) {
+ for (Map.Entry<Wrapper<T>,MatchResult> entry : candidates.entrySet()) {
int cmp = entry.getValue().compareTo(bestMatch);
if (cmp > 0 || match == null) {
bestMatch = entry.getValue();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org