diff options
author | Vitaly Takmazov | 2016-12-20 14:28:00 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-20 14:28:00 +0300 |
commit | 3859c9616d0a7a04e68427d173b863161b818140 (patch) | |
tree | cba4d1aea88b7ce0d94cbc30fc05f765c9faaa15 /juick-core/src | |
parent | 8b02f969d3a09e39557474eb90ec821d550e3b1b (diff) |
StringUtils.EMPTY
Diffstat (limited to 'juick-core/src')
-rw-r--r-- | juick-core/src/main/java/com/juick/package-info.java | 4 | ||||
-rw-r--r-- | juick-core/src/main/java/com/juick/util/MessageUtils.java | 6 |
2 files changed, 7 insertions, 3 deletions
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<a href=\"" + url + "\" rel=\"nofollow\">" + url + "</a>$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<a href=\"" + url + "\" rel=\"nofollow\">$4</a>$5"); } m.appendTail(sb); |