diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-07-07 14:41:10 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-07-07 17:07:11 +0200 |
commit | 379e9411bc7ec06cca075397dfee36fd42a94ca7 (patch) | |
tree | 76994f9f0b5aa6cbfaf57612b6194959dffe0462 /sonar-db/src | |
parent | 609f65154990e9a75589b542e66141587913e8a2 (diff) | |
download | sonarqube-379e9411bc7ec06cca075397dfee36fd42a94ca7.tar.gz sonarqube-379e9411bc7ec06cca075397dfee36fd42a94ca7.zip |
fix various quality flaws
Diffstat (limited to 'sonar-db/src')
3 files changed, 4 insertions, 6 deletions
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<IdUuidPair> analysisIdUuids) { - List<List<Long>> analysisIdsPartitions = Lists.partition(IdUuidPairs.ids(analysisIdUuids), MAX_SNAPSHOTS_PER_QUERY); List<List<String>> analysisUuidsPartitions = Lists.partition(IdUuidPairs.uuids(analysisIdUuids), MAX_SNAPSHOTS_PER_QUERY); deleteAnalysisDuplications(analysisUuidsPartitions); @@ -203,7 +202,6 @@ class PurgeCommands { } public void purgeAnalyses(List<IdUuidPair> analysisUuids) { - List<List<Long>> analysisIdsPartitions = Lists.partition(IdUuidPairs.ids(analysisUuids), MAX_SNAPSHOTS_PER_QUERY); List<List<String>> 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<Long, String> componentUuidById, Select.Row row, SqlStatement update) throws SQLException { + private static boolean handle(Map<Long, String> componentUuidById, Select.Row row, SqlStatement update) throws SQLException { long id = row.getLong(1); long componentId = row.getLong(2); long rootProjectId = row.getLong(3); |