From 37bff63c0ffa506cc8b13bee9fd3ae5b9f3075c9 Mon Sep 17 00:00:00 2001 From: Wang Yu Date: Wed, 26 Oct 2022 06:40:31 +0800 Subject: [PATCH] Refactor CallerContext's constructor to eliminate duplicate code (#5070) Reviewed-by: Tao Li Reviewed-by: Zander Xu --- .../main/java/org/apache/hadoop/ipc/CallerContext.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallerContext.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallerContext.java index 98d7e82c70..b6e6f0c57a 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallerContext.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallerContext.java @@ -140,12 +140,8 @@ public Builder(String context) { } public Builder(String context, Configuration conf) { - if (isValid(context)) { - sb.append(context); - } - fieldSeparator = conf.get(HADOOP_CALLER_CONTEXT_SEPARATOR_KEY, - HADOOP_CALLER_CONTEXT_SEPARATOR_DEFAULT); - checkFieldSeparator(fieldSeparator); + this(context, conf.get(HADOOP_CALLER_CONTEXT_SEPARATOR_KEY, + HADOOP_CALLER_CONTEXT_SEPARATOR_DEFAULT)); } public Builder(String context, String separator) {