Description
Provide a helper method that provides a 1-liner to put an identifier only if it is not currently set. This removes an if-check in all classes that share a design approach of assessing a uniqueId, such as request id, etc.
if(!ThreadContext.containsKey("uniqueId")) { ThreadContext.put("uniqueId", generateUniqueId()); }
Proposed:
ThreadContext.putIfNull("uniqueId", generateUniqueId());
Attachments
Issue Links
- links to