diff options
author | surya-huawei <a.u.surya@huawei.com> | 2017-09-21 15:00:19 +0530 |
---|---|---|
committer | surya-huawei <a.u.surya@huawei.com> | 2017-09-21 15:04:55 +0530 |
commit | e36b3f21fb653e5a27e76d44daa54f537e39a525 (patch) | |
tree | dba165f12b06ba980825f1a4386b423cdf463028 | |
parent | d1ed09daa141268d0cb830f5060e9463719d1eba (diff) |
Move string literals to left hand side
Moving string literals to left-hand side of equals()/equalsIgnore()
*This is done to prevent null pointer exception
from being raised
Issue-Id: CCSDK-87
Change-Id: Ibe9deee4fd48b3037be8708a0e3869d741c9173b
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
-rw-r--r-- | resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java index d1913b33d..8e7c63ceb 100644 --- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java +++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java @@ -149,7 +149,7 @@ public class ResourceAllocator implements SvcLogicResource { prefix = prefix == null ? "" : prefix + '.'; - if (!resource.equals("NetworkCapacity")) { + if (!"NetworkCapacity".equals(resource)) { log.info("resource: " + resource); log.info("key: " + key); @@ -374,7 +374,7 @@ public class ResourceAllocator implements SvcLogicResource { log.info("Checking VPE port: " + portId); String provStatus = String.valueOf(vpe.get("provisioning-status")); - if (!provStatus.equals("PROV")) { + if (!"PROV".equals(provStatus)) { log.info("Skipping port " + portId + ": Provisioning status is not PROV."); continue; } @@ -476,7 +476,7 @@ public class ResourceAllocator implements SvcLogicResource { log.info("Checking VPLSPE port: " + portId); String provStatus = String.valueOf(vplspe.get("provisioning-status")); - if (!provStatus.equals("PROV")) { + if (!"PROV".equals(provStatus)) { log.info("Skipping port " + portId + ": Provisioning status is not PROV."); continue; } @@ -572,7 +572,7 @@ public class ResourceAllocator implements SvcLogicResource { for (AllocationOutcome ao1 : mrao.allocationOutcomeList) { if (ao1 instanceof LimitAllocationOutcome) { LimitAllocationOutcome lao = (LimitAllocationOutcome) ao1; - if (lao.request.resourceName.equals("Bandwidth")) { + if ("Bandwidth".equals(lao.request.resourceName)) { ThresholdStatus th = allocationRequestBuilder.getThresholdStatus(sd, ed, lao); setThresholdData(ctx, th, sd, ed); } @@ -588,12 +588,12 @@ public class ResourceAllocator implements SvcLogicResource { for (AllocationOutcome ao1 : mrao.allocationOutcomeList) { if (ao1 instanceof LimitAllocationOutcome) { LimitAllocationOutcome lao = (LimitAllocationOutcome) ao1; - if (lao.status == AllocationStatus.Failure && lao.request.resourceName.equals("Bandwidth")) { + if (lao.status == AllocationStatus.Failure && "Bandwidth".equals(lao.request.resourceName)) { long available = lao.limit - lao.used; if (available > maxAvailableSpeedServer) maxAvailableSpeedServer = available; } - if (lao.status == AllocationStatus.Failure && lao.request.resourceName.equals("Connection")) { + if (lao.status == AllocationStatus.Failure && "Connection".equals(lao.request.resourceName)) { maxAvailableSpeedServer = 0; break; } |