Skip to content

Commit 21dce27

Browse files
committed
Remove Nullable from AbstractLeaderEvent
1 parent f667e03 commit 21dce27

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

spring-integration-core/src/main/java/org/springframework/integration/leader/event/AbstractLeaderEvent.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.integration.leader.event;
1818

19-
import org.jspecify.annotations.Nullable;
20-
2119
import org.springframework.context.ApplicationEvent;
2220
import org.springframework.integration.leader.Context;
2321

@@ -32,9 +30,9 @@
3230
@SuppressWarnings("serial")
3331
public abstract class AbstractLeaderEvent extends ApplicationEvent {
3432

35-
private final @Nullable Context context;
33+
private final Context context;
3634

37-
private final @Nullable String role;
35+
private final String role;
3836

3937
/**
4038
* Create a new ApplicationEvent.
@@ -43,7 +41,7 @@ public abstract class AbstractLeaderEvent extends ApplicationEvent {
4341
* @param context the context associated with this event
4442
* @param role the role of the leader
4543
*/
46-
public AbstractLeaderEvent(Object source, @Nullable Context context, @Nullable String role) {
44+
public AbstractLeaderEvent(Object source, Context context, String role) {
4745
super(source);
4846
this.context = context;
4947
this.role = role;
@@ -54,7 +52,7 @@ public AbstractLeaderEvent(Object source, @Nullable Context context, @Nullable S
5452
*
5553
* @return the context
5654
*/
57-
public @Nullable Context getContext() {
55+
public Context getContext() {
5856
return this.context;
5957
}
6058

@@ -63,7 +61,7 @@ public AbstractLeaderEvent(Object source, @Nullable Context context, @Nullable S
6361
*
6462
* @return the role
6563
*/
66-
public @Nullable String getRole() {
64+
public String getRole() {
6765
return this.role;
6866
}
6967

spring-integration-core/src/main/java/org/springframework/integration/support/DefaultMessageBuilderFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class DefaultMessageBuilderFactory implements MessageBuilderFactory {
4343
* and {@link org.springframework.messaging.MessageHeaders#TIMESTAMP}.
4444
* @since 4.3.2
4545
*/
46-
public void setReadOnlyHeaders(@Nullable String... readOnlyHeaders) {
46+
public void setReadOnlyHeaders(String @Nullable ... readOnlyHeaders) {
4747
this.readOnlyHeaders = readOnlyHeaders != null ? Arrays.copyOf(readOnlyHeaders, readOnlyHeaders.length) : null;
4848
}
4949

spring-integration-core/src/main/java/org/springframework/integration/support/SmartLifecycleRoleController.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
import org.apache.commons.logging.Log;
3333
import org.apache.commons.logging.LogFactory;
34-
import org.jspecify.annotations.Nullable;
3534

3635
import org.springframework.beans.BeansException;
3736
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
@@ -204,7 +203,7 @@ public void startLifecyclesInRole(String role) {
204203
* Stop all registered {@link SmartLifecycle}s in the role.
205204
* @param role the role.
206205
*/
207-
public void stopLifecyclesInRole(@Nullable String role) {
206+
public void stopLifecyclesInRole(String role) {
208207
if (!this.lazyLifecycles.isEmpty()) {
209208
addLazyLifecycles();
210209
}
@@ -318,7 +317,6 @@ private void doAddLifecyclesToRole(String role, List<String> lifecycleBeanNames)
318317
@Override
319318
public void onApplicationEvent(AbstractLeaderEvent event) {
320319
if (event instanceof OnGrantedEvent) {
321-
Assert.state(event.getRole() != null, "A role is required");
322320
startLifecyclesInRole(event.getRole());
323321
}
324322
else if (event instanceof OnRevokedEvent) {

0 commit comments

Comments
 (0)