From 3859c9616d0a7a04e68427d173b863161b818140 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 20 Dec 2016 14:28:00 +0300 Subject: StringUtils.EMPTY --- juick-core/src/main/java/com/juick/util/MessageUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'juick-core/src/main/java/com/juick/util') diff --git a/juick-core/src/main/java/com/juick/util/MessageUtils.java b/juick-core/src/main/java/com/juick/util/MessageUtils.java index 96d650a8..0027716b 100644 --- a/juick-core/src/main/java/com/juick/util/MessageUtils.java +++ b/juick-core/src/main/java/com/juick/util/MessageUtils.java @@ -1,5 +1,7 @@ package com.juick.util; +import org.apache.commons.lang3.StringUtils; + import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -41,7 +43,7 @@ public class MessageUtils { Matcher m = regexLinks2.matcher(msg); StringBuffer sb = new StringBuffer(); while (m.find()) { - String url = m.group(3).replace(" ", "%20").replaceAll("\\s+", ""); + String url = m.group(3).replace(" ", "%20").replaceAll("\\s+", StringUtils.EMPTY); m.appendReplacement(sb, "$1$2" + url + "$5"); } m.appendTail(sb); @@ -105,7 +107,7 @@ public class MessageUtils { Matcher m = regexLinks2.matcher(msg); StringBuffer sb = new StringBuffer(); while (m.find()) { - String url = m.group(3).replace(" ", "%20").replaceAll("\\s+", ""); + String url = m.group(3).replace(" ", "%20").replaceAll("\\s+", StringUtils.EMPTY); m.appendReplacement(sb, "$1$2$4$5"); } m.appendTail(sb); -- cgit v1.2.3