Skip to content

Commit 70b5d7c

Browse files
authored
Merge pull request #981 from apache/WW-5411-delete-deprecated-1
WW-5411 Delete deprecated method/classes
2 parents b65005c + a3cc042 commit 70b5d7c

39 files changed

+149
-993
lines changed

core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ public XmlConfigurationProvider(String filename) {
8282
this.configFileName = filename;
8383
}
8484

85-
/**
86-
* @deprecated since 6.2.0, use {@link #XmlConfigurationProvider(String)}
87-
*/
88-
@Deprecated
89-
public XmlConfigurationProvider(String filename, @Deprecated boolean notUsed) {
90-
this(filename);
91-
}
92-
9385
@Override
9486
public void init(Configuration configuration) {
9587
super.init(configuration);

core/src/main/java/com/opensymphony/xwork2/config/providers/XmlDocConfigurationProvider.java

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ protected void addAction(Element actionElement, PackageConfig.Builder packageCon
465465
Location location = DomHelper.getLocationObject(actionElement);
466466

467467
if (!className.isEmpty()) {
468-
verifyAction(className, name, location);
468+
verifyAction(className, location);
469469
}
470470

471471
Map<String, ResultConfig> results;
@@ -496,7 +496,7 @@ protected ActionConfig buildActionConfig(Element actionElement,
496496
String methodName = trimToNull(actionElement.getAttribute("method"));
497497

498498
List<InterceptorMapping> interceptorList = buildInterceptorList(actionElement, packageContext);
499-
List<ExceptionMappingConfig> exceptionMappings = buildExceptionMappings(actionElement, packageContext);
499+
List<ExceptionMappingConfig> exceptionMappings = buildExceptionMappings(actionElement);
500500
Set<String> allowedMethods = buildAllowedMethods(actionElement, packageContext);
501501

502502
return new ActionConfig.Builder(packageContext.getName(), actionName, className)
@@ -511,15 +511,6 @@ protected ActionConfig buildActionConfig(Element actionElement,
511511
.build();
512512
}
513513

514-
/**
515-
* @deprecated since 6.2.0, use {@link #verifyAction(String, Location)}
516-
*/
517-
@Deprecated
518-
protected boolean verifyAction(String className, String name, Location loc) {
519-
verifyAction(className, loc);
520-
return true;
521-
}
522-
523514
protected void verifyAction(String className, Location loc) {
524515
if (className.contains("{")) {
525516
LOG.debug("Action class [{}] contains a wildcard replacement value, so it can't be verified", className);
@@ -785,14 +776,6 @@ protected static String guessResultType(String type) {
785776
return sb.toString();
786777
}
787778

788-
/**
789-
* @deprecated since 6.2.0, use {@link #buildExceptionMappings(Element)}
790-
*/
791-
@Deprecated
792-
protected List<ExceptionMappingConfig> buildExceptionMappings(Element element, PackageConfig.Builder packageContext) {
793-
return buildExceptionMappings(element);
794-
}
795-
796779
/**
797780
* Build a list of exception mapping objects from below a given XML element.
798781
*
@@ -930,7 +913,7 @@ protected void loadGlobalExceptionMappings(PackageConfig.Builder packageContext,
930913

931914
if (globalExceptionMappingList.getLength() > 0) {
932915
Element globalExceptionMappingElement = (Element) globalExceptionMappingList.item(0);
933-
List<ExceptionMappingConfig> exceptionMappings = buildExceptionMappings(globalExceptionMappingElement, packageContext);
916+
List<ExceptionMappingConfig> exceptionMappings = buildExceptionMappings(globalExceptionMappingElement);
934917
packageContext.addGlobalExceptionMappingConfigs(exceptionMappings);
935918
}
936919
}

core/src/main/java/com/opensymphony/xwork2/ognl/DefaultOgnlBeanInfoCacheFactory.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030
public class DefaultOgnlBeanInfoCacheFactory<Key, Value> extends DefaultOgnlCacheFactory<Key, Value>
3131
implements BeanInfoCacheFactory<Key, Value> {
3232

33-
/**
34-
* @deprecated since 6.4.0, use {@link #DefaultOgnlBeanInfoCacheFactory(String, String)}
35-
*/
36-
@Deprecated
37-
public DefaultOgnlBeanInfoCacheFactory() {
38-
}
39-
4033
@Inject
4134
public DefaultOgnlBeanInfoCacheFactory(@Inject(value = StrutsConstants.STRUTS_OGNL_BEANINFO_CACHE_MAXSIZE) String cacheMaxSize,
4235
@Inject(value = StrutsConstants.STRUTS_OGNL_BEANINFO_CACHE_TYPE) String defaultCacheType) {

core/src/main/java/com/opensymphony/xwork2/ognl/DefaultOgnlCacheFactory.java

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package com.opensymphony.xwork2.ognl;
1717

18-
import org.apache.commons.lang3.BooleanUtils;
19-
2018
/**
2119
* <p>Default OGNL Cache factory implementation.</p>
2220
*
@@ -30,18 +28,10 @@ public class DefaultOgnlCacheFactory<Key, Value> implements OgnlCacheFactory<Key
3028
private static final int DEFAULT_INIT_CAPACITY = 16;
3129
private static final float DEFAULT_LOAD_FACTOR = 0.75f;
3230

33-
private CacheType defaultCacheType;
34-
private int cacheMaxSize;
31+
private final CacheType defaultCacheType;
32+
private final int cacheMaxSize;
3533
private final int initialCapacity;
3634

37-
/**
38-
* @deprecated since 6.4.0, use {@link #DefaultOgnlCacheFactory(int, CacheType)}
39-
*/
40-
@Deprecated
41-
public DefaultOgnlCacheFactory() {
42-
this(10000, CacheType.BASIC);
43-
}
44-
4535
public DefaultOgnlCacheFactory(int cacheMaxSize, CacheType defaultCacheType) {
4636
this(cacheMaxSize, defaultCacheType, DEFAULT_INIT_CAPACITY);
4737
}
@@ -62,45 +52,20 @@ public OgnlCache<Key, Value> buildOgnlCache(int evictionLimit,
6252
int initialCapacity,
6353
float loadFactor,
6454
CacheType cacheType) {
65-
switch (cacheType) {
66-
case BASIC:
67-
return new OgnlDefaultCache<>(evictionLimit, initialCapacity, loadFactor);
68-
case LRU:
69-
return new OgnlLRUCache<>(evictionLimit, initialCapacity, loadFactor);
70-
case WTLFU:
71-
return new OgnlCaffeineCache<>(evictionLimit, initialCapacity);
72-
default:
73-
throw new IllegalArgumentException("Unknown cache type: " + cacheType);
74-
}
55+
return switch (cacheType) {
56+
case BASIC -> new OgnlDefaultCache<>(evictionLimit, initialCapacity, loadFactor);
57+
case LRU -> new OgnlLRUCache<>(evictionLimit, initialCapacity, loadFactor);
58+
case WTLFU -> new OgnlCaffeineCache<>(evictionLimit, initialCapacity);
59+
};
7560
}
7661

7762
@Override
7863
public int getCacheMaxSize() {
7964
return cacheMaxSize;
8065
}
8166

82-
/**
83-
* @deprecated since 6.4.0
84-
*/
85-
@Deprecated
86-
protected void setCacheMaxSize(String maxSize) {
87-
cacheMaxSize = Integer.parseInt(maxSize);
88-
}
89-
9067
@Override
9168
public CacheType getDefaultCacheType() {
9269
return defaultCacheType;
9370
}
94-
95-
/**
96-
* No effect when {@code useLRUMode} is {@code false}
97-
*
98-
* @deprecated since 6.4.0
99-
*/
100-
@Deprecated
101-
protected void setUseLRUCache(String useLRUMode) {
102-
if (BooleanUtils.toBoolean(useLRUMode)) {
103-
defaultCacheType = CacheType.LRU;
104-
}
105-
}
10671
}

core/src/main/java/com/opensymphony/xwork2/ognl/DefaultOgnlExpressionCacheFactory.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030
public class DefaultOgnlExpressionCacheFactory<Key, Value> extends DefaultOgnlCacheFactory<Key, Value>
3131
implements ExpressionCacheFactory<Key, Value> {
3232

33-
/**
34-
* @deprecated since 6.4.0, use {@link #DefaultOgnlExpressionCacheFactory(String, String)}
35-
*/
36-
@Deprecated
37-
public DefaultOgnlExpressionCacheFactory() {
38-
}
39-
4033
@Inject
4134
public DefaultOgnlExpressionCacheFactory(@Inject(value = StrutsConstants.STRUTS_OGNL_EXPRESSION_CACHE_MAXSIZE) String cacheMaxSize,
4235
@Inject(value = StrutsConstants.STRUTS_OGNL_EXPRESSION_CACHE_TYPE) String defaultCacheType) {

core/src/main/java/com/opensymphony/xwork2/ognl/OgnlCacheFactory.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,6 @@
2525
public interface OgnlCacheFactory<Key, Value> {
2626
OgnlCache<Key, Value> buildOgnlCache();
2727

28-
/**
29-
* Note that if {@code lruCache} is {@code false}, the cache type could still be LRU if the default cache type is
30-
* configured as such.
31-
* @deprecated since 6.4.0, use {@link #buildOgnlCache(int, int, float, CacheType)}
32-
*/
33-
@Deprecated
34-
default OgnlCache<Key, Value> buildOgnlCache(int evictionLimit,
35-
int initialCapacity,
36-
float loadFactor,
37-
boolean lruCache) {
38-
return buildOgnlCache(evictionLimit,
39-
initialCapacity,
40-
loadFactor,
41-
lruCache ? CacheType.LRU : getDefaultCacheType());
42-
}
43-
4428
/**
4529
* @param evictionLimit maximum capacity of the cache where applicable for cache type chosen
4630
* @param initialCapacity initial capacity of the cache where applicable for cache type chosen
@@ -52,14 +36,6 @@ default OgnlCache<Key, Value> buildOgnlCache(int evictionLimit,
5236

5337
int getCacheMaxSize();
5438

55-
/**
56-
* @deprecated since 6.4.0
57-
*/
58-
@Deprecated
59-
default boolean getUseLRUCache() {
60-
return CacheType.LRU.equals(getDefaultCacheType());
61-
}
62-
6339
CacheType getDefaultCacheType();
6440

6541
enum CacheType {

0 commit comments

Comments
 (0)