Fixed sonar suggestion in l2handler
Change-Id: Ia16e6197c36b3bebed4610c40624fa180a4b9385
diff --git a/app/src/main/java/org/onosproject/segmentrouting/pwaas/DefaultL2TunnelHandler.java b/app/src/main/java/org/onosproject/segmentrouting/pwaas/DefaultL2TunnelHandler.java
index dc8500d..47a73d4 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/pwaas/DefaultL2TunnelHandler.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/pwaas/DefaultL2TunnelHandler.java
@@ -626,7 +626,7 @@
pw.l2TunnelPolicy().cP1InnerTag(),
pw.l2TunnelPolicy().cP1OuterTag(),
egressVlan,
- result.nextId);
+ result.getNextId());
if (result != SUCCESS) {
log.info("Deploying process : Error in deploying pseudowire policy for CP1");
return Result.INTERNAL_ERROR.appendError("Error in deploying pseudowire policy for CP1");
@@ -673,7 +673,7 @@
pw.l2TunnelPolicy().cP2InnerTag(),
pw.l2TunnelPolicy().cP2OuterTag(),
egressVlan,
- result.nextId);
+ result.getNextId());
if (result != SUCCESS) {
log.info("Deploying process : Error in deploying policy for CP2");
return Result.INTERNAL_ERROR
@@ -1020,7 +1020,7 @@
log.debug("Initiation next objective for {} not found. Creating new NextObj with id={}",
l2Tunnel.tunnelId(), nextObjective.id());
Result result = SUCCESS;
- result.nextId = nextObjective.id();
+ result.setNextId(nextObjective.id());
return result;
}
diff --git a/app/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java b/app/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java
index 2f7fa32..294134e 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java
@@ -137,7 +137,7 @@
private final String description;
private String specificError;
- public int nextId;
+ private int nextId;
Result(int code, String description) {
this.code = code;
@@ -157,6 +157,14 @@
return description;
}
+ public int getNextId() {
+ return nextId;
+ }
+
+ public void setNextId(int nextId) {
+ this.nextId = nextId;
+ }
+
@Override
public String toString() {
return code + ": " + description;