This is an automated email from the ASF dual-hosted git repository.

kusal pushed a commit to branch WW-5364-populate-allowlist
in repository https://gitbox.apache.org/repos/asf/struts.git

commit d030532d613ae694fcc03fae3a5577bedd039b27
Author: Kusal Kithul-Godage <g...@kusal.io>
AuthorDate: Sun Nov 26 22:03:34 2023 +1100

    WW-5343 Collect bootstrap factories
---
 .../xwork2/config/impl/DefaultConfiguration.java   | 101 ++++++------
 .../StrutsDefaultConfigurationProvider.java        | 169 +++++----------------
 2 files changed, 98 insertions(+), 172 deletions(-)

diff --git 
a/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
 
b/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
index bca7b515b..2d2a4a2b1 100644
--- 
a/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
+++ 
b/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
@@ -68,10 +68,12 @@ import com.opensymphony.xwork2.factory.DefaultActionFactory;
 import com.opensymphony.xwork2.factory.DefaultInterceptorFactory;
 import com.opensymphony.xwork2.factory.DefaultResultFactory;
 import com.opensymphony.xwork2.factory.DefaultUnknownHandlerFactory;
+import com.opensymphony.xwork2.factory.DefaultValidatorFactory;
 import com.opensymphony.xwork2.factory.InterceptorFactory;
 import com.opensymphony.xwork2.factory.ResultFactory;
 import com.opensymphony.xwork2.factory.StrutsConverterFactory;
 import com.opensymphony.xwork2.factory.UnknownHandlerFactory;
+import com.opensymphony.xwork2.factory.ValidatorFactory;
 import com.opensymphony.xwork2.inject.Container;
 import com.opensymphony.xwork2.inject.ContainerBuilder;
 import com.opensymphony.xwork2.inject.Context;
@@ -342,53 +344,13 @@ public class DefaultConfiguration implements 
Configuration {
                 fmFactoryRegistered = true;
             }
         }
-        builder.factory(ObjectFactory.class, Scope.SINGLETON);
-        builder.factory(ActionFactory.class, DefaultActionFactory.class, 
Scope.SINGLETON);
-        builder.factory(ResultFactory.class, DefaultResultFactory.class, 
Scope.SINGLETON);
-        builder.factory(InterceptorFactory.class, 
DefaultInterceptorFactory.class, Scope.SINGLETON);
-        
builder.factory(com.opensymphony.xwork2.factory.ValidatorFactory.class, 
com.opensymphony.xwork2.factory.DefaultValidatorFactory.class, Scope.SINGLETON);
-        builder.factory(ConverterFactory.class, StrutsConverterFactory.class, 
Scope.SINGLETON);
-        builder.factory(UnknownHandlerFactory.class, 
DefaultUnknownHandlerFactory.class, Scope.SINGLETON);
-
-        builder.factory(FileManager.class, "system", DefaultFileManager.class, 
Scope.SINGLETON);
+
+        bootstrapFactories(builder);
+        bootstrapTypeConverters(builder);
+
         if (!fmFactoryRegistered) {
             builder.factory(FileManagerFactory.class, 
DefaultFileManagerFactory.class, Scope.SINGLETON);
         }
-        builder.factory(ReflectionProvider.class, 
OgnlReflectionProvider.class, Scope.SINGLETON);
-        builder.factory(ValueStackFactory.class, OgnlValueStackFactory.class, 
Scope.SINGLETON);
-
-        builder.factory(XWorkConverter.class, Scope.SINGLETON);
-        builder.factory(ConversionPropertiesProcessor.class, 
StrutsConversionPropertiesProcessor.class, Scope.SINGLETON);
-        builder.factory(ConversionFileProcessor.class, 
DefaultConversionFileProcessor.class, Scope.SINGLETON);
-        builder.factory(ConversionAnnotationProcessor.class, 
DefaultConversionAnnotationProcessor.class, Scope.SINGLETON);
-        builder.factory(TypeConverterCreator.class, 
StrutsTypeConverterCreator.class, Scope.SINGLETON);
-        builder.factory(TypeConverterHolder.class, 
StrutsTypeConverterHolder.class, Scope.SINGLETON);
-
-        builder.factory(XWorkBasicConverter.class, Scope.SINGLETON);
-        builder.factory(TypeConverter.class, 
StrutsConstants.STRUTS_CONVERTER_COLLECTION,  CollectionConverter.class, 
Scope.SINGLETON);
-        builder.factory(TypeConverter.class, 
StrutsConstants.STRUTS_CONVERTER_ARRAY, ArrayConverter.class, Scope.SINGLETON);
-        builder.factory(TypeConverter.class, 
StrutsConstants.STRUTS_CONVERTER_DATE, DateConverter.class, Scope.SINGLETON);
-        builder.factory(TypeConverter.class, 
StrutsConstants.STRUTS_CONVERTER_NUMBER,  NumberConverter.class, 
Scope.SINGLETON);
-        builder.factory(TypeConverter.class, 
StrutsConstants.STRUTS_CONVERTER_STRING, StringConverter.class, 
Scope.SINGLETON);
-
-        builder.factory(TextProvider.class, "system", 
DefaultTextProvider.class, Scope.SINGLETON);
-
-        builder.factory(LocalizedTextProvider.class, 
StrutsLocalizedTextProvider.class, Scope.SINGLETON);
-        builder.factory(TextProviderFactory.class, 
StrutsTextProviderFactory.class, Scope.SINGLETON);
-        builder.factory(LocaleProviderFactory.class, 
DefaultLocaleProviderFactory.class, Scope.SINGLETON);
-
-        builder.factory(TextParser.class, OgnlTextParser.class, 
Scope.SINGLETON);
-
-        builder.factory(ObjectTypeDeterminer.class, 
DefaultObjectTypeDeterminer.class, Scope.SINGLETON);
-        builder.factory(PropertyAccessor.class, CompoundRoot.class.getName(), 
CompoundRootAccessor.class, Scope.SINGLETON);
-        builder.factory(ExpressionCacheFactory.class, 
DefaultOgnlExpressionCacheFactory.class, Scope.SINGLETON);
-        builder.factory(BeanInfoCacheFactory.class, 
DefaultOgnlBeanInfoCacheFactory.class, Scope.SINGLETON);
-        builder.factory(OgnlUtil.class, Scope.SINGLETON);
-        builder.factory(SecurityMemberAccess.class, Scope.PROTOTYPE);
-        builder.factory(OgnlGuard.class, StrutsOgnlGuard.class, 
Scope.SINGLETON);
-        builder.factory(ProviderAllowlist.class, Scope.SINGLETON);
-
-        builder.factory(ValueSubstitutor.class, EnvsValueSubstitutor.class, 
Scope.SINGLETON);
 
         for (Map.Entry<String, Object> entry : BOOTSTRAP_CONSTANTS.entrySet()) 
{
             builder.constant(entry.getKey(), String.valueOf(entry.getValue()));
@@ -397,6 +359,57 @@ public class DefaultConfiguration implements Configuration 
{
         return builder.create(true);
     }
 
+    public static ContainerBuilder bootstrapFactories(ContainerBuilder 
builder) {
+        return builder
+                // TODO: SpringObjectFactoryTest fails when these are SINGLETON
+                .factory(ObjectFactory.class, Scope.PROTOTYPE)
+                .factory(ActionFactory.class, DefaultActionFactory.class, 
Scope.PROTOTYPE)
+                .factory(ResultFactory.class, DefaultResultFactory.class, 
Scope.PROTOTYPE)
+                .factory(InterceptorFactory.class, 
DefaultInterceptorFactory.class, Scope.PROTOTYPE)
+                .factory(ValidatorFactory.class, 
DefaultValidatorFactory.class, Scope.PROTOTYPE)
+                .factory(ConverterFactory.class, StrutsConverterFactory.class, 
Scope.PROTOTYPE)
+                .factory(UnknownHandlerFactory.class, 
DefaultUnknownHandlerFactory.class, Scope.PROTOTYPE)
+
+                .factory(FileManager.class, "system", 
DefaultFileManager.class, Scope.SINGLETON)
+                .factory(ReflectionProvider.class, 
OgnlReflectionProvider.class, Scope.SINGLETON)
+                .factory(ValueStackFactory.class, OgnlValueStackFactory.class, 
Scope.SINGLETON)
+
+                .factory(XWorkConverter.class, Scope.SINGLETON)
+                .factory(XWorkBasicConverter.class, Scope.SINGLETON)
+                .factory(ConversionPropertiesProcessor.class, 
StrutsConversionPropertiesProcessor.class, Scope.SINGLETON)
+                .factory(ConversionFileProcessor.class, 
DefaultConversionFileProcessor.class, Scope.SINGLETON)
+                .factory(ConversionAnnotationProcessor.class, 
DefaultConversionAnnotationProcessor.class, Scope.SINGLETON)
+                .factory(TypeConverterCreator.class, 
StrutsTypeConverterCreator.class, Scope.SINGLETON)
+                .factory(TypeConverterHolder.class, 
StrutsTypeConverterHolder.class, Scope.SINGLETON)
+
+                .factory(TextProvider.class, "system", 
DefaultTextProvider.class, Scope.SINGLETON)
+                .factory(LocalizedTextProvider.class, 
StrutsLocalizedTextProvider.class, Scope.SINGLETON)
+                .factory(TextProviderFactory.class, 
StrutsTextProviderFactory.class, Scope.SINGLETON)
+                .factory(LocaleProviderFactory.class, 
DefaultLocaleProviderFactory.class, Scope.SINGLETON)
+                .factory(TextParser.class, OgnlTextParser.class, 
Scope.SINGLETON)
+
+                .factory(ObjectTypeDeterminer.class, 
DefaultObjectTypeDeterminer.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, CompoundRoot.class.getName(), 
CompoundRootAccessor.class, Scope.SINGLETON)
+
+                .factory(ExpressionCacheFactory.class, 
DefaultOgnlExpressionCacheFactory.class, Scope.SINGLETON)
+                .factory(BeanInfoCacheFactory.class, 
DefaultOgnlBeanInfoCacheFactory.class, Scope.SINGLETON)
+                .factory(OgnlUtil.class, Scope.SINGLETON)
+                .factory(SecurityMemberAccess.class, Scope.PROTOTYPE)
+                .factory(OgnlGuard.class, StrutsOgnlGuard.class, 
Scope.SINGLETON)
+                .factory(ProviderAllowlist.class, Scope.SINGLETON)
+
+                .factory(ValueSubstitutor.class, EnvsValueSubstitutor.class, 
Scope.SINGLETON);
+    }
+
+    public static ContainerBuilder bootstrapTypeConverters(ContainerBuilder 
builder) {
+        return builder
+                .factory(TypeConverter.class, 
StrutsConstants.STRUTS_CONVERTER_COLLECTION, CollectionConverter.class, 
Scope.SINGLETON)
+                .factory(TypeConverter.class, 
StrutsConstants.STRUTS_CONVERTER_ARRAY, ArrayConverter.class, Scope.SINGLETON)
+                .factory(TypeConverter.class, 
StrutsConstants.STRUTS_CONVERTER_DATE, DateConverter.class, Scope.SINGLETON)
+                .factory(TypeConverter.class, 
StrutsConstants.STRUTS_CONVERTER_NUMBER, NumberConverter.class, Scope.SINGLETON)
+                .factory(TypeConverter.class, 
StrutsConstants.STRUTS_CONVERTER_STRING, StringConverter.class, 
Scope.SINGLETON);
+    }
+
     /**
      * <p>
      * This builds the internal runtime configuration used by Xwork for 
finding and configuring Actions from the
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/config/providers/StrutsDefaultConfigurationProvider.java
 
b/core/src/main/java/com/opensymphony/xwork2/config/providers/StrutsDefaultConfigurationProvider.java
index a4960ee92..20f3abce8 100644
--- 
a/core/src/main/java/com/opensymphony/xwork2/config/providers/StrutsDefaultConfigurationProvider.java
+++ 
b/core/src/main/java/com/opensymphony/xwork2/config/providers/StrutsDefaultConfigurationProvider.java
@@ -20,62 +20,24 @@ package com.opensymphony.xwork2.config.providers;
 
 import com.opensymphony.xwork2.ActionProxyFactory;
 import com.opensymphony.xwork2.DefaultActionProxyFactory;
-import com.opensymphony.xwork2.DefaultLocaleProviderFactory;
-import com.opensymphony.xwork2.DefaultTextProvider;
 import com.opensymphony.xwork2.DefaultUnknownHandlerManager;
-import com.opensymphony.xwork2.FileManager;
 import com.opensymphony.xwork2.FileManagerFactory;
-import com.opensymphony.xwork2.LocaleProviderFactory;
-import com.opensymphony.xwork2.LocalizedTextProvider;
-import com.opensymphony.xwork2.ObjectFactory;
-import com.opensymphony.xwork2.StrutsTextProviderFactory;
-import com.opensymphony.xwork2.TextProvider;
-import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.UnknownHandlerManager;
 import com.opensymphony.xwork2.config.Configuration;
 import com.opensymphony.xwork2.config.ConfigurationException;
 import com.opensymphony.xwork2.config.ConfigurationProvider;
 import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
-import com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor;
-import com.opensymphony.xwork2.conversion.ConversionFileProcessor;
-import com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor;
 import com.opensymphony.xwork2.conversion.NullHandler;
-import com.opensymphony.xwork2.conversion.ObjectTypeDeterminer;
-import com.opensymphony.xwork2.conversion.TypeConverterCreator;
-import com.opensymphony.xwork2.conversion.TypeConverterHolder;
 import com.opensymphony.xwork2.conversion.impl.ArrayConverter;
 import com.opensymphony.xwork2.conversion.impl.CollectionConverter;
 import com.opensymphony.xwork2.conversion.impl.DateConverter;
-import 
com.opensymphony.xwork2.conversion.impl.DefaultConversionAnnotationProcessor;
-import com.opensymphony.xwork2.conversion.impl.DefaultConversionFileProcessor;
-import com.opensymphony.xwork2.conversion.impl.DefaultObjectTypeDeterminer;
 import com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler;
 import com.opensymphony.xwork2.conversion.impl.NumberConverter;
 import com.opensymphony.xwork2.conversion.impl.StringConverter;
-import com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter;
-import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
-import com.opensymphony.xwork2.factory.ActionFactory;
-import com.opensymphony.xwork2.factory.ConverterFactory;
-import com.opensymphony.xwork2.factory.DefaultActionFactory;
-import com.opensymphony.xwork2.factory.DefaultInterceptorFactory;
-import com.opensymphony.xwork2.factory.DefaultResultFactory;
-import com.opensymphony.xwork2.factory.DefaultUnknownHandlerFactory;
-import com.opensymphony.xwork2.factory.InterceptorFactory;
-import com.opensymphony.xwork2.factory.ResultFactory;
-import com.opensymphony.xwork2.factory.StrutsConverterFactory;
-import com.opensymphony.xwork2.factory.UnknownHandlerFactory;
 import com.opensymphony.xwork2.inject.ContainerBuilder;
 import com.opensymphony.xwork2.inject.Scope;
-import com.opensymphony.xwork2.ognl.BeanInfoCacheFactory;
-import com.opensymphony.xwork2.ognl.DefaultOgnlBeanInfoCacheFactory;
-import com.opensymphony.xwork2.ognl.DefaultOgnlExpressionCacheFactory;
-import com.opensymphony.xwork2.ognl.ExpressionCacheFactory;
 import com.opensymphony.xwork2.ognl.ObjectProxy;
 import com.opensymphony.xwork2.ognl.OgnlReflectionContextFactory;
-import com.opensymphony.xwork2.ognl.OgnlReflectionProvider;
-import com.opensymphony.xwork2.ognl.OgnlUtil;
-import com.opensymphony.xwork2.ognl.OgnlValueStackFactory;
-import com.opensymphony.xwork2.ognl.SecurityMemberAccess;
 import com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor;
 import com.opensymphony.xwork2.ognl.accessor.HttpParametersPropertyAccessor;
 import com.opensymphony.xwork2.ognl.accessor.ObjectAccessor;
@@ -94,17 +56,11 @@ import 
com.opensymphony.xwork2.security.DefaultNotExcludedAcceptedPatternsChecke
 import com.opensymphony.xwork2.security.ExcludedPatternsChecker;
 import com.opensymphony.xwork2.security.NotExcludedAcceptedPatternsChecker;
 import com.opensymphony.xwork2.util.CompoundRoot;
-import com.opensymphony.xwork2.util.OgnlTextParser;
 import com.opensymphony.xwork2.util.PatternMatcher;
-import com.opensymphony.xwork2.util.StrutsLocalizedTextProvider;
-import com.opensymphony.xwork2.util.TextParser;
-import com.opensymphony.xwork2.util.ValueStackFactory;
 import com.opensymphony.xwork2.util.WildcardHelper;
-import com.opensymphony.xwork2.util.fs.DefaultFileManager;
 import com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory;
 import com.opensymphony.xwork2.util.location.LocatableProperties;
 import com.opensymphony.xwork2.util.reflection.ReflectionContextFactory;
-import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
 import com.opensymphony.xwork2.validator.ActionValidatorManager;
 import com.opensymphony.xwork2.validator.AnnotationActionValidatorManager;
 import com.opensymphony.xwork2.validator.DefaultActionValidatorManager;
@@ -114,16 +70,10 @@ import com.opensymphony.xwork2.validator.ValidatorFactory;
 import com.opensymphony.xwork2.validator.ValidatorFileParser;
 import ognl.MethodAccessor;
 import ognl.PropertyAccessor;
-import org.apache.struts2.conversion.StrutsConversionPropertiesProcessor;
-import org.apache.struts2.conversion.StrutsTypeConverterCreator;
-import org.apache.struts2.conversion.StrutsTypeConverterHolder;
 import org.apache.struts2.dispatcher.HttpParameters;
 import org.apache.struts2.dispatcher.Parameter;
 import org.apache.struts2.interceptor.exec.ExecutorProvider;
 import org.apache.struts2.interceptor.exec.StrutsExecutorProvider;
-import org.apache.struts2.ognl.OgnlGuard;
-import org.apache.struts2.ognl.ProviderAllowlist;
-import org.apache.struts2.ognl.StrutsOgnlGuard;
 import org.apache.struts2.url.QueryStringBuilder;
 import org.apache.struts2.url.QueryStringParser;
 import org.apache.struts2.url.StrutsQueryStringBuilder;
@@ -163,97 +113,60 @@ public class StrutsDefaultConfigurationProvider 
implements ConfigurationProvider
     }
 
     @Override
-    public void register(ContainerBuilder builder, LocatableProperties props)
-        throws ConfigurationException {
+    public void register(ContainerBuilder builder, LocatableProperties props) 
throws ConfigurationException {
 
-        builder
-            .factory(ObjectFactory.class)
-            .factory(ActionFactory.class, DefaultActionFactory.class)
-            .factory(ResultFactory.class, DefaultResultFactory.class)
-            .factory(InterceptorFactory.class, DefaultInterceptorFactory.class)
-            .factory(com.opensymphony.xwork2.factory.ValidatorFactory.class, 
com.opensymphony.xwork2.factory.DefaultValidatorFactory.class)
-            .factory(ConverterFactory.class, StrutsConverterFactory.class)
-            .factory(UnknownHandlerFactory.class, 
DefaultUnknownHandlerFactory.class)
+        DefaultConfiguration.bootstrapFactories(builder)
+                .factory(FileManagerFactory.class, 
DefaultFileManagerFactory.class, Scope.SINGLETON)
 
-            .factory(ActionProxyFactory.class, 
DefaultActionProxyFactory.class, Scope.SINGLETON)
-            .factory(ObjectTypeDeterminer.class, 
DefaultObjectTypeDeterminer.class, Scope.SINGLETON)
+                .factory(ActionProxyFactory.class, 
DefaultActionProxyFactory.class, Scope.SINGLETON)
 
-            .factory(XWorkConverter.class, Scope.SINGLETON)
-            .factory(XWorkBasicConverter.class, Scope.SINGLETON)
-            .factory(ConversionPropertiesProcessor.class, 
StrutsConversionPropertiesProcessor.class, Scope.SINGLETON)
-            .factory(ConversionFileProcessor.class, 
DefaultConversionFileProcessor.class, Scope.SINGLETON)
-            .factory(ConversionAnnotationProcessor.class, 
DefaultConversionAnnotationProcessor.class, Scope.SINGLETON)
-            .factory(TypeConverterCreator.class, 
StrutsTypeConverterCreator.class, Scope.SINGLETON)
-            .factory(TypeConverterHolder.class, 
StrutsTypeConverterHolder.class, Scope.SINGLETON)
+                .factory(ValidatorFactory.class, 
DefaultValidatorFactory.class, Scope.SINGLETON)
+                .factory(ValidatorFileParser.class, 
DefaultValidatorFileParser.class, Scope.SINGLETON)
+                .factory(PatternMatcher.class, WildcardHelper.class, 
Scope.SINGLETON)
 
-            .factory(FileManager.class, "system", DefaultFileManager.class, 
Scope.SINGLETON)
-            .factory(FileManagerFactory.class, 
DefaultFileManagerFactory.class, Scope.SINGLETON)
-            .factory(ValueStackFactory.class, OgnlValueStackFactory.class, 
Scope.SINGLETON)
-            .factory(ValidatorFactory.class, DefaultValidatorFactory.class, 
Scope.SINGLETON)
-            .factory(ValidatorFileParser.class, 
DefaultValidatorFileParser.class, Scope.SINGLETON)
-            .factory(PatternMatcher.class, WildcardHelper.class, 
Scope.SINGLETON)
-            .factory(ReflectionProvider.class, OgnlReflectionProvider.class, 
Scope.SINGLETON)
-            .factory(ReflectionContextFactory.class, 
OgnlReflectionContextFactory.class, Scope.SINGLETON)
+                .factory(ReflectionContextFactory.class, 
OgnlReflectionContextFactory.class, Scope.SINGLETON)
 
-            .factory(PropertyAccessor.class, CompoundRoot.class.getName(), 
CompoundRootAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, Object.class.getName(), 
ObjectAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, Iterator.class.getName(), 
XWorkIteratorPropertyAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, Enumeration.class.getName(), 
XWorkEnumerationAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, Object.class.getName(), 
ObjectAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, Iterator.class.getName(), 
XWorkIteratorPropertyAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, Enumeration.class.getName(), 
XWorkEnumerationAccessor.class, Scope.SINGLETON)
 
-            .factory(UnknownHandlerManager.class, 
DefaultUnknownHandlerManager.class, Scope.SINGLETON)
+                .factory(UnknownHandlerManager.class, 
DefaultUnknownHandlerManager.class, Scope.SINGLETON)
 
-            // silly workarounds for ognl since there is no way to flush its 
caches
-            .factory(PropertyAccessor.class, List.class.getName(), 
XWorkListPropertyAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, ArrayList.class.getName(), 
XWorkListPropertyAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, HashSet.class.getName(), 
XWorkCollectionPropertyAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, Set.class.getName(), 
XWorkCollectionPropertyAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, HashMap.class.getName(), 
XWorkMapPropertyAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, Map.class.getName(), 
XWorkMapPropertyAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, Collection.class.getName(), 
XWorkCollectionPropertyAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, ObjectProxy.class.getName(), 
ObjectProxyPropertyAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, HttpParameters.class.getName(), 
HttpParametersPropertyAccessor.class, Scope.SINGLETON)
-            .factory(PropertyAccessor.class, Parameter.class.getName(), 
ParameterPropertyAccessor.class, Scope.SINGLETON)
+                // silly workarounds for ognl since there is no way to flush 
its caches
+                .factory(PropertyAccessor.class, List.class.getName(), 
XWorkListPropertyAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, ArrayList.class.getName(), 
XWorkListPropertyAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, HashSet.class.getName(), 
XWorkCollectionPropertyAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, Set.class.getName(), 
XWorkCollectionPropertyAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, HashMap.class.getName(), 
XWorkMapPropertyAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, Map.class.getName(), 
XWorkMapPropertyAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, Collection.class.getName(), 
XWorkCollectionPropertyAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, ObjectProxy.class.getName(), 
ObjectProxyPropertyAccessor.class, Scope.SINGLETON)
+                .factory(PropertyAccessor.class, 
HttpParameters.class.getName(), HttpParametersPropertyAccessor.class, 
Scope.SINGLETON)
+                .factory(PropertyAccessor.class, Parameter.class.getName(), 
ParameterPropertyAccessor.class, Scope.SINGLETON)
 
-            .factory(MethodAccessor.class, Object.class.getName(), 
XWorkMethodAccessor.class, Scope.SINGLETON)
-            .factory(MethodAccessor.class, CompoundRoot.class.getName(), 
CompoundRootAccessor.class, Scope.SINGLETON)
+                .factory(MethodAccessor.class, Object.class.getName(), 
XWorkMethodAccessor.class, Scope.SINGLETON)
+                .factory(MethodAccessor.class, CompoundRoot.class.getName(), 
CompoundRootAccessor.class, Scope.SINGLETON)
 
-            .factory(TextParser.class, OgnlTextParser.class, Scope.SINGLETON)
+                .factory(NullHandler.class, Object.class.getName(), 
InstantiatingNullHandler.class, Scope.SINGLETON)
+                .factory(ActionValidatorManager.class, 
AnnotationActionValidatorManager.class, Scope.SINGLETON)
+                .factory(ActionValidatorManager.class, "no-annotations", 
DefaultActionValidatorManager.class, Scope.SINGLETON)
 
-            .factory(NullHandler.class, Object.class.getName(), 
InstantiatingNullHandler.class, Scope.SINGLETON)
-            .factory(ActionValidatorManager.class, 
AnnotationActionValidatorManager.class, Scope.SINGLETON)
-            .factory(ActionValidatorManager.class, "no-annotations", 
DefaultActionValidatorManager.class, Scope.SINGLETON)
+                .factory(CollectionConverter.class, Scope.SINGLETON)
+                .factory(ArrayConverter.class, Scope.SINGLETON)
+                .factory(DateConverter.class, Scope.SINGLETON)
+                .factory(NumberConverter.class, Scope.SINGLETON)
+                .factory(StringConverter.class, Scope.SINGLETON)
 
-            .factory(TextProvider.class, "system", DefaultTextProvider.class, 
Scope.SINGLETON)
-            .factory(LocalizedTextProvider.class, 
StrutsLocalizedTextProvider.class, Scope.SINGLETON)
-            .factory(TextProviderFactory.class, 
StrutsTextProviderFactory.class, Scope.SINGLETON)
-            .factory(LocaleProviderFactory.class, 
DefaultLocaleProviderFactory.class, Scope.SINGLETON)
+                .factory(ExcludedPatternsChecker.class, 
DefaultExcludedPatternsChecker.class, Scope.PROTOTYPE)
+                .factory(AcceptedPatternsChecker.class, 
DefaultAcceptedPatternsChecker.class, Scope.PROTOTYPE)
+                .factory(NotExcludedAcceptedPatternsChecker.class, 
DefaultNotExcludedAcceptedPatternsChecker.class, Scope.SINGLETON)
 
-            .factory(ExpressionCacheFactory.class, 
DefaultOgnlExpressionCacheFactory.class, Scope.SINGLETON)
-            .factory(BeanInfoCacheFactory.class, 
DefaultOgnlBeanInfoCacheFactory.class, Scope.SINGLETON)
-            .factory(OgnlUtil.class, Scope.SINGLETON)
-            .factory(SecurityMemberAccess.class, Scope.PROTOTYPE)
-            .factory(OgnlGuard.class, StrutsOgnlGuard.class, Scope.SINGLETON)
-            .factory(ProviderAllowlist.class, Scope.SINGLETON)
-            .factory(CollectionConverter.class, Scope.SINGLETON)
-            .factory(ArrayConverter.class, Scope.SINGLETON)
-            .factory(DateConverter.class, Scope.SINGLETON)
-            .factory(NumberConverter.class, Scope.SINGLETON)
-            .factory(StringConverter.class, Scope.SINGLETON)
+                .factory(QueryStringBuilder.class, 
StrutsQueryStringBuilder.class, Scope.SINGLETON)
+                .factory(QueryStringParser.class, 
StrutsQueryStringParser.class, Scope.SINGLETON)
+                .factory(UrlEncoder.class, StrutsUrlEncoder.class, 
Scope.SINGLETON)
+                .factory(UrlDecoder.class, StrutsUrlDecoder.class, 
Scope.SINGLETON)
 
-            .factory(ExcludedPatternsChecker.class, 
DefaultExcludedPatternsChecker.class, Scope.PROTOTYPE)
-            .factory(AcceptedPatternsChecker.class, 
DefaultAcceptedPatternsChecker.class, Scope.PROTOTYPE)
-            .factory(NotExcludedAcceptedPatternsChecker.class, 
DefaultNotExcludedAcceptedPatternsChecker.class
-                , Scope.SINGLETON)
-
-            .factory(ValueSubstitutor.class, EnvsValueSubstitutor.class, 
Scope.SINGLETON)
-
-            .factory(QueryStringBuilder.class, StrutsQueryStringBuilder.class, 
Scope.SINGLETON)
-            .factory(QueryStringParser.class, StrutsQueryStringParser.class, 
Scope.SINGLETON)
-            .factory(UrlEncoder.class, StrutsUrlEncoder.class, Scope.SINGLETON)
-            .factory(UrlDecoder.class, StrutsUrlDecoder.class, Scope.SINGLETON)
-
-            .factory(ExecutorProvider.class, StrutsExecutorProvider.class, 
Scope.SINGLETON)
-        ;
+                .factory(ExecutorProvider.class, StrutsExecutorProvider.class, 
Scope.SINGLETON);
 
         for (Map.Entry<String, Object> entry : 
DefaultConfiguration.BOOTSTRAP_CONSTANTS.entrySet()) {
             props.setProperty(entry.getKey(), 
String.valueOf(entry.getValue()));

Reply via email to