From 7203299e6ec544d36f4889e02b946bb9b6061f09 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 17 Apr 2021 08:39:21 +0300 Subject: Cleanup deprecated usage of third-party libraries --- src/main/java/com/juick/www/api/Messages.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/java/com/juick/www') diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java index b7e9cb0b..395d00d8 100644 --- a/src/main/java/com/juick/www/api/Messages.java +++ b/src/main/java/com/juick/www/api/Messages.java @@ -102,23 +102,23 @@ public class Messages { @RequestParam(required = false) String media, @RequestParam(required = false) String tag) { List mids; - if (!StringUtils.isEmpty(uname)) { + if (StringUtils.hasText(uname)) { User user = userService.getUserByName(uname); if (!user.isAnonymous() && !user.isBanned()) { - if (!StringUtils.isEmpty(media)) { + if (StringUtils.hasText(media)) { mids = messagesService.getUserPhotos(user.getUid(), 0, before); - } else if (!StringUtils.isEmpty(tag)) { + } else if (StringUtils.hasText(tag)) { Tag tagObject = tagService.getTag(tag, false); if (tagObject != null) { mids = messagesService.getUserTag(user.getUid(), tagObject.TID, 0, before); } else { return NOT_FOUND; } - } else if (!StringUtils.isEmpty(withrecommended)) { + } else if (StringUtils.hasText(withrecommended)) { mids = messagesService.getUserBlogWithRecommendations(user.getUid(), 0, before); } else if (daysback > 0) { mids = messagesService.getUserBlogAtDay(user.getUid(), 0, daysback); - } else if (!StringUtils.isEmpty(search)) { + } else if (StringUtils.hasText(search)) { mids = messagesService.getUserSearch(visitor, user.getUid(), WebUtils.encodeSphinx(search), 0, page); } else { mids = messagesService.getUserBlog(user.getUid(), 0, before); @@ -127,18 +127,18 @@ public class Messages { return NOT_FOUND; } } else { - if (!StringUtils.isEmpty(popular)) { + if (StringUtils.hasText(popular)) { mids = messagesService.getPopular(visitor.getUid(), before); - } else if (!StringUtils.isEmpty(media)) { + } else if (StringUtils.hasText(media)) { mids = messagesService.getPhotos(visitor.getUid(), before); - } else if (!StringUtils.isEmpty(tag)) { + } else if (StringUtils.hasText(tag)) { Tag tagObject = tagService.getTag(tag, false); if (tagObject != null) { mids = messagesService.getTag(tagObject.TID, visitor.getUid(), before, 20); } else { return NOT_FOUND; } - } else if (!StringUtils.isEmpty(search)) { + } else if (StringUtils.hasText(search)) { mids = messagesService.getSearch(visitor, WebUtils.encodeSphinx(search), page); } else { mids = messagesService.getAll(visitor.getUid(), before); -- cgit v1.2.3