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-spring-www/src/main/java | |
parent | 8b02f969d3a09e39557474eb90ec821d550e3b1b (diff) |
StringUtils.EMPTY
Diffstat (limited to 'juick-spring-www/src/main/java')
3 files changed, 7 insertions, 6 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java index 9fceb23c..f590fc7c 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java @@ -11,6 +11,7 @@ import com.juick.util.MessageUtils; import com.juick.util.UserUtils; import com.juick.util.WebUtils; import com.juick.www.WebApp; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; @@ -64,7 +65,7 @@ public class PMController { List<com.juick.Message> msgs = pmQueriesService.getLastPMSent(visitor.getUid()); if (WebUtils.isNotUserName(uname)) { - uname = ""; + uname = StringUtils.EMPTY; } context.put("title", title); context.put("msgs", msgs); diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/PostController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/PostController.java index 1ce2f893..01f011be 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/PostController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/PostController.java @@ -69,7 +69,7 @@ public class PostController { @RequestParam(required = false) MultipartFile attach, ModelMap modelMap ) throws IOException { - body = body.replace("\r", ""); + body = body.replace("\r", StringUtils.EMPTY); List<Tag> tags = tagService.fromString(tagsStr, true); @@ -144,8 +144,8 @@ public class PostController { logger.warn("XMPP unavailable"); } - String hashtags = ""; - String tagscomma = ""; + String hashtags = StringUtils.EMPTY; + String tagscomma = StringUtils.EMPTY; for (int i = 0; i < jmsg.getTags().size(); i++) { if (i > 0) { hashtags += " "; @@ -195,7 +195,7 @@ public class PostController { if (body.length() < 1 || body.length() > 4096) { throw new HttpBadRequestException(); } - body = body.replace("\r", ""); + body = body.replace("\r", StringUtils.EMPTY); User visitor = UserUtils.getCurrentUser(); diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java index 65309e4e..d1c872d7 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java @@ -123,7 +123,7 @@ public class SettingsController { if (StringUtils.isEmpty(page) || !pages.contains(page)) { throw new HttpBadRequestException(); } - String result = ""; + String result = StringUtils.EMPTY; switch (page) { case "password": if (userService.updatePassword(visitor, password)) { |