diff options
5 files changed, 12 insertions, 13 deletions
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java index 97380f58d..f3ecfa279 100755 --- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java +++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java @@ -214,10 +214,8 @@ public abstract class CachedDataSource implements DataSource, SQLExecutionMonito throws SQLException { long time = System.currentTimeMillis(); - CachedRowSet data; - - try (PreparedStatement ps = conn.prepareStatement(statement)) { - data = RowSetProvider.newFactory().createCachedRowSet(); + try (PreparedStatement ps = conn.prepareStatement(statement); + CachedRowSet data = RowSetProvider.newFactory().createCachedRowSet()) { if (arguments != null) { prepareStatementForExecuteUpdate(arguments, ps); } @@ -227,7 +225,6 @@ public abstract class CachedDataSource implements DataSource, SQLExecutionMonito LOGGER.debug("SQL SUCCESS. rows returned: {}, time(ms): {}", data.size(), (System.currentTimeMillis() - time)); } - ps.close(); } catch (SQLException exc) { handleSqlExceptionForExecuteStatement(conn, statement, arguments, exc, time); } finally { diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java index ffe6d71d6..f5510b9ab 100644 --- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java +++ b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java @@ -166,7 +166,7 @@ public class RequestResponseLoggingFilter implements Filter { bais = new ByteArrayInputStream(buffer); bsis = new BufferedServletInputStream(bais); } catch (Exception ex) { - ex.printStackTrace(); + log.error("Exception in getInputStream",ex); } return bsis; diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicExpressionFactory.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicExpressionFactory.java index c229cf59f..d275e9703 100644 --- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicExpressionFactory.java +++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicExpressionFactory.java @@ -93,7 +93,7 @@ public class SvcLogicExpressionFactory { try { SvcLogicExpressionFactory.parse(sbuff.toString()); } catch (IOException e) { - e.printStackTrace(); + LOG.error("Exception in SvcLogicExpressionFactory.parse",e); } } } diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ForNodeExecutor.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ForNodeExecutor.java index 6c6b4ca27..a73fadcfc 100644 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ForNodeExecutor.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ForNodeExecutor.java @@ -101,7 +101,7 @@ public class ForNodeExecutor extends SvcLogicNodeExecutor { } } } catch (BreakNodeException br) { - LOG.debug("ForNodeExecutor caught break"); + LOG.error("ForNodeExecutor caught break",br); } return (null); } diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java index e50b99742..f7a229d5d 100644 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java @@ -1117,8 +1117,11 @@ public class MdsalHelper { Class returnClass = m.getReturnType(); String fieldName = toLowerHyphen(m.getName().substring(3)); - fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1); - + if(fieldName!=null) { + fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1); + }else { + fieldName=""; + } String propName = propNamePfx + "." + fieldName; // Is the return type a yang generated class? @@ -1182,11 +1185,10 @@ public class MdsalHelper { } public static boolean isYangGenerated(Class c) { - if (c == null) { - return (false); - } else { + if (c != null) { return (c.getName().startsWith("org.opendaylight.yang.gen.")); } + return false; } public static boolean isIpPrefix(Class c) { |