Removed return value from set method

This commit is contained in:
Jim Martens 2020-07-11 22:09:58 +02:00
parent 9a88ef34b2
commit 3f2e2aaef3
1 changed files with 1 additions and 3 deletions

View File

@ -39,14 +39,12 @@ public class TraceIdInterceptor extends HandlerInterceptorAdapter
* A failsafe method to set a TraceId to the MDC. * A failsafe method to set a TraceId to the MDC.
* *
* @param traceId should be a traceId, if it is null or empty a new one will be created. * @param traceId should be a traceId, if it is null or empty a new one will be created.
* @return the traceId param, or a new one, if it was empty
*/ */
public String setOrCreateTraceId(String traceId) { public void setOrCreateTraceId(String traceId) {
if (traceId == null || traceId.trim().isEmpty()) { if (traceId == null || traceId.trim().isEmpty()) {
traceId = UUID.randomUUID().toString(); traceId = UUID.randomUUID().toString();
} }
MDC.put(LOGGER_TRACE_ID, traceId); MDC.put(LOGGER_TRACE_ID, traceId);
return traceId;
} }
/** /**