aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-11-11 15:54:26 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-11-11 15:54:26 +0100
commita10e9e92d4dceae57e535a5e14e0f3bd24dd413d (patch)
treed1528399c0bf334cb80953e8e4687ebbbee5678a
parent15e9f443eed5c74be9abe4738b07d62fe335c8e6 (diff)
downloadsonarqube-a10e9e92d4dceae57e535a5e14e0f3bd24dd413d.tar.gz
sonarqube-a10e9e92d4dceae57e535a5e14e0f3bd24dd413d.zip
Fix Quality flaws about lambda
-rw-r--r--sonar-db/src/main/java/org/sonar/db/version/v51/FeedFileSourcesBinaryData.java16
1 files changed, 5 insertions, 11 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v51/FeedFileSourcesBinaryData.java b/sonar-db/src/main/java/org/sonar/db/version/v51/FeedFileSourcesBinaryData.java
index 49f624799fe..c2f8407c27a 100644
--- a/sonar-db/src/main/java/org/sonar/db/version/v51/FeedFileSourcesBinaryData.java
+++ b/sonar-db/src/main/java/org/sonar/db/version/v51/FeedFileSourcesBinaryData.java
@@ -40,8 +40,6 @@ import org.sonar.db.protobuf.DbFileSources;
import org.sonar.db.source.FileSourceDto;
import org.sonar.db.version.BaseDataChange;
import org.sonar.db.version.MassUpdate;
-import org.sonar.db.version.Select;
-import org.sonar.db.version.SqlStatement;
public class FeedFileSourcesBinaryData extends BaseDataChange {
@@ -54,14 +52,11 @@ public class FeedFileSourcesBinaryData extends BaseDataChange {
MassUpdate update = context.prepareMassUpdate().rowPluralName("issues");
update.select("SELECT id,data FROM file_sources WHERE binary_data is null");
update.update("UPDATE file_sources SET binary_data=? WHERE id=?");
- update.execute(new MassUpdate.Handler() {
- @Override
- public boolean handle(Select.Row row, SqlStatement update) throws SQLException {
- Long fileSourceId = row.getNullableLong(1);
- update.setBytes(1, toBinary(fileSourceId, row.getNullableString(2)));
- update.setLong(2, fileSourceId);
- return true;
- }
+ update.execute((row, update1) -> {
+ Long fileSourceId = row.getNullableLong(1);
+ update1.setBytes(1, toBinary(fileSourceId, row.getNullableString(2)));
+ update1.setLong(2, fileSourceId);
+ return true;
});
}
@@ -76,7 +71,6 @@ public class FeedFileSourcesBinaryData extends BaseDataChange {
while (rows.hasNext()) {
CSVRecord row = rows.next();
if (row.size() == 16) {
-
DbFileSources.Line.Builder lineBuilder = dataBuilder.addLinesBuilder();
lineBuilder.setLine(line);
String s = row.get(0);