Closes #2521 - Fix code smells Stream.collect(Collectors.toList()) to Stream.toList()
This commit is contained in:
parent
e7b77487fc
commit
71e75110e6
|
|
@ -136,6 +136,7 @@ public class TaskanaConfiguration {
|
||||||
|
|
||||||
// region custom configuration
|
// region custom configuration
|
||||||
private final Map<String, String> properties;
|
private final Map<String, String> properties;
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
private TaskanaConfiguration(Builder builder) {
|
private TaskanaConfiguration(Builder builder) {
|
||||||
|
|
@ -238,7 +239,7 @@ public class TaskanaConfiguration {
|
||||||
public List<String> getAllClassificationCategories() {
|
public List<String> getAllClassificationCategories() {
|
||||||
return this.classificationCategoriesByType.values().stream()
|
return this.classificationCategoriesByType.values().stream()
|
||||||
.flatMap(Collection::stream)
|
.flatMap(Collection::stream)
|
||||||
.collect(Collectors.toList());
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getClassificationCategoriesByType(String type) {
|
public List<String> getClassificationCategoriesByType(String type) {
|
||||||
|
|
@ -723,11 +724,13 @@ public class TaskanaConfiguration {
|
||||||
|
|
||||||
@TaskanaProperty("taskana.servicelevel.validation.enforce")
|
@TaskanaProperty("taskana.servicelevel.validation.enforce")
|
||||||
private boolean enforceServiceLevel = true;
|
private boolean enforceServiceLevel = true;
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region authentication configuration
|
// region authentication configuration
|
||||||
@TaskanaProperty("taskana.roles")
|
@TaskanaProperty("taskana.roles")
|
||||||
private Map<TaskanaRole, Set<String>> roleMap = new EnumMap<>(TaskanaRole.class);
|
private Map<TaskanaRole, Set<String>> roleMap = new EnumMap<>(TaskanaRole.class);
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region classification configuration
|
// region classification configuration
|
||||||
|
|
@ -736,6 +739,7 @@ public class TaskanaConfiguration {
|
||||||
|
|
||||||
@TaskanaProperty("taskana.classification.categories")
|
@TaskanaProperty("taskana.classification.categories")
|
||||||
private Map<String, List<String>> classificationCategoriesByType = new HashMap<>();
|
private Map<String, List<String>> classificationCategoriesByType = new HashMap<>();
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region working time configuration
|
// region working time configuration
|
||||||
|
|
@ -758,6 +762,7 @@ public class TaskanaConfiguration {
|
||||||
|
|
||||||
@TaskanaProperty("taskana.workingTime.holidays.german.corpus-christi.enabled")
|
@TaskanaProperty("taskana.workingTime.holidays.german.corpus-christi.enabled")
|
||||||
private boolean germanPublicHolidaysCorpusChristiEnabled = false;
|
private boolean germanPublicHolidaysCorpusChristiEnabled = false;
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region history configuration
|
// region history configuration
|
||||||
|
|
@ -766,6 +771,7 @@ public class TaskanaConfiguration {
|
||||||
|
|
||||||
@TaskanaProperty("taskana.history.logger.name")
|
@TaskanaProperty("taskana.history.logger.name")
|
||||||
private String logHistoryLoggerName = null; // default value will be set in the logger class.
|
private String logHistoryLoggerName = null; // default value will be set in the logger class.
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region job configuration
|
// region job configuration
|
||||||
|
|
@ -858,6 +864,7 @@ public class TaskanaConfiguration {
|
||||||
|
|
||||||
@TaskanaProperty("taskana.jobs.customJobs")
|
@TaskanaProperty("taskana.jobs.customJobs")
|
||||||
private Set<String> customJobs = new HashSet<>();
|
private Set<String> customJobs = new HashSet<>();
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region user configuration
|
// region user configuration
|
||||||
|
|
@ -866,15 +873,18 @@ public class TaskanaConfiguration {
|
||||||
|
|
||||||
@TaskanaProperty("taskana.user.minimalPermissionsToAssignDomains")
|
@TaskanaProperty("taskana.user.minimalPermissionsToAssignDomains")
|
||||||
private Set<WorkbasketPermission> minimalPermissionsToAssignDomains = new HashSet<>();
|
private Set<WorkbasketPermission> minimalPermissionsToAssignDomains = new HashSet<>();
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region database configuration
|
// region database configuration
|
||||||
@TaskanaProperty("taskana.feature.useSpecificDb2Taskquery")
|
@TaskanaProperty("taskana.feature.useSpecificDb2Taskquery")
|
||||||
private boolean useSpecificDb2Taskquery = true;
|
private boolean useSpecificDb2Taskquery = true;
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region custom configuration
|
// region custom configuration
|
||||||
private Map<String, String> properties = Collections.emptyMap();
|
private Map<String, String> properties = Collections.emptyMap();
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
public Builder(DataSource dataSource, boolean useManagedTransactions, String schemaName) {
|
public Builder(DataSource dataSource, boolean useManagedTransactions, String schemaName) {
|
||||||
|
|
@ -1055,6 +1065,7 @@ public class TaskanaConfiguration {
|
||||||
this.enforceServiceLevel = enforceServiceLevel;
|
this.enforceServiceLevel = enforceServiceLevel;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region authentication configuration
|
// region authentication configuration
|
||||||
|
|
@ -1353,18 +1364,15 @@ public class TaskanaConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void adjustConfiguration() {
|
private void adjustConfiguration() {
|
||||||
domains = domains.stream().map(String::toUpperCase).collect(Collectors.toList());
|
domains = domains.stream().map(String::toUpperCase).toList();
|
||||||
classificationTypes =
|
classificationTypes = classificationTypes.stream().map(String::toUpperCase).toList();
|
||||||
classificationTypes.stream().map(String::toUpperCase).collect(Collectors.toList());
|
|
||||||
classificationCategoriesByType =
|
classificationCategoriesByType =
|
||||||
classificationCategoriesByType.entrySet().stream()
|
classificationCategoriesByType.entrySet().stream()
|
||||||
.map(
|
.map(
|
||||||
e ->
|
e ->
|
||||||
Map.entry(
|
Map.entry(
|
||||||
e.getKey().toUpperCase(),
|
e.getKey().toUpperCase(),
|
||||||
e.getValue().stream()
|
e.getValue().stream().map(String::toUpperCase).toList()))
|
||||||
.map(String::toUpperCase)
|
|
||||||
.collect(Collectors.toList())))
|
|
||||||
.sorted(Comparator.comparingInt(e -> classificationTypes.indexOf(e.getKey())))
|
.sorted(Comparator.comparingInt(e -> classificationTypes.indexOf(e.getKey())))
|
||||||
.collect(
|
.collect(
|
||||||
Collectors.toMap(
|
Collectors.toMap(
|
||||||
|
|
@ -1446,11 +1454,10 @@ public class TaskanaConfiguration {
|
||||||
if (!new HashSet<>(classificationTypes)
|
if (!new HashSet<>(classificationTypes)
|
||||||
.containsAll(classificationCategoriesByType.keySet())) {
|
.containsAll(classificationCategoriesByType.keySet())) {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
"Parameter classificationCategoriesByType (taskana.classification.categories.<KEY>)"
|
"Parameter classificationCategoriesByType (taskana.classification.categories.<KEY>)"
|
||||||
+ " is configured incorrectly. Please check whether all specified"
|
+ " is configured incorrectly. Please check whether all specified"
|
||||||
+ " Classification Types exist. Additionally, check whether the correct"
|
+ " Classification Types exist. Additionally, check whether the correct"
|
||||||
+ " separator is used in the property taskana.classification.types ."
|
+ " separator is used in the property taskana.classification.types .");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!classificationCategoriesByType.keySet().containsAll(classificationTypes)) {
|
if (!classificationCategoriesByType.keySet().containsAll(classificationTypes)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue