Skip to content

Declare messageSelector parameters in JmsOperations as @Nullable #35151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

mjd507
Copy link
Contributor

@mjd507 mjd507 commented Jul 3, 2025

No description provided.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 3, 2025
@mjd507
Copy link
Contributor Author

mjd507 commented Jul 3, 2025

@artembilan I saw in spring-integration-jms, we have below code (in class JmsDestinationPollingSource)

	private jakarta.jms.Message doReceiveJmsMessage() {
		jakarta.jms.Message jmsMessage;
		if (this.destination != null) {
			jmsMessage = this.jmsTemplate.receiveSelected(this.destination, this.messageSelector);
		}
		else if (this.destinationName != null) {
			jmsMessage = this.jmsTemplate.receiveSelected(this.destinationName, this.messageSelector);
		}
		else {
			jmsMessage = this.jmsTemplate.receiveSelected(this.messageSelector);
		}
		return jmsMessage;
	}

first two receiveSelected method are Ok, the parameter messageSelector are marked as Nullable (marked in child class, super class not marked, but this looks fine, we are calling from child only).
however, the third method receiveSelected(this.messageSelector); parameter is not marked as Nullable,

I don't see any reason it can be non-null. so I made these small changes.

@artembilan
Copy link
Member

Thank you @mjd507 !
I cannot merge this PR, so we would need to wait for the feedback from Spring Framework team.

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jul 3, 2025
@sbrannen sbrannen self-assigned this Jul 3, 2025
@sbrannen sbrannen added this to the 6.2.9 milestone Jul 3, 2025
@sbrannen sbrannen changed the title Apply @Nullable on parameter messageSelector in Jms module Declare messageSelector parameters in JmsOperations as @Nullable Jul 3, 2025
@sbrannen
Copy link
Member

sbrannen commented Jul 3, 2025

Hi @mjd507,

Congratulations on submitting your first PR for the Spring Framework! 👍

I noticed you actually missed a few additional places where messageSelector should be @Nullable; however, I already merged your work locally on 6.2.x and started addressing the additional methods.

So, there's no need to modify this PR.

Cheers,

Sam

@mjd507
Copy link
Contributor Author

mjd507 commented Jul 3, 2025

thank you @sbrannen, close this.

May I know when it can be merged into 'main' branch ?

@mjd507 mjd507 closed this Jul 3, 2025
@sbrannen sbrannen reopened this Jul 3, 2025
sbrannen pushed a commit that referenced this pull request Jul 4, 2025
@sbrannen sbrannen closed this in 133f330 Jul 4, 2025
@sbrannen
Copy link
Member

sbrannen commented Jul 4, 2025

This has been merged into 6.2.x and main in b6675ed and revised in 133f330.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants