Adjust to yangtools-2.0.0 changes
[controller.git] / opendaylight / config / config-manager-facade-xml / src / main / java / org / opendaylight / controller / config / facade / xml / mapping / attributes / resolving / SimpleAttributeResolvingStrategy.java
index 12f48e37776d323511a4ba47eaa46551e58078cd..f7952528d19eef479980f80106b4852d27105078 100644 (file)
@@ -14,12 +14,13 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.text.ParseException;
+import java.time.format.DateTimeParseException;
 import java.util.Date;
 import java.util.Map;
 import javax.management.openmbean.SimpleType;
 import org.opendaylight.controller.config.facade.xml.util.Util;
 import org.opendaylight.controller.config.util.xml.DocumentedException;
+import org.opendaylight.yangtools.yang.common.Revision;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -138,8 +139,8 @@ final class SimpleAttributeResolvingStrategy extends AbstractAttributeResolvingS
         @Override
         protected Object parseObject(final Class<?> type, final String value) throws DocumentedException {
             try {
-                return Util.readDate(value);
-            } catch (final ParseException e) {
+                return Revision.ofNullable(value).orElse(null);
+            } catch (final DateTimeParseException e) {
                 LOG.trace("Unable parse value {} due to ", value, e);
                 throw new DocumentedException("Unable to parse value " + value + " as date.", e,
                         DocumentedException.ErrorType.APPLICATION, DocumentedException.ErrorTag.OPERATION_FAILED,