From 3859c9616d0a7a04e68427d173b863161b818140 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 20 Dec 2016 14:28:00 +0300 Subject: StringUtils.EMPTY --- .../main/java/com/juick/api/configuration/ApiAppConfiguration.java | 3 ++- juick-api/src/main/java/com/juick/api/controllers/Post.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'juick-api') diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java index b4b9df57..409734e4 100644 --- a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java +++ b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java @@ -2,6 +2,7 @@ package com.juick.api.configuration; import com.juick.api.ApiServer; import com.juick.api.TGBot; +import org.apache.commons.lang3.StringUtils; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; @@ -25,6 +26,6 @@ public class ApiAppConfiguration { @Bean public TGBot tgBot() { - return new TGBot(env.getProperty("telegram_token", "")); + return new TGBot(env.getProperty("telegram_token", StringUtils.EMPTY)); } } diff --git a/juick-api/src/main/java/com/juick/api/controllers/Post.java b/juick-api/src/main/java/com/juick/api/controllers/Post.java index 853a60ff..0c93fb7b 100644 --- a/juick-api/src/main/java/com/juick/api/controllers/Post.java +++ b/juick-api/src/main/java/com/juick/api/controllers/Post.java @@ -65,7 +65,7 @@ public class Post { if (body == null || body.length() < 1 || body.length() > 4096) { throw new HttpBadRequestException(); } - body = body.replace("\r", ""); + body = body.replace("\r", StringUtils.EMPTY); String attachmentFName = HttpUtils.receiveMultiPartFile(attach, env.getProperty("upload_tmp_dir", "/var/www/juick.com/i/tmp/")); @@ -129,7 +129,7 @@ public class Post { if (body == null || body.length() < 1 || body.length() > 4096) { throw new HttpBadRequestException(); } - body = body.replace("\r", ""); + body = body.replace("\r", StringUtils.EMPTY); if ((msg.ReadOnly && msg.getUser().getUid() != vuid) || userService.isInBLAny(msg.getUser().getUid(), vuid) || (reply != null && userService.isInBLAny(reply.getUser().getUid(), vuid))) { -- cgit v1.2.3