From 9b2944a9a261eb41bd841f080b5d9aeeec18589c Mon Sep 17 00:00:00 2001 From: lamber-ken Date: Wed, 15 Jan 2020 11:27:53 +0800 Subject: [PATCH] [MINOR] Refactor unnecessary boxing inside TypedProperties code (#1227) --- .../apache/hudi/common/util/TypedProperties.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hudi-common/src/main/java/org/apache/hudi/common/util/TypedProperties.java b/hudi-common/src/main/java/org/apache/hudi/common/util/TypedProperties.java index ed21f341a..784c8b9df 100644 --- a/hudi-common/src/main/java/org/apache/hudi/common/util/TypedProperties.java +++ b/hudi-common/src/main/java/org/apache/hudi/common/util/TypedProperties.java @@ -61,37 +61,37 @@ public class TypedProperties extends Properties implements Serializable { public int getInteger(String property) { checkKey(property); - return Integer.valueOf(getProperty(property)); + return Integer.parseInt(getProperty(property)); } public int getInteger(String property, int defaultValue) { - return containsKey(property) ? Integer.valueOf(getProperty(property)) : defaultValue; + return containsKey(property) ? Integer.parseInt(getProperty(property)) : defaultValue; } public long getLong(String property) { checkKey(property); - return Long.valueOf(getProperty(property)); + return Long.parseLong(getProperty(property)); } public long getLong(String property, long defaultValue) { - return containsKey(property) ? Long.valueOf(getProperty(property)) : defaultValue; + return containsKey(property) ? Long.parseLong(getProperty(property)) : defaultValue; } public boolean getBoolean(String property) { checkKey(property); - return Boolean.valueOf(getProperty(property)); + return Boolean.parseBoolean(getProperty(property)); } public boolean getBoolean(String property, boolean defaultValue) { - return containsKey(property) ? Boolean.valueOf(getProperty(property)) : defaultValue; + return containsKey(property) ? Boolean.parseBoolean(getProperty(property)) : defaultValue; } public double getDouble(String property) { checkKey(property); - return Double.valueOf(getProperty(property)); + return Double.parseDouble(getProperty(property)); } public double getDouble(String property, double defaultValue) { - return containsKey(property) ? Double.valueOf(getProperty(property)) : defaultValue; + return containsKey(property) ? Double.parseDouble(getProperty(property)) : defaultValue; } }