Skip to content

Conflicting info in @AfterChunk/@BeforeChunk annotation javadoc to current implementation #4961

@makigumo

Description

@makigumo

Bug description
Javadocs for @AfterChunk/@BeforeChunk state Expected signature: void afterChunk(Chunk) or Expected signature: void beforeChunk(Chunk) respectively.

But actually doing so results in something like:

java.lang.IllegalArgumentException: The method [afterChunk] on target class [MyChunkListener] is incompatible with the signature [(ChunkContext)] expected for the annotation [AfterChunk]

Using a signature of e.g. void beforeChunk(ChunkContext) works.

Environment
Spring Batch 6.0.0-M2 used from Spring Boot 4.0.0-M2

Steps to reproduce
Sample Listener to reproduce issue.

public class MyChunkListener<I, O> {

    @BeforeChunk
    public void beforeChunk(final Chunk<I> chunk) {
    }

    @AfterChunk
    public void afterChunk(final Chunk<O> chunk) {
    }
}

Expected behavior
Documentation should match implementation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions