X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fmusic%2Fmain%2FMusicCore.java;h=9f7b060b8b3ce325546f63a5524d6b4248dcc1d2;hb=f60a2f8e0f374769c870644ef78f7ee2938bf2e1;hp=b729ba7408ac5ec2359db54fd706b0cae5a4f6c7;hpb=0d2f003049e562354fda88729dbab70f46daa25f;p=music.git diff --git a/src/main/java/org/onap/music/main/MusicCore.java b/src/main/java/org/onap/music/main/MusicCore.java index b729ba74..9f7b060b 100644 --- a/src/main/java/org/onap/music/main/MusicCore.java +++ b/src/main/java/org/onap/music/main/MusicCore.java @@ -73,7 +73,10 @@ public class MusicCore { public boolean testCondition() throws Exception { // first generate the row ResultSet results = quorumGet(selectQueryForTheRow); - Row row = results.one(); + Row row = null; + if(results != null) { + row = results.one(); + } return getDSHandle().doesRowSatisfyCondition(row, conditions); } } @@ -122,7 +125,7 @@ public class MusicCore { long start = System.currentTimeMillis(); if (mDstoreHandle == null) { // Quick Fix - Best to put this into every call to getDSHandle? - if (! MusicUtil.getMyCassaHost().equals("localhost") ) { + if (! "localhost".equals(MusicUtil.getMyCassaHost())) { mDstoreHandle = new MusicDataStore(MusicUtil.getMyCassaHost()); } else { mDstoreHandle = new MusicDataStore(); @@ -288,7 +291,8 @@ public class MusicCore { MusicLockState newMls = null; try { currentMls = getMusicLockState(key); - String currentLockHolder = currentMls.getLockHolder(); + String currentLockHolder = null; + if(currentMls != null) { currentLockHolder = currentMls.getLockHolder(); }; if (lockId.equals(currentLockHolder)) { logger.info(EELFLoggerDelegate.applicationLogger,"In acquire lock: You already have the lock!"); return new ReturnType(ResultType.SUCCESS, "You already have the lock!");