aboutsummaryrefslogtreecommitdiff
path: root/juick-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'juick-core/src')
-rw-r--r--juick-core/src/main/java/com/juick/package-info.java4
-rw-r--r--juick-core/src/main/java/com/juick/util/MessageUtils.java6
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);