From 48925f0db4da8e9f2d69779f82a4e25adb3aa6dc Mon Sep 17 00:00:00 2001 From: ParadiseCHOI Date: Thu, 30 Sep 2021 07:52:36 +0900 Subject: [PATCH] Remove unnecessary expressions in AsyncItemWriter Issue #4009 --- .../batch/integration/async/AsyncItemWriter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemWriter.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemWriter.java index 4b3336afc6..1d69d4d18a 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemWriter.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemWriter.java @@ -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. @@ -67,13 +67,13 @@ public void write(Chunk> items) throws Exception { T item = future.get(); if (item != null) { - list.add(future.get()); + list.add(item); } } catch (ExecutionException e) { Throwable cause = e.getCause(); - if (cause != null && cause instanceof Exception) { + if (cause instanceof Exception) { logger.debug("An exception was thrown while processing an item", e); throw (Exception) cause;