diff --git a/common-tara/pom.xml b/common-tara/pom.xml index 9908617..5b844e9 100644 --- a/common-tara/pom.xml +++ b/common-tara/pom.xml @@ -9,12 +9,12 @@ com.sondertara tara - 0.0.3.303 + 0.0.3.304 ../pom.xml com.sondertara common-tara - 0.0.3.303 + 0.0.3.304 common-tara common utils. diff --git a/common-tara/src/main/java/com/sondertara/common/util/HttpClientUtil.java b/common-tara/src/main/java/com/sondertara/common/util/HttpClientUtil.java index ace8435..f92d2dc 100644 --- a/common-tara/src/main/java/com/sondertara/common/util/HttpClientUtil.java +++ b/common-tara/src/main/java/com/sondertara/common/util/HttpClientUtil.java @@ -92,8 +92,6 @@ public class HttpClientUtil { requestConfig = RequestConfig.custom().setConnectionRequestTimeout( connectionRequestTimeout).setSocketTimeout(socketTimeout).setConnectTimeout( connectTimeout).build(); - - //System.out.println("初始化HttpClientTest~~~结束"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (KeyStoreException e) { diff --git a/common-tara/src/main/java/com/sondertara/common/util/HttpUtil.java b/common-tara/src/main/java/com/sondertara/common/util/HttpUtil.java index 7a482c4..1333305 100644 --- a/common-tara/src/main/java/com/sondertara/common/util/HttpUtil.java +++ b/common-tara/src/main/java/com/sondertara/common/util/HttpUtil.java @@ -164,7 +164,7 @@ public static String sendPostJson(String url, Map param) throws public static String sendPostJson(String url, String jsonParam) throws TaraException { logger.info("post url ==>[{}]", url); - logger.info("post param ==>[{}]", url); + logger.info("post param ==>[{}]", jsonParam); OutputStream out = null; InputStream in = null; HttpURLConnection conn = null; diff --git a/common-tara/src/main/java/com/sondertara/common/util/StringUtil.java b/common-tara/src/main/java/com/sondertara/common/util/StringUtil.java index 18c9c60..a797d21 100644 --- a/common-tara/src/main/java/com/sondertara/common/util/StringUtil.java +++ b/common-tara/src/main/java/com/sondertara/common/util/StringUtil.java @@ -20,6 +20,8 @@ public class StringUtil { private static final Logger logger = LoggerFactory.getLogger(StringUtil.class); + + private static final String NULL_STR="null"; private static final Pattern PHONE_PATTERN = Pattern.compile("^[1][3,4,5,6,7,8,9][0-9]{9}$"); @@ -39,7 +41,7 @@ public class StringUtil { * @return is blank */ public static boolean isBlank(Object str) { - return str == null || "".equals(str.toString().trim()) || "null".equalsIgnoreCase(str.toString().trim()); + return str == null || "".equals(str.toString().trim()) || NULL_STR.equalsIgnoreCase(str.toString().trim()); } /** @@ -72,7 +74,7 @@ public static String convertNullToZero(Object str) { * @return str maybe null */ public static String convertNullToNull(Object str) { - if (str == null || "".equals(str.toString().trim()) || "null".equalsIgnoreCase(str.toString().trim())) { + if (str == null || "".equals(str.toString().trim()) || NULL_STR.equalsIgnoreCase(str.toString().trim())) { return null; } return str.toString(); @@ -88,7 +90,7 @@ public static String convertNullToNull(Object str) { * @return number */ public static String convertToNumber(Object str) { - if (str == null || "".equals(str.toString().trim()) || "null".equalsIgnoreCase(str.toString().trim())) { + if (str == null || "".equals(str.toString().trim()) || NULL_STR.equalsIgnoreCase(str.toString().trim())) { return null; } String s = org.apache.commons.lang3.StringUtils.deleteWhitespace(str.toString()); @@ -105,11 +107,11 @@ public static String convertToNumber(Object str) { * 如果字符串为空或者null,会返回默认值 *

* - * @param str - * @return + * @param str str + * @return number */ public static String convertToNumber(Object str, Number defaultValue) { - if (str == null || "".equals(str.toString().trim()) || "null".equalsIgnoreCase(str.toString().trim())) { + if (str == null || "".equals(str.toString().trim()) || NULL_STR.equalsIgnoreCase(str.toString().trim())) { return String.valueOf(defaultValue); } String s = StringUtils.deleteWhitespace(str.toString()); @@ -170,8 +172,8 @@ public static String convertEncode(String strIn, String encoding, String targetE /** * 截取str中以startStr开头,endStr结束的字符串 * - * @param str - * @param startStr + * @param str str + * @param startStr str * @param endStr * @return 返回以以startStr开头,以endStr结束的字符串,如果startStr不存在,则有str为起始;如果endStr不存在,则以字符串结束为终结 */ @@ -989,9 +991,9 @@ public static String getExtension(String uri) { return ""; } if (uri.contains(".")) { - String[] strs = uri.split("\\."); - if (strs.length > 1) { - String extension = strs[1]; + String[] strings = uri.split("\\."); + if (strings.length > 1) { + String extension = strings[1]; if (isNotEmpty(extension)) { return extension; } diff --git a/excel-tara/pom.xml b/excel-tara/pom.xml index 8c4ae17..f990750 100644 --- a/excel-tara/pom.xml +++ b/excel-tara/pom.xml @@ -7,12 +7,12 @@ com.sondertara tara - 0.0.3.303 + 0.0.3.304 ../pom.xml com.sondertara excel-tara - 0.0.3.303 + 0.0.3.304 excel-tara High performance Excel kit. @@ -99,7 +99,7 @@ com.sondertara common-tara - 0.0.3.303 + 0.0.3.304 diff --git a/notify-tara/pom.xml b/notify-tara/pom.xml index f217971..6ef4e10 100644 --- a/notify-tara/pom.xml +++ b/notify-tara/pom.xml @@ -7,12 +7,12 @@ com.sondertara tara - 0.0.3.303 + 0.0.3.304 ../pom.xml com.sondertara notify-tara - 0.0.3.303 + 0.0.3.304 notify-tara notify kit. @@ -52,7 +52,7 @@ com.sondertara common-tara - 0.0.3.303 + 0.0.3.304 diff --git a/pom.xml b/pom.xml index 32f36ac..86efb24 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.sondertara tara - 0.0.3.303 + 0.0.3.304 pom tara tara is a awesome java advance Kit.