Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WW-5188] Replaces since 2.6 with 6.0 #569

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<artifactId>struts2-osgi-admin-bundle</artifactId>
<packaging>bundle</packaging>
<name>DEPRECATED: Struts 2 OSGi Admin Bundle - since 2.6</name>
<name>DEPRECATED: Struts 2 OSGi Admin Bundle - since 6.0.0</name>

<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion bundles/demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<artifactId>struts2-osgi-demo-bundle</artifactId>
<packaging>bundle</packaging>
<name>DEPRECATED: Struts 2 OSGi Demo Bundle - since 2.6</name>
<name>DEPRECATED: Struts 2 OSGi Demo Bundle - since 6.0.0</name>

<dependencies>

Expand Down
2 changes: 1 addition & 1 deletion bundles/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<artifactId>struts2-osgi-bundles</artifactId>
<packaging>pom</packaging>
<name>DEPRECATED: Struts 2 OSGi Bundles - since 2.6</name>
<name>DEPRECATED: Struts 2 OSGi Bundles - since 6.0.0</name>

<modules>
<module>admin</module>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<name>Struts 2 Core</name>

<properties>
<tlib.version>2.6</tlib.version>
<tlib.version>6.0</tlib.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Adds support for invoke async actions. This allows us to support action methods that return {@link Callable}
* as well as invoking them in separate not-container thread then executing the result in another container thread.
*
* @since 2.6
* @since 6.0.0
*/
public interface AsyncManager {
boolean hasAsyncActionResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Used across different places to check if given string is not excluded and is accepted
* @see <a href="https://securitylab.github.com/research/apache-struts-double-evaluation/">here</a>
* @since 2.6
* @since 6.0.0
*/
public interface NotExcludedAcceptedPatternsChecker extends ExcludedPatternsChecker, AcceptedPatternsChecker {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void setDelegatedClassLoader(final ClassLoader classLoader) {
*
* @param bundleName The bundle to remove from the bundle map
*
* @deprecated A "no-op" since 2.6. Use {@link #clearBundle(java.lang.String, java.util.Locale)} instead.
* @deprecated A "no-op" since 6.0.0. Use {@link #clearBundle(java.lang.String, java.util.Locale)} instead.
*/
public void clearBundle(final String bundleName) {
LOG.debug("No-op. Did NOT clear resource bundle [{}], result: false.", bundleName);
Expand All @@ -248,7 +248,7 @@ public void clearBundle(final String bundleName) {
* @param bundleName The bundle (combined with locale) to remove from the bundle map
* @param locale Provides the locale to combine with the bundle to get the key
*
* @since 2.6
* @since 6.0.0
*/
protected void clearBundle(final String bundleName, Locale locale) {
final String key = createMissesKey(String.valueOf(getCurrentThreadContextClassLoader().hashCode()), bundleName, locale);
Expand All @@ -266,7 +266,7 @@ protected void clearBundle(final String bundleName, Locale locale) {
* {@link AbstractLocalizedTextProvider} has already been used for failed bundle
* lookups of a given key, or some transitory state made a bundle lookup fail.
*
* @since 2.6
* @since 6.0.0
*/
protected void clearMissingBundlesCache() {
missingBundles.clear();
Expand Down Expand Up @@ -313,7 +313,7 @@ protected void reloadBundles(Map<String, Object> context) {
* The <code>clearCache()</code> methods have been available since Java 1.6, so
* it is anticipated the logic will work on any subsequent JVM versions.
*
* @since 2.6
* @since 6.0.0
*/
private void clearResourceBundleClassloaderCaches() {
final ClassLoader ccl = getCurrentThreadContextClassLoader();
Expand Down Expand Up @@ -436,7 +436,7 @@ public void setDevMode(String devMode) {
*
* @param searchDefaultBundlesFirst provide {@link String} "true" or "false" to set the flag state accordingly.
*
* @since 2.6
* @since 6.0.0
*/
@Inject(value = StrutsConstants.STRUTS_I18N_SEARCH_DEFAULTBUNDLES_FIRST, required = false)
public void setSearchDefaultBundlesFirst(String searchDefaultBundlesFirst) {
Expand Down
26 changes: 13 additions & 13 deletions core/src/main/java/org/apache/struts2/StrutsConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class StrutsConstants {
* Note: This control flag may not be meaningful to all provider implementations, and should be false by default.
* </p>
*
* @since 2.6
* @since 6.0.0
*/
public static final String STRUTS_I18N_SEARCH_DEFAULTBUNDLES_FIRST = "struts.i18n.search.defaultbundles.first";

Expand Down Expand Up @@ -254,15 +254,15 @@ public final class StrutsConstants {
* Specifies an OGNL expression cache factory implementation. A default implementation is provided, but
* could be replaced by a custom one if desired.
*
* @since 2.6
* @since 6.0.0
*/
public static final String STRUTS_OGNL_EXPRESSION_CACHE_FACTORY = "struts.ognl.expressionCacheFactory";

/**
* Specifies an OGNL BeanInfo cache factory implementation. A default implementation is provided, but
* could be replaced by a custom one if desired.
*
* @since 2.6
* @since 6.0.0
*/
public static final String STRUTS_OGNL_BEANINFO_CACHE_FACTORY = "struts.ognl.beanInfoCacheFactory";

Expand All @@ -275,7 +275,7 @@ public final class StrutsConstants {
* For the optional LRU cache, once the maximum is reached, the least-recently-used (LRU) entry will be
* removed when a new entry needs to be added (cache is fully-utilized).
*
* @since 2.6
* @since 6.0.0
*/
public static final String STRUTS_OGNL_BEANINFO_CACHE_MAXSIZE = "struts.ognl.beanInfoCacheMaxSize";

Expand All @@ -287,32 +287,32 @@ public final class StrutsConstants {
* Note: When enabling LRU cache mode you must also set a maximum size (via {@link #STRUTS_OGNL_BEANINFO_CACHE_MAXSIZE})
* for it to be effective. Otherwise, there is no condition to evict a LRU entry (cache has no limit).
*
* @since 2.6
* @since 6.0.0
*/
public static final String STRUTS_OGNL_BEANINFO_CACHE_LRU_MODE = "struts.ognl.beanInfoCacheLRUMode";

/**
* Logs properties that are not found (very verbose)
* @since 2.6
* @since 6.0.0
*/
public static final String STRUTS_OGNL_LOG_MISSING_PROPERTIES = "struts.ognl.logMissingProperties";

/**
* Logs properties that are not found (very verbose)
* @deprecated as of 2.6. Use {@link #STRUTS_OGNL_LOG_MISSING_PROPERTIES} instead.
* @deprecated as of 6.0.0. Use {@link #STRUTS_OGNL_LOG_MISSING_PROPERTIES} instead.
*/
@Deprecated
public static final String STRUTS_LOG_MISSING_PROPERTIES = STRUTS_OGNL_LOG_MISSING_PROPERTIES;

/**
* Enables caching of parsed OGNL expressions
* @since 2.6
* @since 6.0.0
*/
public static final String STRUTS_OGNL_ENABLE_EXPRESSION_CACHE = "struts.ognl.enableExpressionCache";

/**
* Enables caching of parsed OGNL expressions
* @deprecated as of 2.6. Use {@link #STRUTS_OGNL_ENABLE_EXPRESSION_CACHE} instead.
* @deprecated as of 6.0.0. Use {@link #STRUTS_OGNL_ENABLE_EXPRESSION_CACHE} instead.
*/
public static final String STRUTS_ENABLE_OGNL_EXPRESSION_CACHE = STRUTS_OGNL_ENABLE_EXPRESSION_CACHE;

Expand All @@ -325,7 +325,7 @@ public final class StrutsConstants {
* For the optional LRU cache, once the maximum is reached, the least-recently-used (LRU) entry will be
* removed when a new entry needs to be added (cache is fully-utilized).
*
* @since 2.6
* @since 6.0.0
*/
public static final String STRUTS_OGNL_EXPRESSION_CACHE_MAXSIZE = "struts.ognl.expressionCacheMaxSize";

Expand All @@ -337,19 +337,19 @@ public final class StrutsConstants {
* Note: When enabling LRU cache mode you must also set a maximum size (via {@link #STRUTS_OGNL_EXPRESSION_CACHE_MAXSIZE})
* for it to be effective. Otherwise, there is no condition to evict a LRU entry (cache has no limit).
*
* @since 2.6
* @since 6.0.0
*/
public static final String STRUTS_OGNL_EXPRESSION_CACHE_LRU_MODE = "struts.ognl.expressionCacheLRUMode";

/**
* Enables evaluation of OGNL expressions
* @since 2.6
* @since 6.0.0
*/
public static final String STRUTS_OGNL_ENABLE_EVAL_EXPRESSION = "struts.ognl.enableEvalExpression";

/**
* Enables evaluation of OGNL expressions
* @deprecated as of 2.6. Use {@link #STRUTS_OGNL_ENABLE_EVAL_EXPRESSION} instead.
* @deprecated as of 6.0.0. Use {@link #STRUTS_OGNL_ENABLE_EVAL_EXPRESSION} instead.
*/
public static final String STRUTS_ENABLE_OGNL_EVAL_EXPRESSION = STRUTS_OGNL_ENABLE_EVAL_EXPRESSION;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
* Please note that the {@link CookieInterceptor} needs to be
* activated to receive a cookies map.
*
* @since 2.6
* @since 6.0.0
*/
public interface CookiesAware {
/**
* Sets a map of filtered cookies.
* @param cookies the cookies
*/
void withCookies(Map<String, String> cookies);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* One common use for this is to have the action propagate parameters to internally instantiated data
* objects.
*
* @since 2.6
* @since 6.0.0
*/
public interface ParametersAware {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* For components that have a dependence on the Servlet context.
*
* @since 2.6
* @since 6.0.0
*/
public interface ServletContextAware {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ public boolean usesBody() {
* Override to set if body content should be HTML-escaped.
*
* @return always true (default) for this component.
* @since 2.6
* @since 6.0.0
*/
public boolean escapeHtmlBody() {
return escapeHtmlBody;
Expand Down Expand Up @@ -600,7 +600,7 @@ public boolean getPerformClearTagStateForTagPoolingServers() {
*
* @param expression of the component
* @return true|false
* @since 2.6
* @since 6.0.0
*/
protected boolean isAcceptableExpression(String expression) {
NotExcludedAcceptedPatternsChecker.IsAllowed isAllowed = notExcludedAcceptedPatterns.isAllowed(expression);
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/apache/struts2/components/Date.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
* </p>
*
* <p>
* <b>Note</b>: Since Struts 2.6 a new Java 8 API has been used to format the Date, it's based on
* <b>Note</b>: Since Struts 6.0.0 a new Java 8 API has been used to format the Date, it's based on
* <a href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html">DateTimeFormatter</a>
* which uses a bit different patterns.
* </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ public StrutsXmlConfigurationProvider(String filename, @Deprecated boolean error
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN", "struts-2.1.7.dtd");
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.3//EN", "struts-2.3.dtd");
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.5//EN", "struts-2.5.dtd");
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.6//EN", "struts-2.6.dtd");
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 6.0//EN", "struts-6.0.dtd");
setDtdMappings(dtdMappings);
File file = new File(filename);
if (file.getParent() != null) {
this.baseDir = file.getParentFile();
}
}

/* (non-Javadoc)
* @see com.opensymphony.xwork2.config.providers.XmlConfigurationProvider#register(com.opensymphony.xwork2.inject.ContainerBuilder, java.util.Properties)
*/
Expand Down Expand Up @@ -175,7 +175,7 @@ public boolean needsReload() {
}

}

public String toString() {
return ("Struts XML configuration provider ("+filename+")");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ protected void doExecute(String finalLocation, ActionInvocation invocation) thro
*
* @param expression of result
* @return true|false
* @since 2.6
* @since 6.0.0
*/
protected boolean isAcceptableExpression(String expression) {
NotExcludedAcceptedPatternsChecker.IsAllowed isAllowed = notExcludedAcceptedPatterns.isAllowed(expression);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public void setForceAddSchemeHostAndPort(String forceAddSchemeHostAndPort) {
*
* @param escapeHtmlBody
*
* @since 2.6
* @since 6.0.0
*/
public void setEscapeHtmlBody(String escapeHtmlBody) {
this.escapeHtmlBody = escapeHtmlBody;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void setSrc(String src) {
*
* @param escapeHtmlBody
*
* @since 2.6
* @since 6.0.0
*/
public void setEscapeHtmlBody(boolean escapeHtmlBody) {
this.escapeHtmlBody = escapeHtmlBody;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
Use the following DOCTYPE
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.6//EN"
"http://struts.apache.org/dtds/struts-2.6.dtd">
"-//Apache Software Foundation//DTD Struts Configuration 6.0//EN"
"http://struts.apache.org/dtds/struts-6.0.dtd">
-->

<!ELEMENT struts ((package|include|bean|constant)*,bean-selection?, unknown-handler-stack?)>
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/struts-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
and {@link com.opensymphony.xwork2.inject.Inject}
-->
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.6//EN"
"http://struts.apache.org/dtds/struts-2.6.dtd">
"-//Apache Software Foundation//DTD Struts Configuration 6.0//EN"
"struts-6.0.dtd">

<struts>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public void testXW404() {
* Unit test to confirm expected behaviour of "clearing methods" provided to
* StrutsLocalizedTextProvider (from AbstractLocalizedTextProvider).
*
* @since 2.6
* @since 6.0.0
*/
public void testLocalizedTextProviderClearingMethods() {
TestStrutsLocalizedTextProvider testStrutsLocalizedTextProvider = new TestStrutsLocalizedTextProvider();
Expand Down Expand Up @@ -331,7 +331,7 @@ public void testLocalizedTextProviderClearingMethods() {
* Unit test to confirm the basic behaviour of bundle reload methods provided to
* StrutsLocalizedTextProvider (from AbstractLocalizedTextProvider).
*
* @since 2.6
* @since 6.0.0
*/
public void testLocalizedTextProviderReloadMethods() {
TestStrutsLocalizedTextProvider testStrutsLocalizedTextProvider = new TestStrutsLocalizedTextProvider();
Expand Down Expand Up @@ -582,7 +582,7 @@ protected void tearDown() throws Exception {
/**
* Basic test class to allow specific testing of StrutsLocalizedTextProvider.
*
* @since 2.6
* @since 6.0.0
*/
class TestStrutsLocalizedTextProvider extends StrutsLocalizedTextProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
*/
-->
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.6//EN"
"http://struts.apache.org/dtds/struts-2.6.dtd">
<struts />
"-//Apache Software Foundation//DTD Struts Configuration 6.0//EN"
"struts-6.0.dtd">
<struts/>
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
-->

<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.6//EN"
"http://struts.apache.org/dtds/struts-2.6.dtd">
"-//Apache Software Foundation//DTD Struts Configuration 6.0//EN"
"struts-6.0.dtd">

<struts>

<!-- CUSTOM ACTION MAPPER -->
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper"
name="WW3090" class="org.apache.struts2.views.jsp.URLTagTest$RedBlueActionMapper" />
<constant name="struts.mapper.class" value="WW3090" />
<!-- CUSTOM ACTION MAPPER -->
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper"
name="WW3090" class="org.apache.struts2.views.jsp.URLTagTest$RedBlueActionMapper"/>
<constant name="struts.mapper.class" value="WW3090"/>

</struts>
Loading