Skip to content

Commit 61cce7a

Browse files
Adjust @nullable annotations
Signed-off-by: Tran Ngoc Nhan <[email protected]>
1 parent b92963d commit 61cce7a

File tree

11 files changed

+15
-21
lines changed

11 files changed

+15
-21
lines changed

spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ protected boolean shouldMarkSessionAsDirty(Exception ex) {
511511
}
512512

513513
@Override
514-
public <T, C> T executeWithClient(ClientCallback<C, T> callback) {
514+
public <T, C> @Nullable T executeWithClient(ClientCallback<C, T> callback) {
515515
throw new UnsupportedOperationException("executeWithClient() is not supported by the generic template");
516516
}
517517

spring-integration-file/src/main/java/org/springframework/integration/file/remote/server/FileServerEvent.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.integration.file.remote.server;
1818

19+
import org.jspecify.annotations.Nullable;
20+
1921
import org.springframework.integration.events.IntegrationEvent;
2022

2123
/**
@@ -34,7 +36,7 @@ public FileServerEvent(Object source) {
3436
super(source);
3537
}
3638

37-
public FileServerEvent(Object source, Throwable cause) {
39+
public FileServerEvent(Object source, @Nullable Throwable cause) {
3840
super(source, cause);
3941
}
4042

spring-integration-sftp/src/main/java/org/springframework/integration/sftp/inbound/SftpInboundFileSynchronizer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.springframework.integration.sftp.inbound;
1818

1919
import org.apache.sshd.sftp.client.SftpClient;
20-
import org.jspecify.annotations.Nullable;
2120

2221
import org.springframework.integration.file.remote.session.SessionFactory;
2322
import org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer;
@@ -47,8 +46,8 @@ public SftpInboundFileSynchronizer(SessionFactory<SftpClient.DirEntry> sessionFa
4746
}
4847

4948
@Override
50-
protected boolean isFile(SftpClient.@Nullable DirEntry file) {
51-
return file != null && file.getAttributes().isRegularFile();
49+
protected boolean isFile(SftpClient.DirEntry file) {
50+
return file.getAttributes().isRegularFile();
5251
}
5352

5453
@Override

spring-integration-sftp/src/main/java/org/springframework/integration/sftp/inbound/SftpStreamingMessageSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ protected List<AbstractFileInfo<SftpClient.DirEntry>> asFileInfoList(Collection<
8080
}
8181

8282
@Override
83-
protected boolean isDirectory(SftpClient.@Nullable DirEntry file) {
84-
return file != null && file.getAttributes().isDirectory();
83+
protected boolean isDirectory(SftpClient.DirEntry file) {
84+
return file.getAttributes().isDirectory();
8585
}
8686

8787
}

spring-integration-sftp/src/main/java/org/springframework/integration/sftp/server/ApacheMinaSftpEvent.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public ApacheMinaSftpEvent(Object source) {
3636
super(source);
3737
}
3838

39-
@SuppressWarnings("NullAway") // Overridden method does not define nullability
4039
public ApacheMinaSftpEvent(Object source, @Nullable Throwable cause) {
4140
super(source, cause);
4241
}

spring-integration-sftp/src/main/java/org/springframework/integration/sftp/server/DirectoryCreatedEvent.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
import java.nio.file.Path;
2020
import java.util.Map;
2121

22-
import org.jspecify.annotations.Nullable;
23-
2422
/**
2523
* An event emitted when a directory is created.
2624
*
@@ -43,7 +41,7 @@ public DirectoryCreatedEvent(Object source, Path path, Map<String, ?> attrs) {
4341
this.attrs = attrs;
4442
}
4543

46-
public @Nullable Path getPath() {
44+
public Path getPath() {
4745
return this.path;
4846
}
4947

spring-integration-sftp/src/main/java/org/springframework/integration/sftp/server/FileWrittenEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public String getRemoteHandle() {
4848
return this.remoteHandle;
4949
}
5050

51-
public @Nullable Path getFile() {
51+
public Path getFile() {
5252
return this.file;
5353
}
5454

spring-integration-sftp/src/main/java/org/springframework/integration/sftp/server/PathMovedEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ public PathMovedEvent(Object source, Path srcPath, Path dstPath, @Nullable Throw
4141
this.dstPath = dstPath;
4242
}
4343

44-
public @Nullable Path getSrcPath() {
44+
public Path getSrcPath() {
4545
return this.srcPath;
4646
}
4747

48-
public @Nullable Path getDstPath() {
48+
public Path getDstPath() {
4949
return this.dstPath;
5050
}
5151

spring-integration-sftp/src/main/java/org/springframework/integration/sftp/server/PathRemovedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public PathRemovedEvent(Object source, Path path, boolean isDirectory, @Nullable
4141
this.isDirectory = isDirectory;
4242
}
4343

44-
public @Nullable Path getPath() {
44+
public Path getPath() {
4545
return this.path;
4646
}
4747

spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpRemoteFileTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public SftpRemoteFileTemplate(SessionFactory<SftpClient.DirEntry> sessionFactory
5858
super(sessionFactory);
5959
}
6060

61-
@SuppressWarnings({"unchecked", "NullAway"}) // Overridden method does not define nullability
61+
@SuppressWarnings("unchecked")
6262
@Override
6363
public <T, C> @Nullable T executeWithClient(final ClientCallback<C, T> callback) {
6464
return doExecuteWithClient((ClientCallback<SftpClient, T>) callback);

0 commit comments

Comments
 (0)