It is convenient to coerce the argument value, but this approach is a
bit more clean and avoids the sonar warning.
Change-Id: I8648e09c5c02bb082321c3a9a858142eaabdc9ea
Signed-off-by: Robert Varga <rovarga@cisco.com>
return req.getFuture();
}
- protected final synchronized void updateLsp(final DataModificationTransaction trans, final PLSPID id, String name,
+ protected final synchronized void updateLsp(final DataModificationTransaction trans, final PLSPID id, final String lspName,
final ReportedLspBuilder rlb, final boolean solicited) {
- if (name == null) {
+
+ final String name;
+ if (lspName == null) {
name = this.lsps.get(id);
if (name == null) {
LOG.error("PLSPID {} seen for the first time, not reporting the LSP", id);
return;
}
+ } else {
+ name = lspName;
}
+
LOG.debug("Saved LSP {} with name {}", id, name);
this.lsps.put(id, name);