Skip to content

Conversation

@artembilan
Copy link
Member

Related to: #10083

  • Add @NullMarked to every package
  • Assume BeanFactory and ApplicationEventPublisher are not null in TCP/IP components. Therefore, fix all the failing tests to ensure those properties and their propagation via afterPropertiesSet()

Copy link
Contributor

@cppwfs cppwfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usual annoying questions ;-)

@artembilan artembilan requested a review from cppwfs August 14, 2025 20:28
Related to: spring-projects#10083

* Add `@NullMarked` to every package
* Assume `BeanFactory` and `ApplicationEventPublisher` are not null in TCP/IP components.
Therefore, fix all the failing tests to ensure those properties and their propagation via `afterPropertiesSet()`
* Remove `SyslogdTests.java` which are not tests.
…is set in the `onInit()`

* Improve `UnicastSendingMessageHandler.restartAckThread()` to reflect the proper state of the `UnicastSendingMessageHandler`
Copy link
Contributor

@cppwfs cppwfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

Will merge after successful build!

@cppwfs cppwfs merged commit 4900ac7 into spring-projects:main Aug 14, 2025
3 checks passed
if (connection == null) {
publishNoConnectionEvent(message, connectionId);
logger.error(() -> "Connection not found when processing reply " + reply + " for " + message);
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: This method always returns false, but I didn't look into detail. If this is desired, I wondered if for the sake of readability, this one should be changed to void.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, @mrpiggi !

The contract is this:

@FunctionalInterface
public interface TcpListener {

	/**
	 * Called by a TCPConnection when a new message arrives.
	 * @param message The message.
	 * @return true if the message was intercepted
	 */
	boolean onMessage(Message<?> message);

}

So, we need to revise and return true at some point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: #10314

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: #10315

catch (Exception ex) {
logger.error(ex, "Exception accepting new connection(s)");
private void keyAcceptable(final Selector selector, @Nullable ServerSocketChannel server, final long now) {
if (server != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just nitpicking: I tend to prefer if (server == null) { return; } as this reduces the level of indentation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we had something like that before, but SonarQube has complained about unnecessary return; in the method. 🤷
The if (server != null) { also makes less code lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants