summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPooja03 <PM00501616@techmahindra.com>2018-02-07 15:54:23 +0530
committerPooja03 <PM00501616@techmahindra.com>2018-02-07 15:54:23 +0530
commitc7a371db4e3c52f56a4c8d30169e7b60ce032918 (patch)
treed68c1314bcc2f24ca8d0313d49ac9ced05eb2fbd
parent770651374511b21e87b83bb65c26863ead4a2a54 (diff)
Sonar Major fix
Make the anonymous inner class a lambda in StringListArgument.java Sonar Link:https://sonar.onap.org/component_issues/index?id=org.onap.dcaegen2.platform%3Ainventory-api#resolved=false|severities=MAJOR|assignees=Pooja03 Location:StringListArgument.java:L48 Change-Id: I370a7efae998af0af9b625ec83433cd33439c8e8 Issue-ID: DCAEGEN2-318 Signed-off-by: Pooja03 <PM00501616@techmahindra.com>
-rw-r--r--src/main/java/org/onap/dcae/inventory/dbthings/StringListArgument.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/org/onap/dcae/inventory/dbthings/StringListArgument.java b/src/main/java/org/onap/dcae/inventory/dbthings/StringListArgument.java
index b08bec1..2e70550 100644
--- a/src/main/java/org/onap/dcae/inventory/dbthings/StringListArgument.java
+++ b/src/main/java/org/onap/dcae/inventory/dbthings/StringListArgument.java
@@ -44,14 +44,12 @@ public class StringListArgument implements ArgumentFactory<List<String>> {
}
@Override
- public Argument build(Class<?> expectedType, List<String> value, StatementContext statementContext) {
- return new Argument() {
- @Override
- public void apply(int position, PreparedStatement statement, StatementContext ctx) throws SQLException {
- Array values = statement.getConnection().createArrayOf("varchar", value.toArray());
- statement.setArray(position, values);
- }
- };
- }
+ public Argument build(Class<?> expectedType, List<String> value, StatementContext statementContext) {
+ Argument argument = (int position, PreparedStatement statement, StatementContext ctx) -> {
+ Array values = statement.getConnection().createArrayOf("varchar", value.toArray());
+ statement.setArray(position, values);
+ };
+ return argument;
+ }
}