Author: rahul
Date: Thu Nov 30 17:51:51 2006
New Revision: 481129
URL: http://svn.apache.org/viewvc?view=rev&rev=481129
Log:
Restore JDK 1.4 compat broken in r{478459,479765} as part of SHALE-340
Modified:
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorLifecycleListener.java
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/util/ShaleValidatorAction.java
Modified:
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorLifecycleListener.java
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorLifecycleListener.java?view=diff&rev=481129&r1=481128&r2=481129
==============================================================================
---
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorLifecycleListener.java
(original)
+++
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorLifecycleListener.java
Thu Nov 30 17:51:51 2006
@@ -226,7 +226,9 @@
try {
url = context.getResource(pathname);
} catch (MalformedURLException e) {
- throw new IllegalArgumentException(pathname, e);
+ throw new IllegalArgumentException("MalformedURLException:"
+ + " The URL '" + pathname
+ + "' specified as a validator rules resource is
malformed.");
}
if (url == null) {
url =
ValidatorLifecycleListener.class.getResource(pathname);
@@ -247,7 +249,9 @@
try {
url = context.getResource(Globals.DEFAULT_VALIDATOR_RULES);
} catch (MalformedURLException e) {
- throw new
IllegalArgumentException(Globals.DEFAULT_VALIDATOR_RULES, e);
+ throw new IllegalArgumentException("MalformedURLException:"
+ + " The URL '" + Globals.DEFAULT_VALIDATOR_RULES
+ + "' specified as a validator rules resource is
malformed.");
}
if (url == null) {
url =
ValidatorLifecycleListener.class.getResource(Globals.DEFAULT_VALIDATOR_RULES);
Modified:
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/util/ShaleValidatorAction.java
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/util/ShaleValidatorAction.java?view=diff&rev=481129&r1=481128&r2=481129
==============================================================================
---
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/util/ShaleValidatorAction.java
(original)
+++
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/util/ShaleValidatorAction.java
Thu Nov 30 17:51:51 2006
@@ -249,7 +249,10 @@
try {
this.clazz = loader.loadClass(action.getClassname());
} catch (ClassNotFoundException e) {
- throw new IllegalArgumentException(action.getClassname(), e);
+ throw new IllegalArgumentException("ClassNotFoundException:"
+ + " Cannot load class '" + action.getClassname()
+ + "' specified by ValidatorAction with name '"
+ + action.getName() + "'");
}
// Calculate the method parameter signature of the validation
@@ -275,7 +278,10 @@
try {
clazz = loader.loadClass(value);
} catch (ClassNotFoundException e) {
- throw new IllegalArgumentException(value, e);
+ throw new
IllegalArgumentException("ClassNotFoundException:"
+ + " Cannot load method parameter class '" + value
+ + "' specified by ValidatorAction with name '"
+ + action.getName() + "'");
}
}
list.add(clazz);
@@ -286,7 +292,11 @@
try {
this.method = this.clazz.getMethod(action.getMethod(),
this.signature);
} catch (NoSuchMethodException e) {
- throw new IllegalArgumentException(action.getName(), e);
+ throw new IllegalArgumentException("NoSuchMethodException:"
+ + " Method named '" + action.getMethod() + "' with parameters
'"
+ + action.getMethodParams() + "' for class '" +
action.getClassname()
+ + "' not found. Specified by ValidatorAction with name '"
+ + action.getName() + "'");
}
// Create an instance of the validator class if we need one
@@ -295,9 +305,17 @@
try {
this.instance = clazz.newInstance();
} catch (IllegalAccessException e) {
- throw new IllegalArgumentException(action.getName(), e);
+ throw new IllegalArgumentException("IllegalAccessException:"
+ + " Not allowed to instantiate class '" +
action.getClassname()
+ + "' specified by ValidatorAction with name '" +
action.getName()
+ + "' (validation method with name '" + action.getMethod()
+ + "' is not static)");
} catch (InstantiationException e) {
- throw new IllegalArgumentException(action.getName(), e);
+ throw new IllegalArgumentException("InstantiationException:"
+ + " Could not instantiate class '" + action.getClassname()
+ + "' specified by ValidatorAction with name '" +
action.getName()
+ + "' (validation method with name '" + action.getMethod()
+ + "' is not static)");
}
}