Author: alessio.soldano(a)jboss.com
Date: 2013-01-29 01:15:22 -0500 (Tue, 29 Jan 2013)
New Revision: 471
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java
Log:
Better handling of nulls
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java
===================================================================
---
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java 2013-01-29
05:49:56 UTC (rev 470)
+++
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java 2013-01-29
06:15:22 UTC (rev 471)
@@ -72,6 +72,7 @@
@SuppressWarnings("unchecked")
public Object toObject() {
+ if (isNil()) return null;
Object obj = null;
try {
Class<?> cl = (Class<?>) classType;
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java
===================================================================
---
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java 2013-01-29
05:49:56 UTC (rev 470)
+++
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java 2013-01-29
06:15:22 UTC (rev 471)
@@ -67,6 +67,7 @@
@Override
public Object toObject() {
+ if (isNil()) return null;
Object result = null;
try {
result = DatatypeFactory.newInstance().newDuration(Long.parseLong(value));
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java
===================================================================
---
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java 2013-01-29
05:49:56 UTC (rev 470)
+++
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java 2013-01-29
06:15:22 UTC (rev 471)
@@ -86,6 +86,7 @@
}
public Object toObject() {
+ if (isNil()) return null;
LinkedList<Object> returnList = new LinkedList<Object>();
Iterator<Object> keyIt = this.getChildrenKeysIterator();
while (keyIt.hasNext()) {
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java
===================================================================
---
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java 2013-01-29
05:49:56 UTC (rev 470)
+++
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java 2013-01-29
06:15:22 UTC (rev 471)
@@ -90,6 +90,6 @@
@Override
public Object toObject() {
- return new QName(nameSpace, localPart);
+ return isNil() ? null : new QName(nameSpace, localPart);
}
}