aboutsummaryrefslogtreecommitdiffstats
path: root/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDAO.java
diff options
context:
space:
mode:
authorTemoc Rodriguez <cr056n@att.com>2017-12-04 11:39:54 -0800
committerTemoc Rodriguez <cr056n@att.com>2017-12-04 11:43:32 -0800
commitd0099f039b0dbf8f14ec2d273290a7c8ff58cb1c (patch)
tree516b0b00d0656314b795439694b391084c639c3e /integrity-audit/src/main/java/org/onap/policy/common/ia/DbDAO.java
parent4cd4924f682afe455db9a6416b7513fb9eafbfe0 (diff)
Fix bug where paramsAreBad doesn't update string
Replaced the string parameter with a StringBuilder so that the modified version can be accessed outside the method, since strings are immutable. Added null check for properties. Removed trim on properties in case the property is null. Added junit to test that the modified StringBuilder can be read outside the paramsAreBad method. Issue-ID: POLICY-492 Change-Id: I0550e9d639cbbcc876e6aafb84f6e9a363b653ff Signed-off-by: Temoc Rodriguez <cr056n@att.com>
Diffstat (limited to 'integrity-audit/src/main/java/org/onap/policy/common/ia/DbDAO.java')
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/DbDAO.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDAO.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDAO.java
index db633400..99503854 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDAO.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDAO.java
@@ -95,7 +95,7 @@ public class DbDAO {
* @throws IntegrityAuditPropertiesException
*/
private void validateProperties(String resourceName, String persistenceUnit, Properties properties) throws IntegrityAuditPropertiesException{
- String badparams="";
+ StringBuilder badparams= new StringBuilder();
if(IntegrityAudit.parmsAreBad(resourceName, persistenceUnit, properties, badparams)){
String msg = "DbDAO: Bad parameters: badparams" + badparams;
throw new IntegrityAuditPropertiesException(msg);