Skip to content

Add SafeVarargs annotations #4335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,20 @@ 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;

private boolean end;

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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -63,6 +63,7 @@ public CompositeItemWriter(List<ItemWriter<? super T>> delegates) {
* 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));
}
Expand Down