Add SafeVarargs annotations

This commit is contained in:
Henning Poettker
2023-03-25 23:56:35 +01:00
committed by Mahmoud Ben Hassine
parent 74be83a3a5
commit 2b536578c9
2 changed files with 6 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ public class Chunk<W> implements Iterable<W>, Serializable {
private List<SkipWrapper<W>> skips = new ArrayList<>();
private List<Exception> errors = new ArrayList<>();
private final List<Exception> errors = new ArrayList<>();
private Object userData;
@@ -50,10 +50,12 @@ public class Chunk<W> implements Iterable<W>, Serializable {
private boolean busy;
@SafeVarargs
public Chunk(W... items) {
this(Arrays.stream(items).toList());
this(Arrays.asList(items));
}
@SafeVarargs
public static <W> Chunk<W> of(W... items) {
return new Chunk<>(items);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2022 the original author or authors.
* Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,6 +63,7 @@ public class CompositeItemWriter<T> implements ItemStreamWriter<T>, Initializing
* Convenience constructor for setting the delegates.
* @param delegates the array of delegates to use.
*/
@SafeVarargs
public CompositeItemWriter(ItemWriter<? super T>... delegates) {
this(Arrays.asList(delegates));
}