aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-06-01 13:52:33 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-06-02 14:06:05 +0200
commit83227c7b26c855242959c099ee868d911f330357 (patch)
tree4706f7188146d2c8448079e2ab8b00c2340aadf2 /sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java
parent4d6001278cc4d304b59bc281142238df503425a7 (diff)
downloadsonarqube-83227c7b26c855242959c099ee868d911f330357.tar.gz
sonarqube-83227c7b26c855242959c099ee868d911f330357.zip
fix quality flaws: use lambdas with DatabaseUtils.executeLargeInputs
Diffstat (limited to 'sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java23
1 files changed, 2 insertions, 21 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java
index 515747a6a42..6d4b3936f4f 100644
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java
@@ -19,20 +19,18 @@
*/
package org.sonar.db.issue;
-import com.google.common.base.Function;
import com.google.common.collect.Lists;
import java.util.Collection;
import java.util.List;
import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
import org.sonar.core.issue.DefaultIssueComment;
import org.sonar.core.issue.FieldDiffs;
import org.sonar.db.Dao;
-import org.sonar.db.DatabaseUtils;
import org.sonar.db.DbSession;
import org.sonar.db.MyBatis;
import static java.util.Arrays.asList;
+import static org.sonar.db.DatabaseUtils.executeLargeInputs;
public class IssueChangeDao implements Dao {
@@ -88,24 +86,7 @@ public class IssueChangeDao implements Dao {
}
public List<IssueChangeDto> selectByTypeAndIssueKeys(DbSession session, Collection<String> issueKeys, String changeType) {
- return DatabaseUtils.executeLargeInputs(issueKeys, new SelectByIssueKeys(mapper(session), changeType));
- }
-
- private static class SelectByIssueKeys implements Function<List<String>, List<IssueChangeDto>> {
-
- private final IssueChangeMapper mapper;
- private final String changeType;
-
- private SelectByIssueKeys(IssueChangeMapper mapper, String changeType) {
- this.mapper = mapper;
- this.changeType = changeType;
- }
-
- @Override
- public List<IssueChangeDto> apply(@Nonnull List<String> issueKeys) {
- return mapper.selectByIssuesAndType(issueKeys, changeType);
- }
-
+ return executeLargeInputs(issueKeys, issueKeys1 -> mapper(session).selectByIssuesAndType(issueKeys1, changeType));
}
public void insert(DbSession session, IssueChangeDto change) {