Skip to content

Make removeMessageListener listener parameter non-nullable#3237

Closed
Kiminni wants to merge 1 commit intospring-projects:mainfrom
Kiminni:refactor/remove-nullable-annotation
Closed

Make removeMessageListener listener parameter non-nullable#3237
Kiminni wants to merge 1 commit intospring-projects:mainfrom
Kiminni:refactor/remove-nullable-annotation

Conversation

@Kiminni
Copy link
Contributor

@Kiminni Kiminni commented Oct 16, 2025

Overview

Changed the listener parameter of removeMessageListener methods in RedisMessageListenerContainer to be non-nullable. (issue #3016)

Changes

  • Removed @Nullable annotation from listener parameter in removeMessageListener(MessageListener, Collection<Topic>) method
  • Removed @Nullable annotation from listener parameter in removeMessageListener(MessageListener, Topic) method
  • Removed @Nullable annotation from listener parameter in internal removeListener method
  • Added Assert.notNull(listener, "MessageListener must not be null") validation in removeListener method
  • Simplified listener null check logic (removed unnecessary if (listener != null && ...) condition)

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Signed-off-by: Kiminni <imk0980@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 16, 2025
@onobc onobc self-requested a review February 3, 2026 06:03
@onobc onobc closed this in fd245a8 Feb 3, 2026
onobc added a commit that referenced this pull request Feb 3, 2026
- Add integration test to verify all removeMessageListener variants
- Add unit tests for negative tests on removeMesssageListener invalid inputs
- Clarify javadocs

Original Pull Request #3237
@onobc onobc removed the status: waiting-for-triage An issue we've not yet triaged label Feb 4, 2026
@onobc onobc added this to the 4.1 M1 (2026.0.0) milestone Feb 4, 2026
@mp911de mp911de added the type: task A general task label Feb 11, 2026
tishun pushed a commit to tishun/spring-data-redis that referenced this pull request Feb 18, 2026
Closes spring-projects#3237

Signed-off-by: Kiminni <imk0980@gmail.com>

Signed-off-by: Tihomir Mateev <tihomir.mateev@redis.com>
tishun pushed a commit to tishun/spring-data-redis that referenced this pull request Feb 18, 2026
- Add integration test to verify all removeMessageListener variants
- Add unit tests for negative tests on removeMesssageListener invalid inputs
- Clarify javadocs

Original Pull Request spring-projects#3237

Signed-off-by: Tihomir Mateev <tihomir.mateev@redis.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments