changed variables

This commit is contained in:
MaNa 2019-06-26 10:40:04 +03:00
parent 7867290ab1
commit 4a96f2344d
3 changed files with 8 additions and 8 deletions

View File

@ -11,11 +11,11 @@ public class PatternMaskingLayout extends PatternLayout {
private Pattern multilinePattern;
private List<String> maskPatterns = new ArrayList<>();
private final String delimiter = "|";
private static final String DELIMITER = "|";
public void addMaskPattern(String maskPattern) {
maskPatterns.add(maskPattern);
multilinePattern = Pattern.compile(String.join(delimiter, maskPatterns), Pattern.MULTILINE);
multilinePattern = Pattern.compile(String.join(DELIMITER, maskPatterns), Pattern.MULTILINE);
}
@Override

View File

@ -18,11 +18,11 @@ public class PatternMaskingMessageJsonProvider extends AbstractFieldJsonProvider
private Pattern multilinePattern;
private List<String> maskPatterns = new ArrayList<>();
public static final String FIELD_MESSAGE = "message";
private final String delimiter = "|";
private static final String DELIMITER = "|";
public void addMaskPattern(String maskPattern) {
maskPatterns.add(maskPattern);
multilinePattern = Pattern.compile(String.join(delimiter, maskPatterns), Pattern.MULTILINE);
multilinePattern = Pattern.compile(String.join(DELIMITER, maskPatterns), Pattern.MULTILINE);
}
public PatternMaskingMessageJsonProvider() {

View File

@ -10,18 +10,18 @@ import java.util.Map;
public class MdcContext {
private static String keyAmount = "amount";
private static final String AMOUNT_KEY = "amount";
public static void mdcPutContext(RecurrentTokenContext context, String[] fieldsToPutInMdc) {
TransactionInfo transactionInfo = context.getTokenInfo().getTrx();
String amount = PaymentDataConverter.getFormattedAmount(context.getTokenInfo().getPaymentTool().getMinimalPaymentCost().getAmount()).toString();
MDC.put(keyAmount, amount);
MDC.put(AMOUNT_KEY, amount);
mdcPutContextTransactionInfo(transactionInfo, fieldsToPutInMdc);
}
public static void mdcPutContext(PaymentContext context, String[] fieldsToPutInMdc) {
TransactionInfo transactionInfo = context.getPaymentInfo().getPayment().getTrx();
String amount = PaymentDataConverter.getFormattedAmount(context.getPaymentInfo().getPayment().getCost().getAmount()).toString();
MDC.put(keyAmount, amount);
MDC.put(AMOUNT_KEY, amount);
mdcPutContextTransactionInfo(transactionInfo, fieldsToPutInMdc);
}
@ -35,7 +35,7 @@ public class MdcContext {
}
public static void mdcRemoveContext(String[] fieldsToPutInMdc) {
MDC.remove(keyAmount);
MDC.remove(AMOUNT_KEY);
for (String field : fieldsToPutInMdc) {
MDC.remove(field);
}