commit | c12c3d0372b16886b9230412a3ecc5bf28ad3275 | [log] [tgz] |
---|---|---|
author | Charles Chan <rascov@gmail.com> | Fri Mar 09 15:53:44 2018 -0800 |
committer | Charles Chan <rascov@gmail.com> | Wed Mar 14 23:49:22 2018 -0700 |
tree | 575f1b34999813f1224f2b73111a7e8134ecce20 | |
parent | 2c7b6c77e4fbc8be4bd436b25ea2692b8eb651a5 [diff] |
Fix NPE caused by RoutingRulePopulator not initiated before linkHandler.init() Change-Id: If21a2628c9d4e7687c26fda467240093dbc723c8
diff --git a/app/src/main/java/org/onosproject/segmentrouting/LinkHandler.java b/app/src/main/java/org/onosproject/segmentrouting/LinkHandler.java index 63473a7..948124d 100644 --- a/app/src/main/java/org/onosproject/segmentrouting/LinkHandler.java +++ b/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/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java index 1f035d7..0e4373b 100644 --- a/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java +++ b/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");