Skip to content

Commit caa5377

Browse files
committed
Replace 'Arrays.asList' for single element lists
1 parent 9353d55 commit caa5377

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

Kitodo-Docket/src/main/java/org/kitodo/docket/ExportXmlLog.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import java.io.OutputStream;
1818
import java.io.UncheckedIOException;
1919
import java.util.ArrayList;
20-
import java.util.Arrays;
2120
import java.util.Collections;
2221
import java.util.HashMap;
2322
import java.util.Iterator;
@@ -89,7 +88,7 @@ public class ExportXmlLog implements Consumer<OutputStream> {
8988
* docket data
9089
*/
9190
ExportXmlLog(DocketData docketData) {
92-
this.docketData = Arrays.asList(docketData);
91+
this.docketData = Collections.singletonList(docketData);
9392
}
9493

9594
@Override

Kitodo/src/main/java/org/kitodo/production/helper/metadata/legacytypeimplementations/LegacyInnerPhysicalDocStructHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ public List<LegacyMetadataHelper> getAllMetadata() {
9292
public List<LegacyMetadataHelper> getAllMetadataByType(LegacyMetadataTypeHelper metadataType) {
9393
if (metadataType == LegacyMetadataTypeHelper.SPECIAL_TYPE_ORDER) {
9494
return Objects.nonNull(physicalDivision)
95-
? Arrays.asList(
96-
new LegacyMetadataHelper(this, metadataType, Integer.toString(physicalDivision.getOrder())))
95+
? List.of(
96+
new LegacyMetadataHelper(this, metadataType, Integer.toString(physicalDivision.getOrder())))
9797
: Collections.emptyList();
9898
} else if (metadataType == LegacyMetadataTypeHelper.SPECIAL_TYPE_ORDERLABEL) {
9999
return Objects.nonNull(physicalDivision) && Objects.nonNull(physicalDivision.getOrderlabel())
100-
? Arrays.asList(new LegacyMetadataHelper(this, metadataType, physicalDivision.getOrderlabel()))
100+
? List.of(new LegacyMetadataHelper(this, metadataType, physicalDivision.getOrderlabel()))
101101
: Collections.emptyList();
102102
} else {
103103
throw new UnsupportedOperationException("Not yet implemented");

Kitodo/src/main/java/org/kitodo/production/helper/metadata/legacytypeimplementations/LegacyPrefsHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public LegacyMetadataTypeHelper getMetadataTypeByName(String identifier) {
9898
StructuralElementViewInterface divisionView = ruleset.getStructuralElementView("", "edit",
9999
priorityList);
100100
List<MetadataViewWithValuesInterface> entryViews = divisionView
101-
.getSortedVisibleMetadata(Collections.emptyList(), Arrays.asList(identifier));
101+
.getSortedVisibleMetadata(Collections.emptyList(), List.of(identifier));
102102
MetadataViewInterface resultKeyView = entryViews.parallelStream()
103103
.map(MetadataViewWithValuesInterface::getMetadata).filter(Optional::isPresent).map(Optional::get)
104104
.filter(keyView -> keyView.getId().equals(identifier)).findFirst()

Kitodo/src/main/java/org/kitodo/production/services/command/KitodoScriptService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private boolean executeRemainingScript(List<Process> processes)
216216
switch (this.parameters.get("action")) {
217217
case "generateImages":
218218
String folders = parameters.get("folders");
219-
List<String> foldersList = Arrays.asList("all");
219+
List<String> foldersList = List.of("all");
220220
if (Objects.nonNull(folders)) {
221221
foldersList = Arrays.asList(folders.split(","));
222222
}

Kitodo/src/main/java/org/kitodo/production/services/data/TaskService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ public boolean executeScript(Task task, String script, boolean automatic) throws
511511
logger.info("Calling KitodoScript interpreter: {}", script);
512512

513513
KitodoScriptService kitodoScriptService = ServiceManager.getKitodoScriptService();
514-
kitodoScriptService.execute(Arrays.asList(task.getProcess()), script);
514+
kitodoScriptService.execute(Collections.singletonList(task.getProcess()), script);
515515
executedSuccessful = true;
516516
} else {
517517
logger.info("Calling the shell: {}", script);

0 commit comments

Comments
 (0)