Merge "ApiAuthorizationCheckInterface-Fixed sonar issue"
diff --git a/pom.xml b/pom.xml
index 62ca18a..0667768 100644
--- a/pom.xml
+++ b/pom.xml
@@ -359,7 +359,7 @@
 	    <jackson.version>2.9.5</jackson.version>
 		<jersey.version>2.26</jersey.version>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<jettyVersion>9.4.12.RC0</jettyVersion> 
+		<jettyVersion>9.3.8.RC0</jettyVersion> 
 		<eelf.version>0.0.1</eelf.version>
 		<artifact.version>1.0.15-SNAPSHOT</artifact.version>
 		<!-- SONAR -->
diff --git a/src/main/java/org/onap/dmaap/dbcapi/aaf/AafDecrypt.java b/src/main/java/org/onap/dmaap/dbcapi/aaf/AafDecrypt.java
index 8728988..31e2a34 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/aaf/AafDecrypt.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/aaf/AafDecrypt.java
@@ -36,6 +36,7 @@
 			dec = (DecryptionInterface) (Class.forName(dClass).newInstance());	
 			dec.init( p.getProperty("CredentialCodecKeyfile", "LocalKey"));
 		} catch (Exception ee ) {
+			logger.error("Error", ee);
 			errorLogger.error(DmaapbcLogMessageEnum.UNEXPECTED_CONDITION, "attempting to instantiate " + dClass  );		
 		}	
 	}
@@ -46,6 +47,7 @@
 		try {		
 			pwd = dec.decrypt( encPwd );
 		} catch( IOException io ) {
+			logger.error("Error", io);
 			errorLogger.error(DmaapbcLogMessageEnum.DECRYPT_IO_ERROR, dClass, encPwd );
 		} 
 		
diff --git a/src/main/java/org/onap/dmaap/dbcapi/aaf/AafLurService.java b/src/main/java/org/onap/dmaap/dbcapi/aaf/AafLurService.java
index cb0be04..edc522e 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/aaf/AafLurService.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/aaf/AafLurService.java
@@ -37,13 +37,13 @@
 import org.onap.aaf.cadi.principal.UnAuthPrincipal;
 import org.onap.aaf.misc.env.APIException;
 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
-import org.onap.dmaap.dbcapi.logging.DmaapbcLogMessageEnum;
-import org.onap.dmaap.dbcapi.util.DmaapConfig;
 
 /*
  * this service uses the AAF Lur object to lookup identities and perms
  */
 public class AafLurService extends BaseLoggingClass {
+	
+	static Logger logger = Logger.getLogger(AafLurService.class.getName());
 
 	
 	 private static AAFConHttp aafcon;
@@ -66,6 +66,7 @@
 		} catch ( CadiException | LocatorException e) {
 			appLogger.error( "Failure of AAFConHttp: " + e.getMessage() );
 			errorLogger.error( "Failure of AAFConHttp: " + e.getMessage() );
+			logger.error(e);
 			e.printStackTrace();
 			throw e;
 		} 
@@ -74,6 +75,7 @@
 		} catch ( CadiException  e) {
 			appLogger.error( "Failure of newLur(): " + e.getMessage() );
 			errorLogger.error( "Failure of newLur(): " + e.getMessage() );
+			logger.error(e);
 			e.printStackTrace();
 			throw e;
 		} 
@@ -87,6 +89,7 @@
 				init( myAccess );
 			} catch (APIException | CadiException | LocatorException e) {
 				// TODO Auto-generated catch block
+				logger.error(e);
 				e.printStackTrace();
 				throw e;
 			} 
@@ -120,7 +123,10 @@
 			return rc;
 		}
 		rc =  aafLur.fish( principal, aafPerm );
-		if (rc == true ) return rc;
+		boolean flag = true;
+		if (rc == flag ) {
+			return rc;
+		}
 		
 		List<Permission> perms = new ArrayList<Permission>();
 		aafLur.fishAll( principal,  perms);
diff --git a/src/main/java/org/onap/dmaap/dbcapi/model/MR_Cluster.java b/src/main/java/org/onap/dmaap/dbcapi/model/MR_Cluster.java
index 166fc21..06b6194 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/model/MR_Cluster.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/model/MR_Cluster.java
@@ -48,17 +48,17 @@
 	private static  String defaultTargetReplicationPort;
 	
 	private static void setDefaults() {
-		boolean been_here = false;
+		/* boolean been_here = false;
 		if ( been_here ) {
 			return;
-		}
+		} */
 		DmaapConfig dc = (DmaapConfig)DmaapConfig.getConfig();
 		defaultTopicProtocol = dc.getProperty("MR.TopicProtocol", "https");
 		defaultTopicPort = dc.getProperty( "MR.TopicPort", "3905");
 		defaultReplicationGroup = dc.getProperty( "MR.ReplicationGroup", "" );
 		defaultSourceReplicationPort = dc.getProperty( "MR.SourceReplicationPort", "2181");
 		defaultTargetReplicationPort = dc.getProperty( "MR.TargetReplicationPort", "9092");
-		been_here = true;
+		// been_here = true;
 	}
 
 
diff --git a/src/main/java/org/onap/dmaap/dbcapi/service/TopicService.java b/src/main/java/org/onap/dmaap/dbcapi/service/TopicService.java
index 3943419..26def91 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/service/TopicService.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/service/TopicService.java
@@ -197,7 +197,9 @@
 				return null;
 			}
 		}
-		mr_topics.put( ntopic.getFqtn(), ntopic );
+		if(ntopic != null) {
+			mr_topics.put( ntopic.getFqtn(), ntopic );
+		}
 		err.setCode(Status.OK.getStatusCode());
 		return ntopic;
 	}
diff --git a/src/main/java/org/onap/dmaap/dbcapi/util/DmaapTimestamp.java b/src/main/java/org/onap/dmaap/dbcapi/util/DmaapTimestamp.java
index e287acb..776a4b4 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/util/DmaapTimestamp.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/util/DmaapTimestamp.java
@@ -30,7 +30,7 @@
 @XmlRootElement
 public class DmaapTimestamp {
 	static final Logger logger = Logger.getLogger(DmaapTimestamp.class);
-	private static Calendar cal = Calendar.getInstance();
+	private Calendar cal = Calendar.getInstance();
 	private Date stamp;
 	
 	public DmaapTimestamp() {