API Doc Explorer crashes if a yang file on a mounted resource does not have a version 44/34944/2
authorBalaji Varadaraju <bvaradar@brocade.com>
Thu, 18 Feb 2016 23:15:14 +0000 (17:15 -0600)
committerTony Tkacik <ttkacik@cisco.com>
Wed, 24 Feb 2016 12:51:55 +0000 (12:51 +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: I671e602cc5f99cdc3f940073609028b8f2349de9
Signed-off-by: Balaji Varadaraju <bvaradar@brocade.com>
opendaylight/restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/BaseYangSwaggerGenerator.java

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