From bc025fbc60e7c0bef38dd0717e50a8b483393069 Mon Sep 17 00:00:00 2001 From: anushadasari Date: Wed, 20 Nov 2019 16:37:35 +0530 Subject: Merge this if statement with the enclosing one Merging collapsible if statements increases the code's readability. Issue-ID: OPTFRA-634 Change-Id: I22d3bd915605507db8fbfcae9d52a5b1b2de8f3f Signed-off-by: anushadasari --- .../src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cmso-service/src') diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java b/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java index 893d74c..804fe68 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java @@ -72,10 +72,8 @@ public class CmsoClientFilters implements ClientRequestFilter, ClientResponseFil String transactionId = (String) headers.getFirst(MessageHeaders.HeadersEnum.TransactionID.toString()); String mdcId = MDC.get(MDC_KEY_REQUEST_ID); - if (transactionId == null || "".equals(transactionId)) { - if (mdcId != null) { + if ((transactionId == null || "".equals(transactionId)) && (mdcId != null)) { headers.add(HeadersEnum.TransactionID.toString(), mdcId); - } } headers.add(HeadersEnum.FromAppID.toString(), appId); } -- cgit 1.2.3-korg