aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-20 14:28:00 +0300
committerGravatar Vitaly Takmazov2016-12-20 14:28:00 +0300
commit3859c9616d0a7a04e68427d173b863161b818140 (patch)
treecba4d1aea88b7ce0d94cbc30fc05f765c9faaa15 /juick-server/src/main/java/com/juick/server
parent8b02f969d3a09e39557474eb90ec821d550e3b1b (diff)
StringUtils.EMPTY
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r--juick-server/src/main/java/com/juick/server/CrosspostQueries.java5
-rw-r--r--juick-server/src/main/java/com/juick/server/MessagesQueries.java4
-rw-r--r--juick-server/src/main/java/com/juick/server/UserQueries.java4
-rw-r--r--juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java3
-rw-r--r--juick-server/src/main/java/com/juick/server/protocol/annotation/UserCommand.java6
-rw-r--r--juick-server/src/main/java/com/juick/server/util/HttpBadRequestException.java3
-rw-r--r--juick-server/src/main/java/com/juick/server/util/HttpForbiddenException.java3
-rw-r--r--juick-server/src/main/java/com/juick/server/util/HttpNotFoundException.java3
-rw-r--r--juick-server/src/main/java/com/juick/server/util/HttpUtils.java3
9 files changed, 21 insertions, 13 deletions
diff --git a/juick-server/src/main/java/com/juick/server/CrosspostQueries.java b/juick-server/src/main/java/com/juick/server/CrosspostQueries.java
index 827dad09..9d0b5f4c 100644
--- a/juick-server/src/main/java/com/juick/server/CrosspostQueries.java
+++ b/juick-server/src/main/java/com/juick/server/CrosspostQueries.java
@@ -18,6 +18,7 @@
package com.juick.server;
import com.juick.server.helpers.ApplicationStatus;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -64,7 +65,7 @@ public class CrosspostQueries {
try {
return sql.queryForObject("SELECT uname FROM twitter WHERE user_id=?", String.class, uid);
} catch (EmptyResultDataAccessException e) {
- return "";
+ return StringUtils.EMPTY;
}
}
@@ -72,7 +73,7 @@ public class CrosspostQueries {
try {
return sql.queryForObject("SELECT tg_name FROM telegram WHERE user_id=?", String.class, uid);
} catch (EmptyResultDataAccessException e) {
- return "";
+ return StringUtils.EMPTY;
}
}
diff --git a/juick-server/src/main/java/com/juick/server/MessagesQueries.java b/juick-server/src/main/java/com/juick/server/MessagesQueries.java
index cac36979..f3de1f9b 100644
--- a/juick-server/src/main/java/com/juick/server/MessagesQueries.java
+++ b/juick-server/src/main/java/com/juick/server/MessagesQueries.java
@@ -101,8 +101,8 @@ public class MessagesQueries {
if (mid > 0) {
- String tagsNames = "";
- String tagsIDs = "";
+ String tagsNames = org.apache.commons.lang3.StringUtils.EMPTY;
+ String tagsIDs = org.apache.commons.lang3.StringUtils.EMPTY;
for (int i = 0; i < tags.size(); i++) {
if (i > 0) {
diff --git a/juick-server/src/main/java/com/juick/server/UserQueries.java b/juick-server/src/main/java/com/juick/server/UserQueries.java
index e91cb6b3..7a669230 100644
--- a/juick-server/src/main/java/com/juick/server/UserQueries.java
+++ b/juick-server/src/main/java/com/juick/server/UserQueries.java
@@ -241,7 +241,7 @@ public class UserQueries {
if (sql.update("INSERT INTO mail(user_id,hash) VALUES (?,?) ON DUPLICATE KEY UPDATE hash=?", user.getUid(), newHash, newHash) > 0) {
return newHash;
}
- return "";
+ return org.apache.commons.lang3.StringUtils.EMPTY;
}
public static int getUserOptionInt(JdbcTemplate sql, int uid, String option, int defaultValue) {
@@ -481,7 +481,7 @@ public class UserQueries {
return sql.queryForObject("SELECT hash FROM mail WHERE user_id=?", String.class, user.getUid())
+ "@mail.juick.com";
} catch (EmptyResultDataAccessException e) {
- return "";
+ return org.apache.commons.lang3.StringUtils.EMPTY;
}
}
}
diff --git a/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java b/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java
index a024a0eb..cd7a4bc1 100644
--- a/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java
+++ b/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java
@@ -8,6 +8,7 @@ import com.juick.server.helpers.TagStats;
import com.juick.server.protocol.annotation.UserCommand;
import com.juick.service.*;
import com.juick.util.TagUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import javax.inject.Inject;
@@ -110,7 +111,7 @@ public class JuickProtocol {
bltags = tagService.getUserBLTags(user_from.getUid());
- String txt = "";
+ String txt = StringUtils.EMPTY;
if (bltags.size() > 0) {
for (String bltag : bltags) {
txt += "*" + bltag + "\n";
diff --git a/juick-server/src/main/java/com/juick/server/protocol/annotation/UserCommand.java b/juick-server/src/main/java/com/juick/server/protocol/annotation/UserCommand.java
index af7c4924..42a9bb59 100644
--- a/juick-server/src/main/java/com/juick/server/protocol/annotation/UserCommand.java
+++ b/juick-server/src/main/java/com/juick/server/protocol/annotation/UserCommand.java
@@ -1,5 +1,7 @@
package com.juick.server.protocol.annotation;
+import org.apache.commons.lang3.StringUtils;
+
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -15,7 +17,7 @@ public @interface UserCommand {
*
* @return a command pattern
*/
- String pattern() default "";
+ String pattern() default StringUtils.EMPTY;
/**
*
@@ -27,5 +29,5 @@ public @interface UserCommand {
*
* @return a string used in HELP command output. Basically, only 1 string
*/
- String help() default "";
+ String help() default StringUtils.EMPTY;
}
diff --git a/juick-server/src/main/java/com/juick/server/util/HttpBadRequestException.java b/juick-server/src/main/java/com/juick/server/util/HttpBadRequestException.java
index 5c0593ec..1ba1aecb 100644
--- a/juick-server/src/main/java/com/juick/server/util/HttpBadRequestException.java
+++ b/juick-server/src/main/java/com/juick/server/util/HttpBadRequestException.java
@@ -1,5 +1,6 @@
package com.juick.server.util;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@@ -9,6 +10,6 @@ import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
public class HttpBadRequestException extends RuntimeException {
public HttpBadRequestException() {
- super("", null, false, false);
+ super(StringUtils.EMPTY, null, false, false);
}
}
diff --git a/juick-server/src/main/java/com/juick/server/util/HttpForbiddenException.java b/juick-server/src/main/java/com/juick/server/util/HttpForbiddenException.java
index a1004b41..733453ba 100644
--- a/juick-server/src/main/java/com/juick/server/util/HttpForbiddenException.java
+++ b/juick-server/src/main/java/com/juick/server/util/HttpForbiddenException.java
@@ -1,5 +1,6 @@
package com.juick.server.util;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@@ -9,7 +10,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.FORBIDDEN)
public class HttpForbiddenException extends RuntimeException {
public HttpForbiddenException() {
- super("", null, false, false);
+ super(StringUtils.EMPTY, null, false, false);
}
}
diff --git a/juick-server/src/main/java/com/juick/server/util/HttpNotFoundException.java b/juick-server/src/main/java/com/juick/server/util/HttpNotFoundException.java
index fd0f1cb0..942d90e2 100644
--- a/juick-server/src/main/java/com/juick/server/util/HttpNotFoundException.java
+++ b/juick-server/src/main/java/com/juick/server/util/HttpNotFoundException.java
@@ -1,5 +1,6 @@
package com.juick.server.util;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@@ -9,6 +10,6 @@ import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class HttpNotFoundException extends RuntimeException {
public HttpNotFoundException() {
- super("", null, false, false);
+ super(StringUtils.EMPTY, null, false, false);
}
}
diff --git a/juick-server/src/main/java/com/juick/server/util/HttpUtils.java b/juick-server/src/main/java/com/juick/server/util/HttpUtils.java
index fa0b2ec2..e54bef87 100644
--- a/juick-server/src/main/java/com/juick/server/util/HttpUtils.java
+++ b/juick-server/src/main/java/com/juick/server/util/HttpUtils.java
@@ -18,6 +18,7 @@
package com.juick.server.util;
import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
@@ -58,7 +59,7 @@ public class HttpUtils {
}
}
}
- return "";
+ return StringUtils.EMPTY;
}
public static String downloadImage(URL url) throws Exception {
String attachmentFName = null;