Skip to content

Commit 1b892fc

Browse files
committed
Fix Sonar smells in the FtpSession
1 parent ca8377d commit 1b892fc

File tree

1 file changed

+5
-9
lines changed
  • spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session

1 file changed

+5
-9
lines changed

spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,8 @@ public void append(InputStream inputStream, String path) throws IOException {
151151
@Override
152152
public void close() {
153153
try {
154-
if (this.readingRaw.get()) {
155-
if (!finalizeRaw()) {
156-
if (LOGGER.isWarnEnabled()) {
157-
LOGGER.warn("Finalize on readRaw() returned false for " + this);
158-
}
159-
}
154+
if (this.readingRaw.get() && !finalizeRaw() && LOGGER.isWarnEnabled()) {
155+
LOGGER.warn("Finalize on readRaw() returned false for " + this);
160156
}
161157
this.client.disconnect();
162158
}
@@ -181,11 +177,11 @@ public void rename(String pathFrom, String pathTo) throws IOException {
181177
this.client.deleteFile(pathTo);
182178
boolean completed = this.client.rename(pathFrom, pathTo);
183179
if (!completed) {
184-
throw new IOException("Failed to rename '" + pathFrom +
185-
"' to " + pathTo + SERVER_REPLIED_WITH + this.client.getReplyString());
180+
throw new IOException("Failed to rename " + pathFrom +
181+
" to " + pathTo + SERVER_REPLIED_WITH + this.client.getReplyString());
186182
}
187183
if (LOGGER.isInfoEnabled()) {
188-
LOGGER.info("File has been successfully renamed from: " + pathFrom + " to " + pathTo);
184+
LOGGER.info("File has been successfully renamed from " + pathFrom + " to " + pathTo);
189185
}
190186
}
191187

0 commit comments

Comments
 (0)