@@ -109,7 +109,7 @@ public class CeServer implements Monitored { | |||
while (!stopAwait) { | |||
try { | |||
// wait for a quite long time but we will be interrupted if flag changes anyway | |||
Thread.sleep(10000); | |||
Thread.sleep(10_000); | |||
} catch (InterruptedException e) { | |||
// continue and check the flag | |||
} |
@@ -31,7 +31,7 @@ class Timeouts { | |||
} | |||
public Timeouts() { | |||
this(60000L); | |||
this(60_000L); | |||
} | |||
/** |
@@ -53,7 +53,7 @@ public class EmailNotificationChannel extends NotificationChannel { | |||
* @see org.apache.commons.mail.Email#setSocketConnectionTimeout(int) | |||
* @see org.apache.commons.mail.Email#setSocketTimeout(int) | |||
*/ | |||
private static final int SOCKET_TIMEOUT = 30000; | |||
private static final int SOCKET_TIMEOUT = 30_000; | |||
/** | |||
* Email Header Field: "List-ID". |
@@ -127,7 +127,7 @@ public class QueryContext { | |||
* Limit on the number of results to return. Defaults to {@link #DEFAULT_LIMIT}. | |||
*/ | |||
public int getLimit() { | |||
return showFullResult ? 999999 : limit; | |||
return showFullResult ? 999_999 : limit; | |||
} | |||
/** |
@@ -30,7 +30,7 @@ import org.sonar.api.utils.log.Loggers; | |||
*/ | |||
public class ProgressLogger { | |||
public static final long DEFAULT_PERIOD_MS = 60000L; | |||
public static final long DEFAULT_PERIOD_MS = 60_000L; | |||
private final Timer timer; | |||
private final LoggerTimerTask task; |
@@ -75,11 +75,11 @@ public class WidgetPropertyDao implements Dao { | |||
public void deleteByWidgetIds(DbSession session, List<Long> widgetIdsWithPropertiesToDelete) { | |||
executeLargeInputs( | |||
widgetIdsWithPropertiesToDelete, | |||
input -> { | |||
mapper(session).deleteByWidgetIds(input); | |||
return Collections.emptyList(); | |||
}); | |||
widgetIdsWithPropertiesToDelete, | |||
input -> { | |||
mapper(session).deleteByWidgetIds(input); | |||
return Collections.emptyList(); | |||
}); | |||
} | |||
private static WidgetPropertyMapper mapper(DbSession session) { |
@@ -312,11 +312,11 @@ public class RuleDto { | |||
} | |||
public Set<String> getTags() { | |||
return tags == null ? new HashSet<String>() : new TreeSet<>(Arrays.asList(StringUtils.split(tags, ','))); | |||
return tags == null ? new HashSet<>() : new TreeSet<>(Arrays.asList(StringUtils.split(tags, ','))); | |||
} | |||
public Set<String> getSystemTags() { | |||
return systemTags == null ? new HashSet<String>() : new TreeSet<>(Arrays.asList(StringUtils.split(systemTags, ','))); | |||
return systemTags == null ? new HashSet<>() : new TreeSet<>(Arrays.asList(StringUtils.split(systemTags, ','))); | |||
} | |||
private String getTagsField() { |
@@ -76,14 +76,14 @@ public class GroupMembershipDao implements Dao { | |||
public Map<String, Integer> countUsersByGroups(DbSession session, Collection<Long> groupIds) { | |||
Map<String, Integer> result = Maps.newHashMap(); | |||
executeLargeInputs( | |||
groupIds, | |||
input -> { | |||
List<GroupUserCount> userCounts = mapper(session).countUsersByGroup(input); | |||
for (GroupUserCount count : userCounts) { | |||
result.put(count.groupName(), count.userCount()); | |||
} | |||
return userCounts; | |||
}); | |||
groupIds, | |||
input -> { | |||
List<GroupUserCount> userCounts = mapper(session).countUsersByGroup(input); | |||
for (GroupUserCount count : userCounts) { | |||
result.put(count.groupName(), count.userCount()); | |||
} | |||
return userCounts; | |||
}); | |||
return result; | |||
} | |||
@@ -91,14 +91,14 @@ public class GroupMembershipDao implements Dao { | |||
public Multimap<String, String> selectGroupsByLogins(DbSession session, Collection<String> logins) { | |||
Multimap<String, String> result = ArrayListMultimap.create(); | |||
executeLargeInputs( | |||
logins, | |||
input -> { | |||
List<LoginGroup> groupMemberships = mapper(session).selectGroupsByLogins(input); | |||
for (LoginGroup membership : groupMemberships) { | |||
result.put(membership.login(), membership.groupName()); | |||
} | |||
return groupMemberships; | |||
}); | |||
logins, | |||
input -> { | |||
List<LoginGroup> groupMemberships = mapper(session).selectGroupsByLogins(input); | |||
for (LoginGroup membership : groupMemberships) { | |||
result.put(membership.login(), membership.groupName()); | |||
} | |||
return groupMemberships; | |||
}); | |||
return result; | |||
} |
@@ -32,7 +32,7 @@ import javax.annotation.CheckForNull; | |||
public class FileCache { | |||
/** Maximum loop count when creating temp directories. */ | |||
private static final int TEMP_DIR_ATTEMPTS = 10000; | |||
private static final int TEMP_DIR_ATTEMPTS = 10_000; | |||
private final File dir; | |||
private final File tmpDir; |
@@ -30,7 +30,7 @@ import org.apache.commons.lang.builder.ToStringStyle; | |||
*/ | |||
public class WorkDuration implements Serializable { | |||
static final int DAY_POSITION_IN_LONG = 10000; | |||
static final int DAY_POSITION_IN_LONG = 10_000; | |||
static final int HOUR_POSITION_IN_LONG = 100; | |||
static final int MINUTE_POSITION_IN_LONG = 1; | |||