summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantosh Yadav <santosh.k.yadav@ril.com>2018-02-05 15:06:46 +0530
committerSantosh Yadav <santosh.k.yadav@ril.com>2018-02-05 15:06:46 +0530
commitf7674aae6c52b5c0f0eb5e921f8e23571fb3e97d (patch)
tree6270b770a2feb3ffa7701ff7037c26dba442742e
parent9cbebfa82410d1b2c1465f371ee2c1f96d2fa7ea (diff)
sonar bug fix: might cause NPE
added null check on lpattern variable ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java Change-Id: Iad6f2da5ce66a9cce1b54cacc1cb26835308e248 Issue-ID: VFC-692 Signed-off-by: Santosh Yadav <santosh.k.yadav@ril.com>
-rw-r--r--ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java
index d764bf6..9f2824b 100644
--- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java
+++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java
@@ -1010,8 +1010,13 @@ public class TaskThread implements Runnable {
log.error("[" + regular + "]compile fails:" + e.getMessage());
e.printStackTrace();
}
-
- Matcher matcher = lpattern.matcher(regular);
+ Matcher matcher=null;
+ if(lpattern!=null)
+ matcher = lpattern.matcher(regular);
+ else{
+ //define flow in case lpattern is null
+ }
+
if (matcher.find()) {
isregular = true;
String parpath = matcher.group(1);