diff options
Diffstat (limited to 'src/main/java/com/juick/CommandsManager.java')
-rw-r--r-- | src/main/java/com/juick/CommandsManager.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/com/juick/CommandsManager.java b/src/main/java/com/juick/CommandsManager.java index f7c37b8b..66a45f9d 100644 --- a/src/main/java/com/juick/CommandsManager.java +++ b/src/main/java/com/juick/CommandsManager.java @@ -106,7 +106,7 @@ public class CommandsManager { } } CommandResult commandResult = (CommandResult) getClass().getMethod(cmd.get().getName(), User.class, URI.class, String[].class) - .invoke(this, user, attachment, groups.toArray(new String[groups.size()])); + .invoke(this, user, attachment, groups.toArray(new String[0])); if (StringUtils.isNotEmpty(commandResult.getText())) { return commandResult; } @@ -196,26 +196,26 @@ public class CommandsManager { List<User> blusers = userService.getUserBLUsers(user_from.getUid()); List<String> bltags = tagService.getUserBLTags(user_from.getUid()); - String txt = StringUtils.EMPTY; + StringBuilder txt = new StringBuilder(StringUtils.EMPTY); if (bltags.size() > 0) { for (String bltag : bltags) { - txt += "*" + bltag + "\n"; + txt.append("*").append(bltag).append("\n"); } if (blusers.size() > 0) { - txt += "\n"; + txt.append("\n"); } } if (blusers.size() > 0) { for (User bluser : blusers) { - txt += "@" + bluser.getName() + "\n"; + txt.append("@").append(bluser.getName()).append("\n"); } } - if (txt.isEmpty()) { - txt = "You don't have any users or tags in your blacklist."; + if (txt.length() == 0) { + txt = new StringBuilder("You don't have any users or tags in your blacklist."); } - return CommandResult.fromString(txt); + return CommandResult.fromString(txt.toString()); } @UserCommand(pattern = "^#\\+$", help = "#+ - Show last Juick messages") |