From b4f8d03910681807da2c8a23c714d6567eea0e52 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Tue, 4 Apr 2017 08:28:04 +0200 Subject: [PATCH] WW-4769 Uses emptySet instead of manually creating Sets --- .../main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java index 74da77160..fe64d8f87 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java +++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java @@ -49,6 +49,7 @@ import java.util.regex.Pattern; public class OgnlUtil { private static final Logger LOG = LogManager.getLogger(OgnlUtil.class); + private ConcurrentMap expressions = new ConcurrentHashMap<>(); private final ConcurrentMap beanInfoCache = new ConcurrentHashMap<>(); private TypeConverter defaultConverter; @@ -57,9 +58,9 @@ public class OgnlUtil { private boolean enableExpressionCache = true; private boolean enableEvalExpression; - private Set> excludedClasses = new HashSet<>(); - private Set excludedPackageNamePatterns = new HashSet<>(); - private Set excludedPackageNames = new HashSet<>(); + private Set> excludedClasses = Collections.emptySet(); + private Set excludedPackageNamePatterns = Collections.emptySet(); + private Set excludedPackageNames = Collections.emptySet(); private Container container; private boolean allowStaticMethodAccess;