Skip to content

Commit 03db4f1

Browse files
committed
WW-5250 Addresses TODO in test and stops using Mock Objects
1 parent dcaff0b commit 03db4f1

File tree

3 files changed

+187
-193
lines changed

3 files changed

+187
-193
lines changed

core/src/main/java/com/opensymphony/xwork2/validator/ActionValidatorManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public interface ActionValidatorManager {
3636
* @param method the name of the method being invoked on the action - can be <tt>null</tt>.
3737
* @return a list of all validators for the given class and context.
3838
*/
39-
List<Validator> getValidators(Class clazz, String context, String method);
39+
List<Validator> getValidators(Class<?> clazz, String context, String method);
4040

4141
/**
4242
* Returns a list of validators for the given class and context. This is the primary
@@ -46,7 +46,7 @@ public interface ActionValidatorManager {
4646
* @param context the context of the action class - can be <tt>null</tt>.
4747
* @return a list of all validators for the given class and context.
4848
*/
49-
List<Validator> getValidators(Class clazz, String context);
49+
List<Validator> getValidators(Class<?> clazz, String context);
5050

5151
/**
5252
* Validates the given object using action and its context.

core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void validate(Object object, String context, ValidatorContext validatorCo
125125
* @param context context
126126
* @return a validator key which is the class name plus context.
127127
*/
128-
protected String buildValidatorKey(Class clazz, String context) {
128+
protected String buildValidatorKey(Class<?> clazz, String context) {
129129
return clazz.getName() + "/" + context;
130130
}
131131

@@ -137,7 +137,7 @@ protected Validator getValidatorFromValidatorConfig(ValidatorConfig config, Valu
137137
}
138138

139139
@Override
140-
public synchronized List<Validator> getValidators(Class clazz, String context, String method) {
140+
public synchronized List<Validator> getValidators(Class<?> clazz, String context, String method) {
141141
String validatorKey = buildValidatorKey(clazz, context);
142142

143143
if (!validatorCache.containsKey(validatorKey)) {
@@ -158,7 +158,7 @@ public synchronized List<Validator> getValidators(Class clazz, String context, S
158158
}
159159

160160
@Override
161-
public synchronized List<Validator> getValidators(Class clazz, String context) {
161+
public synchronized List<Validator> getValidators(Class<?> clazz, String context) {
162162
return getValidators(clazz, context, null);
163163
}
164164

@@ -277,7 +277,7 @@ public void validate(Object object, String context, ValidatorContext validatorCo
277277
* @param checked the set of previously checked class-contexts, null if none have been checked
278278
* @return a list of validator configs for the given class and context.
279279
*/
280-
protected List<ValidatorConfig> buildValidatorConfigs(Class clazz, String context, boolean checkFile, Set<String> checked) {
280+
protected List<ValidatorConfig> buildValidatorConfigs(Class<?> clazz, String context, boolean checkFile, Set<String> checked) {
281281
List<ValidatorConfig> validatorConfigs = new ArrayList<>();
282282

283283
if (checked == null) {
@@ -287,7 +287,7 @@ protected List<ValidatorConfig> buildValidatorConfigs(Class clazz, String contex
287287
}
288288

289289
if (clazz.isInterface()) {
290-
for (Class anInterface : clazz.getInterfaces()) {
290+
for (Class<?> anInterface : clazz.getInterfaces()) {
291291
validatorConfigs.addAll(buildValidatorConfigs(anInterface, context, checkFile, checked));
292292
}
293293
} else {
@@ -297,7 +297,7 @@ protected List<ValidatorConfig> buildValidatorConfigs(Class clazz, String contex
297297
}
298298

299299
// look for validators for implemented interfaces
300-
for (Class anInterface1 : clazz.getInterfaces()) {
300+
for (Class<?> anInterface1 : clazz.getInterfaces()) {
301301
if (checked.contains(anInterface1.getName())) {
302302
continue;
303303
}
@@ -317,17 +317,17 @@ protected List<ValidatorConfig> buildValidatorConfigs(Class clazz, String contex
317317
return validatorConfigs;
318318
}
319319

320-
protected List<ValidatorConfig> buildAliasValidatorConfigs(Class aClass, String context, boolean checkFile) {
320+
protected List<ValidatorConfig> buildAliasValidatorConfigs(Class<?> aClass, String context, boolean checkFile) {
321321
String fileName = aClass.getName().replace('.', '/') + "-" + context + VALIDATION_CONFIG_SUFFIX;
322322
return loadFile(fileName, aClass, checkFile);
323323
}
324324

325-
protected List<ValidatorConfig> buildClassValidatorConfigs(Class aClass, boolean checkFile) {
325+
protected List<ValidatorConfig> buildClassValidatorConfigs(Class<?> aClass, boolean checkFile) {
326326
String fileName = aClass.getName().replace('.', '/') + VALIDATION_CONFIG_SUFFIX;
327327
return loadFile(fileName, aClass, checkFile);
328328
}
329329

330-
protected List<ValidatorConfig> loadFile(String fileName, Class clazz, boolean checkFile) {
330+
protected List<ValidatorConfig> loadFile(String fileName, Class<?> clazz, boolean checkFile) {
331331
List<ValidatorConfig> retList = Collections.emptyList();
332332

333333
URL fileUrl = ClassLoaderUtil.getResource(fileName, clazz);

0 commit comments

Comments
 (0)