From 26f8651460464b745e131f6818e1c02f8d7c3530 Mon Sep 17 00:00:00 2001 From: Balaji Varadaraju Date: Sun, 14 Feb 2016 02:39:53 -0600 Subject: [PATCH] API Doc Explorer crashes if a yang file on a mounted resource does not have a version The fix for bug 3782 was checking for dates less than 1970 ( default date when there is no version). The fix is to check for less than or equal to 1970. The existing code works fine for US time zones because all US time zones are behind GMT and hence the local time for EPOCH date results in year 1969. However when in other time zones such as in Europe the year part of the EPOCH date results in 1970. This is a simple fix to correct that. Change-Id: I03f9850eaa25a7fbc12895ee0a9eef059a319613 Signed-off-by: Balaji Varadaraju --- .../controller/sal/rest/doc/impl/BaseYangSwaggerGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/BaseYangSwaggerGenerator.java b/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/BaseYangSwaggerGenerator.java index fbb5aeac2e..d2bfe1936c 100644 --- a/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/BaseYangSwaggerGenerator.java +++ b/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/BaseYangSwaggerGenerator.java @@ -132,7 +132,7 @@ public class BaseYangSwaggerGenerator { cal.setTime(rev); - if(cal.get(Calendar.YEAR) < 1970) { + if(cal.get(Calendar.YEAR) <= 1970) { rev = null; } } -- 2.36.6