vhardy 2003/03/18 05:25:54
Modified: test-sources/org/apache/batik/test/xml XMLReflect.java
Log:
Minor improvement to regard
Revision Changes Path
1.6 +22 -1 xml-batik/test-sources/org/apache/batik/test/xml/XMLReflect.java
Index: XMLReflect.java
===================================================================
RCS file:
/home/cvs/xml-batik/test-sources/org/apache/batik/test/xml/XMLReflect.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLReflect.java 18 Nov 2002 16:44:45 -0000 1.5
+++ XMLReflect.java 18 Mar 2003 13:25:54 -0000 1.6
@@ -27,6 +27,15 @@
*/
public class XMLReflect implements XMLReflectConstants{
/**
+ * An error happened while trying to construct a test. No constructor
+ * matching the list of arguments could be found
+ * {0} : The test's class name
+ * {1} : The list of argument types for which no constructor was found
+ */
+ public static final String NO_MATCHING_CONSTRUCTOR
+ = "xml.XMLReflect.error.no.matching.constructor";
+
+ /**
* Implementation helper: builds a generic object
*/
public static Object buildObject(Element element) throws Exception {
@@ -69,6 +78,18 @@
Constructor constructor
= getDeclaredConstructor(cl, argsClasses);
+ if (constructor == null) {
+ String argsClassesStr = "null";
+ if (argsClasses != null) {
+ argsClassesStr = "";
+ for (int i=0; i<argsClasses.length; i++) {
+ argsClassesStr += argsClasses[i].getName() + " / ";
+ }
+ }
+ throw new Exception(Messages.formatMessage(NO_MATCHING_CONSTRUCTOR,
+ new Object[] { className,
+
argsClassesStr }));
+ }
return configureObject(constructor.newInstance(argsArray),
element);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]