Code cleanup.

This commit is contained in:
Erik C. Thauvin 2019-04-09 15:59:41 -07:00
parent 76e7651f7c
commit 723e5d712c
4 changed files with 9 additions and 9 deletions

View file

@ -125,7 +125,7 @@ final class EntriesMgr {
final String today;
try (InputStreamReader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)) {
try (final InputStreamReader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)) {
final SyndFeed feed = input.build(reader);
today = Utils.isoLocalDate(feed.getPublishedDate());

View file

@ -58,22 +58,22 @@ public class EntryLink implements Serializable {
private final List<SyndCategory> tags = new CopyOnWriteArrayList<>();
// The channel
private String channel = "";
private String channel;
// The creation date
private Date date = Calendar.getInstance().getTime();
// The link's URL
private String link = "";
private String link;
// The author's login
private String login = "";
// The author's nickname
private String nick = "";
private String nick;
// The link's title
private String title = "";
private String title;
/**
* Creates a new entry.
@ -184,7 +184,7 @@ public class EntryLink implements Serializable {
* @return The comments.
*/
public final EntryComment[] getComments() {
return (comments.toArray(new EntryComment[comments.size()]));
return (comments.toArray(new EntryComment[0]));
}
/**

View file

@ -144,7 +144,7 @@ public class Tell {
helpResponse(sender);
} else if (cmds.startsWith(Commands.VIEW_CMD)) {
if (bot.isOp(sender) && cmds.equals(Commands.VIEW_CMD + ' ' + TELL_ALL_KEYWORD)) {
if (messages.isEmpty()) {
if (!messages.isEmpty()) {
for (final TellMessage message : messages) {
bot.send(sender, Utils.bold(message.getSender()) + arrow + Utils.bold(message.getRecipient())
+ " [ID: " + message.getId() + ", "

View file

@ -89,7 +89,7 @@ final class TellMessagesMgr {
public static List<TellMessage> load(final String file, final Logger logger) {
try {
try (ObjectInput input = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)))) {
try (final ObjectInput input = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)))) {
if (logger.isDebugEnabled()) {
logger.debug("Loading the messages.");
}
@ -117,7 +117,7 @@ final class TellMessagesMgr {
public static void save(final String file, final List<TellMessage> messages, final Logger logger) {
try {
try (ObjectOutput output = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)))) {
try (final ObjectOutput output = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)))) {
if (logger.isDebugEnabled()) {
logger.debug("Saving the messages.");
}