From 379e9411bc7ec06cca075397dfee36fd42a94ca7 Mon Sep 17 00:00:00 2001 From: Sébastien Lesaint Date: Thu, 7 Jul 2016 14:41:10 +0200 Subject: fix various quality flaws --- sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java | 2 -- .../java/org/sonar/db/version/v60/PopulateAnalysisUuidOnEvents.java | 4 ++-- .../sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshots.java | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'sonar-db/src') diff --git a/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java b/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java index 9930512fb0d..470cf399bcd 100644 --- a/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java +++ b/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java @@ -181,7 +181,6 @@ class PurgeCommands { @VisibleForTesting protected void deleteAnalyses(List analysisIdUuids) { - List> analysisIdsPartitions = Lists.partition(IdUuidPairs.ids(analysisIdUuids), MAX_SNAPSHOTS_PER_QUERY); List> analysisUuidsPartitions = Lists.partition(IdUuidPairs.uuids(analysisIdUuids), MAX_SNAPSHOTS_PER_QUERY); deleteAnalysisDuplications(analysisUuidsPartitions); @@ -203,7 +202,6 @@ class PurgeCommands { } public void purgeAnalyses(List analysisUuids) { - List> analysisIdsPartitions = Lists.partition(IdUuidPairs.ids(analysisUuids), MAX_SNAPSHOTS_PER_QUERY); List> analysisUuidsPartitions = Lists.partition(IdUuidPairs.uuids(analysisUuids), MAX_SNAPSHOTS_PER_QUERY); deleteAnalysisDuplications(analysisUuidsPartitions); diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnEvents.java b/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnEvents.java index 49e970b67b3..95c59a2ef37 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnEvents.java +++ b/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnEvents.java @@ -40,10 +40,10 @@ public class PopulateAnalysisUuidOnEvents extends BaseDataChange { " where e.snapshot_id is not null and e.analysis_uuid is null"); massUpdate.update("UPDATE events SET analysis_uuid=? WHERE snapshot_id=? and analysis_uuid is null"); massUpdate.rowPluralName("analysis uuid of root component events"); - massUpdate.execute(this::handle); + massUpdate.execute(PopulateAnalysisUuidOnEvents::handle); } - private boolean handle(Select.Row row, SqlStatement update) throws SQLException { + private static boolean handle(Select.Row row, SqlStatement update) throws SQLException { long snapshotId = row.getLong(1); String snapshotUuid = row.getString(2); diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshots.java b/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshots.java index 36db0807e50..991a7cac183 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshots.java +++ b/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshots.java @@ -60,10 +60,10 @@ public class PopulateComponentUuidColumnsOfSnapshots extends BaseDataChange { massUpdate.select("SELECT sn.id, sn.project_id, sn.root_project_id from snapshots sn where sn.component_uuid is null or sn.root_component_uuid is null"); massUpdate.update("UPDATE snapshots SET component_uuid=?, root_component_uuid=? WHERE id=?"); massUpdate.rowPluralName("snapshots"); - massUpdate.execute((row, update) -> this.handle(componentUuidById, row, update)); + massUpdate.execute((row, update) -> handle(componentUuidById, row, update)); } - private boolean handle(Map componentUuidById, Select.Row row, SqlStatement update) throws SQLException { + private static boolean handle(Map componentUuidById, Select.Row row, SqlStatement update) throws SQLException { long id = row.getLong(1); long componentId = row.getLong(2); long rootProjectId = row.getLong(3); -- cgit v1.2.3