diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/avro/AvroItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/avro/AvroItemReader.java index aca9f4aa1..86ec4c51b 100755 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/avro/AvroItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/avro/AvroItemReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 the original author or authors. + * Copyright 2019-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. @@ -35,6 +35,7 @@ import org.springframework.batch.item.support.AbstractItemCountingItemStreamItem import org.springframework.core.io.Resource; import org.springframework.lang.Nullable; import org.springframework.util.Assert; +import org.springframework.util.ClassUtils; /** * An {@link ItemReader} that deserializes data from a {@link Resource} containing @@ -42,6 +43,7 @@ import org.springframework.util.Assert; * * @author David Turanski * @author Mahmoud Ben Hassine + * @author Song JaeGeun * @since 4.2 */ public class AvroItemReader extends AbstractItemCountingItemStreamItemReader { @@ -61,6 +63,8 @@ public class AvroItemReader extends AbstractItemCountingItemStreamItemReader< * @param clazz the data type to be deserialized. */ public AvroItemReader(Resource resource, Class clazz) { + setName(ClassUtils.getShortName(AvroItemReader.class)); + Assert.notNull(resource, "'resource' is required."); Assert.notNull(clazz, "'class' is required."); @@ -78,6 +82,8 @@ public class AvroItemReader extends AbstractItemCountingItemStreamItemReader< * @param schema the {@link Resource} containing the Avro schema. */ public AvroItemReader(Resource data, Resource schema) { + setName(ClassUtils.getShortName(AvroItemReader.class)); + Assert.notNull(data, "'data' is required."); Assert.state(data.exists(), "'data' " + data.getFilename() + " does not exist."); Assert.notNull(schema, "'schema' is required");