Skip to content

Commit 51ddca0

Browse files
committed
Refine Nullability for getBeanName() in the project
1 parent 32f8189 commit 51ddca0

File tree

5 files changed

+4
-21
lines changed

5 files changed

+4
-21
lines changed

spring-integration-core/src/main/java/org/springframework/integration/channel/FixedSubscriberChannel.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import org.apache.commons.logging.Log;
2020
import org.apache.commons.logging.LogFactory;
21+
import org.jspecify.annotations.Nullable;
2122

2223
import org.springframework.beans.factory.BeanNameAware;
2324
import org.springframework.integration.support.context.NamedComponent;
@@ -45,8 +46,7 @@ public final class FixedSubscriberChannel implements SubscribableChannel, BeanNa
4546

4647
private final MessageHandler handler;
4748

48-
@SuppressWarnings("NullAway.Init")
49-
private String beanName;
49+
private @Nullable String beanName;
5050

5151
public FixedSubscriberChannel() {
5252
throw new IllegalArgumentException("Cannot instantiate a " + this.getClass().getSimpleName()
@@ -62,11 +62,6 @@ public void setBeanName(String name) {
6262
this.beanName = name;
6363
}
6464

65-
@Override
66-
public String getBeanName() {
67-
return this.beanName;
68-
}
69-
7065
@Override
7166
public boolean send(Message<?> message) {
7267
return send(message, 0);

spring-integration-core/src/main/java/org/springframework/integration/channel/NullChannel.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@ public void setLoggingEnabled(boolean loggingEnabled) {
8686
}
8787

8888
@Override
89-
@Nullable
90-
public String getBeanName() {
91-
return this.beanName;
92-
}
93-
94-
@Override
95-
@Nullable
9689
public String getComponentName() {
9790
return this.beanName;
9891
}

spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractMessageSource.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ public void setBeanName(String name) {
9191
this.beanName = name;
9292
}
9393

94-
@Override
95-
public String getBeanName() {
96-
return this.beanName;
97-
}
98-
9994
@Override
10095
public void setManagedType(String managedType) {
10196
this.managedType = managedType;

spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ThreadAffinityClientConnectionFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void enableManualListenerRegistration() {
9191
}
9292

9393
@Override
94-
public @Nullable String getComponentName() {
94+
public String getComponentName() {
9595
return this.connectionFactory.getComponentName();
9696
}
9797

spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public void setShouldTrack(boolean shouldTrack) {
176176
}
177177

178178
@Override
179-
public @Nullable String getComponentName() {
179+
public String getComponentName() {
180180
return this.gatewayDelegate.getComponentName();
181181
}
182182

0 commit comments

Comments
 (0)