API Doc Explorer crashes if a yang file on a mounted resource does not have a version 27/34627/4
authorBalaji Varadaraju <bvaradar@brocade.com>
Sun, 14 Feb 2016 08:39:53 +0000 (02:39 -0600)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 18 Feb 2016 11:49:37 +0000 (11:49 +0000)
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 <bvaradar@brocade.com>
opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/BaseYangSwaggerGenerator.java

index fbb5aeac2e2fecd09b157b90631e0d9006a89c98..d2bfe1936c50b4965a20bc899e1d0c6b19c1e28f 100644 (file)
@@ -132,7 +132,7 @@ public class BaseYangSwaggerGenerator {
 
             cal.setTime(rev);
 
-            if(cal.get(Calendar.YEAR) < 1970) {
+            if(cal.get(Calendar.YEAR) <= 1970) {
                 rev = null;
             }
         }