--- a/src-wad/src/org/openbravo/wad/WadUtility.java Tue Mar 04 19:15:14 2014 +0100
+++ b/src-wad/src/org/openbravo/wad/WadUtility.java Wed Mar 05 09:09:53 2014 +0100
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2010 Openbravo SLU
+ * All portions are Copyright (C) 2001-2014 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -807,20 +807,26 @@
return new WADControl();
}
- try {
- Class<?> c = Class.forName(classname);
- control = (WADControl) c.newInstance();
- control.setReference(parentRef);
- control.setSubreference(subRef);
- } catch (ClassNotFoundException ex) {
- log4j.warn("Couldn't find class: " + classname);
+ if (classname == null || classname.isEmpty()) {
control = new WADControl();
- } catch (InstantiationException e) {
- log4j.warn("Couldn't instanciate class: " + classname);
- control = new WADControl();
- } catch (IllegalAccessException e) {
- log4j.warn("Illegal access class: " + classname);
- control = new WADControl();
+ log4j.debug("Class no defined for reference " + parentRef + " - subreference:" + subRef);
+ } else {
+ try {
+ Class<?> c = Class.forName(classname);
+ control = (WADControl) c.newInstance();
+ control.setReference(parentRef);
+ control.setSubreference(subRef);
+ } catch (ClassNotFoundException ex) {
+ log4j.warn("Couldn't find class: " + classname + " - reference: " + parentRef
+ + " - subreference:" + subRef);
+ control = new WADControl();
+ } catch (InstantiationException e) {
+ log4j.warn("Couldn't instanciate class: " + classname);
+ control = new WADControl();
+ } catch (IllegalAccessException e) {
+ log4j.warn("Illegal access class: " + classname);
+ control = new WADControl();
+ }
}
return control;
}