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/package-info.java | 4 +++- juick-core/src/main/java/com/juick/util/MessageUtils.java | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'juick-core/src/main/java') diff --git a/juick-core/src/main/java/com/juick/package-info.java b/juick-core/src/main/java/com/juick/package-info.java index 1ebddc60..63a50982 100644 --- a/juick-core/src/main/java/com/juick/package-info.java +++ b/juick-core/src/main/java/com/juick/package-info.java @@ -5,12 +5,14 @@ namespace="http://juick.com/message", elementFormDefault = XmlNsForm.QUALIFIED, xmlns={ - @XmlNs(prefix="", namespaceURI="http://juick.com/message"), + @XmlNs(prefix= StringUtils.EMPTY, namespaceURI="http://juick.com/message"), @XmlNs(prefix="user", namespaceURI="http://juick.com/user") } ) package com.juick; +import org.apache.commons.lang3.StringUtils; + import javax.xml.bind.annotation.XmlNs; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlSchema; \ No newline at end of file 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