Skip to content

Commit 1b173a4

Browse files
committed
Fix Sonar issue.
1 parent 0695d05 commit 1b173a4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/retry/RepublishMessageRecoverer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,13 @@ private String[] processStackTrace(Throwable cause, String exceptionMessage) {
203203
this.maxStackTraceLength = maxStackTraceLen;
204204
}
205205
}
206+
return truncateIfNecessary(cause, exceptionMessage, stackTraceAsString);
207+
}
208+
209+
private String[] truncateIfNecessary(Throwable cause, String exception, String stackTrace) {
206210
boolean truncated = false;
211+
String stackTraceAsString = stackTrace;
212+
String exceptionMessage = exception;
207213
String truncatedExceptionMessage = exceptionMessage.length() <= MAX_EXCEPTION_MESSAGE_SIZE_IN_TRACE
208214
? exceptionMessage
209215
: (exceptionMessage.substring(0, MAX_EXCEPTION_MESSAGE_SIZE_IN_TRACE) + "...");

0 commit comments

Comments
 (0)