struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject struts git commit: WW-4443 Renames scope DEFAULT into PROTOTYPE
Date Thu, 18 Jun 2015 09:53:45 GMT
Repository: struts
Updated Branches:
  refs/heads/master e2347f165 -> 356b5c57b


WW-4443 Renames scope DEFAULT into PROTOTYPE


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/356b5c57
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/356b5c57
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/356b5c57

Branch: refs/heads/master
Commit: 356b5c57b269e6ba7cfe267d4517e5f7a27ce200
Parents: e2347f1
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Thu Jun 18 11:53:34 2015 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Thu Jun 18 11:53:34 2015 +0200

----------------------------------------------------------------------
 .../config/providers/XWorkConfigurationProvider.java  |  4 ++--
 .../config/providers/XmlConfigurationProvider.java    |  4 ++--
 .../opensymphony/xwork2/inject/ContainerBuilder.java  | 14 +++++++-------
 .../java/com/opensymphony/xwork2/inject/Scope.java    |  2 +-
 .../struts2/config/DefaultBeanSelectionProvider.java  | 10 +++++-----
 core/src/main/resources/struts-default.xml            | 10 +++++-----
 6 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/356b5c57/core/src/main/java/com/opensymphony/xwork2/config/providers/XWorkConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/config/providers/XWorkConfigurationProvider.java
b/core/src/main/java/com/opensymphony/xwork2/config/providers/XWorkConfigurationProvider.java
index 4ade520..89e8f97 100644
--- a/core/src/main/java/com/opensymphony/xwork2/config/providers/XWorkConfigurationProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/config/providers/XWorkConfigurationProvider.java
@@ -177,8 +177,8 @@ public class XWorkConfigurationProvider implements ConfigurationProvider
{
                 .factory(NumberConverter.class, Scope.SINGLETON)
                 .factory(StringConverter.class, Scope.SINGLETON)
 
-                .factory(ExcludedPatternsChecker.class, DefaultExcludedPatternsChecker.class,
Scope.DEFAULT)
-                .factory(AcceptedPatternsChecker.class, DefaultAcceptedPatternsChecker.class,
Scope.DEFAULT)
+                .factory(ExcludedPatternsChecker.class, DefaultExcludedPatternsChecker.class,
Scope.PROTOTYPE)
+                .factory(AcceptedPatternsChecker.class, DefaultAcceptedPatternsChecker.class,
Scope.PROTOTYPE)
         ;
 
         props.setProperty(XWorkConstants.DEV_MODE, Boolean.FALSE.toString());

http://git-wip-us.apache.org/repos/asf/struts/blob/356b5c57/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
b/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
index 0cf7059..d3d524c 100644
--- a/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
@@ -193,8 +193,8 @@ public class XmlConfigurationProvider implements ConfigurationProvider
{
                         String scopeStr = child.getAttribute("scope");
                         boolean optional = "true".equals(child.getAttribute("optional"));
                         Scope scope = Scope.SINGLETON;
-                        if ("default".equals(scopeStr)) {
-                            scope = Scope.DEFAULT;
+                        if ("prototype".equals(scopeStr)) {
+                            scope = Scope.PROTOTYPE;
                         } else if ("request".equals(scopeStr)) {
                             scope = Scope.REQUEST;
                         } else if ("session".equals(scopeStr)) {

http://git-wip-us.apache.org/repos/asf/struts/blob/356b5c57/core/src/main/java/com/opensymphony/xwork2/inject/ContainerBuilder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/inject/ContainerBuilder.java b/core/src/main/java/com/opensymphony/xwork2/inject/ContainerBuilder.java
index 54f5be6..c37f6c7 100644
--- a/core/src/main/java/com/opensymphony/xwork2/inject/ContainerBuilder.java
+++ b/core/src/main/java/com/opensymphony/xwork2/inject/ContainerBuilder.java
@@ -150,22 +150,22 @@ public final class ContainerBuilder {
 
     /**
      * Convenience method.&nbsp;Equivalent to {@code factory(type, name, factory,
-     * Scope.DEFAULT)}.
+     * Scope.PROTOTYPE)}.
      *
      * @see #factory(Class, String, Factory, Scope)
      */
     public <T> ContainerBuilder factory(Class<T> type, String name, Factory<?
extends T> factory) {
-        return factory(type, name, factory, Scope.DEFAULT);
+        return factory(type, name, factory, Scope.PROTOTYPE);
     }
 
     /**
      * Convenience method.&nbsp;Equivalent to {@code factory(type,
-     * Container.DEFAULT_NAME, factory, Scope.DEFAULT)}.
+     * Container.DEFAULT_NAME, factory, Scope.PROTOTYPE)}.
      *
      * @see #factory(Class, String, Factory, Scope)
      */
     public <T> ContainerBuilder factory(Class<T> type, Factory<? extends T>
factory) {
-        return factory(type, Container.DEFAULT_NAME, factory, Scope.DEFAULT);
+        return factory(type, Container.DEFAULT_NAME, factory, Scope.PROTOTYPE);
     }
 
     /**
@@ -215,7 +215,7 @@ public final class ContainerBuilder {
      * instances using the container, recursively injecting dependencies.
      * <p/>
      * <p>Sets scope to value from {@link Scoped} annotation on the
-     * implementation class. Defaults to {@link Scope#DEFAULT} if no annotation
+     * implementation class. Defaults to {@link Scope#PROTOTYPE} if no annotation
      * is found.
      *
      * @param type           of dependency
@@ -226,7 +226,7 @@ public final class ContainerBuilder {
     public <T> ContainerBuilder factory(final Class<T> type, String name,
                                         final Class<? extends T> implementation) {
         Scoped scoped = implementation.getAnnotation(Scoped.class);
-        Scope scope = scoped == null ? Scope.DEFAULT : scoped.value();
+        Scope scope = scoped == null ? Scope.PROTOTYPE : scoped.value();
         return factory(type, name, implementation, scope);
     }
 
@@ -419,7 +419,7 @@ public final class ContainerBuilder {
             }
         };
 
-        return factory(Key.newInstance(type, name), factory, Scope.DEFAULT);
+        return factory(Key.newInstance(type, name), factory, Scope.PROTOTYPE);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/struts/blob/356b5c57/core/src/main/java/com/opensymphony/xwork2/inject/Scope.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/inject/Scope.java b/core/src/main/java/com/opensymphony/xwork2/inject/Scope.java
index 62443f7..08d7c49 100644
--- a/core/src/main/java/com/opensymphony/xwork2/inject/Scope.java
+++ b/core/src/main/java/com/opensymphony/xwork2/inject/Scope.java
@@ -28,7 +28,7 @@ public enum Scope {
     /**
      * One instance per injection.
      */
-    DEFAULT {
+    PROTOTYPE {
         @Override
         <T> InternalFactory<? extends T> scopeFactory(Class<T> type, String
name,
                                                       InternalFactory<? extends T>
factory) {

http://git-wip-us.apache.org/repos/asf/struts/blob/356b5c57/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
b/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
index 1f66d16..15cb16d 100644
--- a/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
+++ b/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
@@ -383,13 +383,13 @@ public class DefaultBeanSelectionProvider extends AbstractBeanSelectionProvider
         alias(TypeConverterCreator.class, StrutsConstants.STRUTS_CONVERTER_CREATOR, builder,
props);
         alias(TypeConverterHolder.class, StrutsConstants.STRUTS_CONVERTER_HOLDER, builder,
props);
 
-        alias(TextProvider.class, StrutsConstants.STRUTS_XWORKTEXTPROVIDER, builder, props,
Scope.DEFAULT);
+        alias(TextProvider.class, StrutsConstants.STRUTS_XWORKTEXTPROVIDER, builder, props,
Scope.PROTOTYPE);
 
         alias(LocaleProvider.class, StrutsConstants.STRUTS_LOCALE_PROVIDER, builder, props);
         alias(ActionProxyFactory.class, StrutsConstants.STRUTS_ACTIONPROXYFACTORY, builder,
props);
         alias(ObjectTypeDeterminer.class, StrutsConstants.STRUTS_OBJECTTYPEDETERMINER, builder,
props);
         alias(ActionMapper.class, StrutsConstants.STRUTS_MAPPER_CLASS, builder, props);
-        alias(MultiPartRequest.class, StrutsConstants.STRUTS_MULTIPART_PARSER, builder, props,
Scope.DEFAULT);
+        alias(MultiPartRequest.class, StrutsConstants.STRUTS_MULTIPART_PARSER, builder, props,
Scope.PROTOTYPE);
         alias(FreemarkerManager.class, StrutsConstants.STRUTS_FREEMARKER_MANAGER_CLASSNAME,
builder, props);
         alias(VelocityManager.class, StrutsConstants.STRUTS_VELOCITY_MANAGER_CLASSNAME, builder,
props);
         alias(UrlRenderer.class, StrutsConstants.STRUTS_URL_RENDERER, builder, props);
@@ -407,9 +407,9 @@ public class DefaultBeanSelectionProvider extends AbstractBeanSelectionProvider
 
         alias(DispatcherErrorHandler.class, StrutsConstants.STRUTS_DISPATCHER_ERROR_HANDLER,
builder, props);
 
-        /** Checker is used mostly in interceptors, so there be one instance of checker per
interceptor with Scope.DEFAULT **/
-        alias(ExcludedPatternsChecker.class, StrutsConstants.STRUTS_EXCLUDED_PATTERNS_CHECKER,
builder, props, Scope.DEFAULT);
-        alias(AcceptedPatternsChecker.class, StrutsConstants.STRUTS_ACCEPTED_PATTERNS_CHECKER,
builder, props, Scope.DEFAULT);
+        /** Checker is used mostly in interceptors, so there be one instance of checker per
interceptor with Scope.PROTOTYPE **/
+        alias(ExcludedPatternsChecker.class, StrutsConstants.STRUTS_EXCLUDED_PATTERNS_CHECKER,
builder, props, Scope.PROTOTYPE);
+        alias(AcceptedPatternsChecker.class, StrutsConstants.STRUTS_ACCEPTED_PATTERNS_CHECKER,
builder, props, Scope.PROTOTYPE);
 
         switchDevMode(props);
 

http://git-wip-us.apache.org/repos/asf/struts/blob/356b5c57/core/src/main/resources/struts-default.xml
----------------------------------------------------------------------
diff --git a/core/src/main/resources/struts-default.xml b/core/src/main/resources/struts-default.xml
index f9c9ff4..5b82fe0 100644
--- a/core/src/main/resources/struts-default.xml
+++ b/core/src/main/resources/struts-default.xml
@@ -81,8 +81,8 @@
     <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful" class="org.apache.struts2.dispatcher.mapper.RestfulActionMapper"
/>
     <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful2" class="org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"
/>
 
-    <bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta"
class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default"/>
-    <bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta-stream"
class="org.apache.struts2.dispatcher.multipart.JakartaStreamMultiPartRequest" scope="default"/>
+    <bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta"
class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="prototype"/>
+    <bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta-stream"
class="org.apache.struts2.dispatcher.multipart.JakartaStreamMultiPartRequest" scope="prototype"/>
 
     <bean type="org.apache.struts2.views.TagLibraryDirectiveProvider" name="s" class="org.apache.struts2.views.DefaultTagLibrary"
/>
     <bean type="org.apache.struts2.views.TagLibraryModelProvider" name="s" class="org.apache.struts2.views.DefaultTagLibrary"
/>
@@ -112,7 +112,7 @@
     <bean type="com.opensymphony.xwork2.conversion.impl.NumberConverter" name="struts"
class="com.opensymphony.xwork2.conversion.impl.NumberConverter" scope="singleton"/>
     <bean type="com.opensymphony.xwork2.conversion.impl.StringConverter" name="struts"
class="com.opensymphony.xwork2.conversion.impl.StringConverter" scope="singleton"/>
 
-    <bean type="com.opensymphony.xwork2.TextProvider" name="struts" class="com.opensymphony.xwork2.TextProviderSupport"
scope="default" />
+    <bean type="com.opensymphony.xwork2.TextProvider" name="struts" class="com.opensymphony.xwork2.TextProviderSupport"
scope="prototype" />
     <bean type="com.opensymphony.xwork2.LocaleProvider" name="struts" class="com.opensymphony.xwork2.DefaultLocaleProvider"
scope="singleton" />
 
     <bean type="org.apache.struts2.components.UrlRenderer" name="struts" class="org.apache.struts2.components.ServletUrlRenderer"/>
@@ -162,8 +162,8 @@
     <bean type="ognl.PropertyAccessor" name="java.util.HashSet" class="com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor"
/>
     <bean type="ognl.PropertyAccessor" name="java.util.HashMap" class="com.opensymphony.xwork2.ognl.accessor.XWorkMapPropertyAccessor"
/>
 
-    <bean type="com.opensymphony.xwork2.security.ExcludedPatternsChecker" name="struts"
class="com.opensymphony.xwork2.security.DefaultExcludedPatternsChecker" scope="default" />
-    <bean type="com.opensymphony.xwork2.security.AcceptedPatternsChecker" name="struts"
class="com.opensymphony.xwork2.security.DefaultAcceptedPatternsChecker" scope="default" />
+    <bean type="com.opensymphony.xwork2.security.ExcludedPatternsChecker" name="struts"
class="com.opensymphony.xwork2.security.DefaultExcludedPatternsChecker" scope="prototype"
/>
+    <bean type="com.opensymphony.xwork2.security.AcceptedPatternsChecker" name="struts"
class="com.opensymphony.xwork2.security.DefaultAcceptedPatternsChecker" scope="prototype"
/>
 
     <package name="struts-default" abstract="true">
         <result-types>


Mime
View raw message