Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.Map.Entry;
import java.util.Set;

import org.jspecify.annotations.Nullable;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.integration.support.DefaultMessageBuilderFactory;
Expand Down Expand Up @@ -53,7 +55,7 @@ public class DefaultMessageConverter implements MessageConverter, BeanFactoryAwa

private volatile boolean asMap = true;

private BeanFactory beanFactory;
private @Nullable BeanFactory beanFactory;

/**
* Set false will leave the payload as the original complete syslog.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.util.List;
import java.util.Map;

import org.jspecify.annotations.Nullable;

import org.springframework.integration.JavaUtils;
import org.springframework.util.Assert;

Expand Down Expand Up @@ -131,6 +133,7 @@ public RFC5424SyslogParser(boolean retainOriginal) {
* @param r the reader.
* @return the timestamp.
*/
@Nullable
protected Object getTimestamp(Reader r) {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks, but how have you missed to fix this one as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad, I missed it.


int c = r.getc();
Expand All @@ -152,6 +155,7 @@ protected Object getTimestamp(Reader r) {
return dateBuilder.toString();
}

@Nullable
private Object getStructuredData(Reader r) {
Copy link
Member

Choose a reason for hiding this comment

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

Please, put @Nullable on the return type.
This is a contract exactly of the return type, not a method.

if (r.is(NILVALUE)) {
r.getc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.springframework.integration.syslog.config;

import org.jspecify.annotations.Nullable;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.context.ApplicationEventPublisher;
Expand Down Expand Up @@ -47,31 +49,31 @@ public enum Protocol {
udp, tcp
}

private volatile SyslogReceivingChannelAdapterSupport syslogAdapter;
private volatile @Nullable SyslogReceivingChannelAdapterSupport syslogAdapter;

private final Protocol protocol;

private volatile MessageChannel outputChannel;
private volatile @Nullable MessageChannel outputChannel;

private volatile boolean autoStartup = true;

private volatile MessageChannel errorChannel;
private volatile @Nullable MessageChannel errorChannel;

private volatile int phase;

private volatile Long sendTimeout;
private volatile @Nullable Long sendTimeout;

private volatile AbstractServerConnectionFactory connectionFactory;
private volatile @Nullable AbstractServerConnectionFactory connectionFactory;

private volatile UnicastReceivingChannelAdapter udpAdapter;
private volatile @Nullable UnicastReceivingChannelAdapter udpAdapter;

private volatile Integer port;
private volatile @Nullable Integer port;

private volatile MessageConverter converter;
private volatile @Nullable MessageConverter converter;

private volatile String beanName;
private volatile @Nullable String beanName;

private volatile ApplicationEventPublisher applicationEventPublisher;
private volatile @Nullable ApplicationEventPublisher applicationEventPublisher;

/**
* Instantiates a factory bean that creates a {@link UdpSyslogReceivingChannelAdapter}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* Provides classes for configuration - parsers, namespace handlers, factory beans.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.integration.syslog.config;
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.springframework.integration.syslog.inbound;

import org.jspecify.annotations.Nullable;

import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory;
Expand All @@ -36,9 +38,10 @@
public class TcpSyslogReceivingChannelAdapter extends SyslogReceivingChannelAdapterSupport
implements TcpListener, ApplicationEventPublisherAware {

@SuppressWarnings("NullAway.Init")
private volatile AbstractServerConnectionFactory connectionFactory;

private volatile ApplicationEventPublisher applicationEventPublisher;
private volatile @Nullable ApplicationEventPublisher applicationEventPublisher;
Copy link
Member

Choose a reason for hiding this comment

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

This one also @SuppressWarnings("NullAway.Init").
Because it is initialized from the Application context callbacks.


/**
* @param connectionFactory The connection factory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*/
public class UdpSyslogReceivingChannelAdapter extends SyslogReceivingChannelAdapterSupport {

@SuppressWarnings("NullAway.Init")
private volatile UnicastReceivingChannelAdapter udpAdapter;

private volatile boolean udpAdapterSet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* Provides classes for inbound endpoints.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.integration.syslog.inbound;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* Base package for Syslog Support.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.integration.syslog;