]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaws
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 15 Mar 2016 09:39:46 +0000 (10:39 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 15 Mar 2016 09:39:46 +0000 (10:39 +0100)
server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortCalculator.java
server/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java
server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/SearchAction.java
sonar-db/src/main/java/org/sonar/db/user/AuthorizationDao.java

index fdb07d5d5be00de2ae22c6803fa7b402ce5a0830..33bb53f1a9f38503c121adb2a7561fad5e283aaf 100644 (file)
@@ -55,7 +55,7 @@ public class NewEffortCalculator {
     return calculateFromChangelog(issue, debtChangelog, period.getSnapshotDate());
   }
 
-  private long calculateFromChangelog(DefaultIssue issue, Collection<IssueChangeDto> debtChangelog, long periodDate) {
+  private static long calculateFromChangelog(DefaultIssue issue, Collection<IssueChangeDto> debtChangelog, long periodDate) {
     List<FieldDiffs> debtDiffs = from(debtChangelog).transform(ToFieldDiffs.INSTANCE).filter(HasDebtChange.INSTANCE).toSortedList(CHANGE_ORDERING);
     FieldDiffs currentChange = issue.currentChange();
     if (currentChange != null && HasDebtChange.INSTANCE.apply(currentChange)) {
index 94f0781a01f9dddf7c0b54471c5a8dad4b1e4ebb..8c6e6c5c52d822a45a0cb844afe898ee24d3cd81 100644 (file)
@@ -342,7 +342,7 @@ public class RegisterRules implements Startable {
     return changed;
   }
 
-  private boolean mergeTags(RulesDefinition.Rule ruleDef, RuleDto dto) {
+  private static boolean mergeTags(RulesDefinition.Rule ruleDef, RuleDto dto) {
     boolean changed = false;
 
     if (RuleStatus.REMOVED == ruleDef.status()) {
index fb2b8a90ef2c4e5b94dbededa6dad8831bbe07dd..1519c60cf7c921dcc49c3a8a47d3d7d6ab2a5dc7 100644 (file)
@@ -98,7 +98,7 @@ public class SearchAction implements UserGroupsWsAction {
     }
   }
 
-  private void writeGroups(JsonWriter json, List<GroupDto> groups, Map<String, Integer> userCountByGroup, Set<String> fields) {
+  private static void writeGroups(JsonWriter json, List<GroupDto> groups, Map<String, Integer> userCountByGroup, Set<String> fields) {
     json.name("groups").beginArray();
     for (GroupDto group : groups) {
       writeGroup(json, group, userCountByGroup.get(group.getName()), fields);
@@ -106,7 +106,7 @@ public class SearchAction implements UserGroupsWsAction {
     json.endArray();
   }
 
-  private void writeGroup(JsonWriter json, GroupDto group, Integer memberCount, Set<String> fields) {
+  private static void writeGroup(JsonWriter json, GroupDto group, Integer memberCount, Set<String> fields) {
     json.beginObject()
       .prop(FIELD_ID, group.getId().toString())
       .prop(FIELD_NAME, fields.contains(FIELD_NAME) ? group.getName() : null)
@@ -115,7 +115,7 @@ public class SearchAction implements UserGroupsWsAction {
       .endObject();
   }
 
-  private Set<String> neededFields(Request request) {
+  private static Set<String> neededFields(Request request) {
     Set<String> fields = Sets.newHashSet();
     List<String> fieldsFromRequest = request.paramAsStrings(Param.FIELDS);
     if (fieldsFromRequest == null || fieldsFromRequest.isEmpty()) {
index 4343e587b862a3061eec8487ab7e49938cbe5787..18f34820c043f8d43bd20901be99674246966e02 100644 (file)
@@ -73,7 +73,7 @@ public class AuthorizationDao implements Dao {
     }
   }
 
-  private List<String> keepAuthorizedComponentKeys(final DbSession session, final String componentKey, @Nullable final Integer userId, final String role) {
+  private static List<String> keepAuthorizedComponentKeys(final DbSession session, final String componentKey, @Nullable final Integer userId, final String role) {
     if (userId == null) {
       return session.getMapper(AuthorizationMapper.class).keepAuthorizedComponentKeysForAnonymous(role, Sets.newHashSet(componentKey));
     } else {