Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Bug 1500 - Null pointer exception when using mounted resources tab to
[controller.git]
/
opendaylight
/
md-sal
/
sal-rest-docgen
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
rest
/
doc
/
impl
/
BaseYangSwaggerGenerator.java
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 c8bf6e6675e1f10278fe218986e54313ba0bb79a..c86b89c004b645aa42e31b86320077278ff23551 100644
(file)
--- 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
@@
-388,13
+388,15
@@
public class BaseYangSwaggerGenerator {
SortedSet<Module> sortedModules = new TreeSet<>(new Comparator<Module>() {
@Override
SortedSet<Module> sortedModules = new TreeSet<>(new Comparator<Module>() {
@Override
- public int compare(Module
o1, Module o
2) {
- int result =
o1.getName().compareTo(o
2.getName());
+ public int compare(Module
module1, Module module
2) {
+ int result =
module1.getName().compareTo(module
2.getName());
if (result == 0) {
if (result == 0) {
- result = o1.getRevision().compareTo(o2.getRevision());
+ Date module1Revision = module1.getRevision() != null ? module1.getRevision() : new Date(0);
+ Date module2Revision = module2.getRevision() != null ? module2.getRevision() : new Date(0);
+ result = module1Revision.compareTo(module2Revision);
}
if (result == 0) {
}
if (result == 0) {
- result =
o1.getNamespace().compareTo(o
2.getNamespace());
+ result =
module1.getNamespace().compareTo(module
2.getNamespace());
}
return result;
}
}
return result;
}