commit | 445bbde032d5dd1c8346b342826aee6816c27868 | [log] [tgz] |
---|---|---|
author | Charles Chan <rascov@gmail.com> | Fri Mar 09 15:53:44 2018 -0800 |
committer | Charles Chan <charles@opennetworking.org> | Thu Mar 15 06:47:21 2018 +0000 |
tree | 68cf415a94a1a2f9025260fb8b76b7bb7e6fbff9 | |
parent | 90148cb51e866a539eef20f614718d9d4eb09d7d [diff] |
Fix NPE caused by RoutingRulePopulator not initiated before linkHandler.init() Change-Id: If21a2628c9d4e7687c26fda467240093dbc723c8
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/LinkHandler.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/LinkHandler.java index 63473a7..948124d 100644 --- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/LinkHandler.java +++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/LinkHandler.java
@@ -71,7 +71,6 @@ .withTimestampProvider((k, v) -> new WallClockTimestamp()) .build(); log.trace("Current size {}", downedPortStore.size()); - init(); } /** @@ -88,10 +87,9 @@ /** * Initialize LinkHandler. */ - private void init() { + void init() { log.info("Loading stored links"); - srManager.linkService.getActiveLinks() - .forEach(link -> processLinkAdded(link)); + srManager.linkService.getActiveLinks().forEach(this::processLinkAdded); } /**
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java index 65ffb53..7893f90 100644 --- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java +++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -440,6 +440,7 @@ routeService.addListener(routeListener); topologyService.addListener(topologyListener); + linkHandler.init(); l2TunnelHandler.init(); log.info("Started");