Skip to content

A constructor that fails to validate null value properly #3917

@ghgh415263

Description

@ghgh415263

In what version(s) of Spring for Apache Kafka are you seeing this issue?

current main

Describe the bug

CommonMixedErrorHandler constructor check recordErrorHandler twice

public CommonMixedErrorHandler(CommonErrorHandler recordErrorHandler, CommonErrorHandler batchErrorHandler) {
		Assert.notNull(recordErrorHandler, "'recordErrorHandler' cannot be null");
		Assert.notNull(recordErrorHandler, "'batchErrorHandler' cannot be null");
		this.recordErrorHandler = recordErrorHandler;
		this.batchErrorHandler = batchErrorHandler;
	}

To Reproduce

Steps to reproduce the behavior.

Expected behavior

i think second assert have to check batchErrorHandler

public CommonMixedErrorHandler(CommonErrorHandler recordErrorHandler, CommonErrorHandler batchErrorHandler) {
		Assert.notNull(recordErrorHandler, "'recordErrorHandler' cannot be null");
		Assert.notNull(batchErrorHandler, "'batchErrorHandler' cannot be null");
		this.recordErrorHandler = recordErrorHandler;
		this.batchErrorHandler = batchErrorHandler;
	}

thanks for reading

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions