Skip to content

Commit

Permalink
fix bug, about Arrays.asList(new boolean[1]) (alibaba#10129)
Browse files Browse the repository at this point in the history
  • Loading branch information
varyuan authored Mar 21, 2023
1 parent fe5002f commit d291f24
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public void onSnapshotSave(SnapshotWriter writer, Closure done) {
// components from implementing snapshots

final BiConsumer<Boolean, Throwable> callFinally = (result, t) -> {
boolean[] results = new boolean[wCtx.listFiles().size()];
Boolean[] results = new Boolean[wCtx.listFiles().size()];
int[] index = new int[] {0};
wCtx.listFiles().forEach((file, meta) -> {
try {
Expand All @@ -278,7 +278,7 @@ public void onSnapshotSave(SnapshotWriter writer, Closure done) {
}
});
final Status status = result
&& !Arrays.asList(results).stream().anyMatch(Boolean.FALSE::equals) ? Status.OK()
&& Arrays.stream(results).allMatch(Boolean.TRUE::equals) ? Status.OK()
: new Status(RaftError.EIO, "Fail to compress snapshot at %s, error is %s",
writer.getPath(), t == null ? "" : t.getMessage());
done.run(status);
Expand Down

0 comments on commit d291f24

Please sign in to comment.