From 64ffd95aba335b3b9a7c0f4fdd5b258321914b66 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 17 Apr 2019 00:23:02 -0700 Subject: [PATCH] Checkstyle fixes. --- build.gradle | 8 + config/checkstyle/checkstyle.xml | 267 ++++++++++++++++++ mobibot.ipr | 18 +- .../net/thauvin/erik/mobibot/Commands.java | 1 + .../net/thauvin/erik/mobibot/EntriesMgr.java | 23 +- .../thauvin/erik/mobibot/EntryComment.java | 1 + .../net/thauvin/erik/mobibot/EntryLink.java | 19 +- .../net/thauvin/erik/mobibot/FeedReader.java | 1 + .../net/thauvin/erik/mobibot/Mobibot.java | 135 +++++---- .../net/thauvin/erik/mobibot/Pinboard.java | 3 +- .../java/net/thauvin/erik/mobibot/Tell.java | 12 +- .../net/thauvin/erik/mobibot/TellMessage.java | 1 + .../thauvin/erik/mobibot/TellMessagesMgr.java | 19 +- .../thauvin/erik/mobibot/TwitterOAuth.java | 7 +- .../java/net/thauvin/erik/mobibot/Utils.java | 7 +- .../erik/mobibot/modules/AbstractModule.java | 7 +- .../thauvin/erik/mobibot/modules/Calc.java | 1 + .../mobibot/modules/CurrencyConverter.java | 5 +- .../thauvin/erik/mobibot/modules/Dice.java | 1 + .../erik/mobibot/modules/GoogleSearch.java | 1 + .../thauvin/erik/mobibot/modules/Joke.java | 3 +- .../thauvin/erik/mobibot/modules/Lookup.java | 7 +- .../erik/mobibot/modules/ModuleException.java | 9 +- .../thauvin/erik/mobibot/modules/Ping.java | 1 + .../erik/mobibot/modules/StockQuote.java | 1 + .../erik/mobibot/modules/ThreadedModule.java | 1 + .../thauvin/erik/mobibot/modules/Twitter.java | 1 + .../net/thauvin/erik/mobibot/modules/War.java | 1 + .../erik/mobibot/modules/Weather2.java | 6 +- .../erik/mobibot/modules/WorldTime.java | 11 +- .../erik/mobibot/msg/ErrorMessage.java | 13 + .../net/thauvin/erik/mobibot/msg/Message.java | 9 +- .../erik/mobibot/msg/NoticeMessage.java | 12 + .../erik/mobibot/msg/PrivateMessage.java | 1 + .../erik/mobibot/msg/PublicMessage.java | 1 + .../net/thauvin/erik/mobibot/UtilsTest.java | 1 + .../mobibot/modules/AbstractModuleTest.java | 1 + .../erik/mobibot/modules/CalcTest.java | 1 + .../modules/CurrencyConverterTest.java | 1 + .../mobibot/modules/GoogleSearchTest.java | 1 + .../erik/mobibot/modules/JokeTest.java | 1 + .../erik/mobibot/modules/LocalProperties.java | 1 + .../erik/mobibot/modules/LookupTest.java | 1 + .../mobibot/modules/ModuleExceptionTest.java | 1 + .../erik/mobibot/modules/PingTest.java | 4 +- .../erik/mobibot/modules/StockQuoteTest.java | 1 + .../erik/mobibot/modules/Weather2Test.java | 1 + .../erik/mobibot/modules/WordTimeTest.java | 1 + 48 files changed, 512 insertions(+), 118 deletions(-) create mode 100644 config/checkstyle/checkstyle.xml diff --git a/build.gradle b/build.gradle index 79fc849..77a712c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ plugins { + id 'checkstyle' id 'application' id 'idea' id 'jacoco' @@ -128,6 +129,13 @@ tasks.withType(SpotBugsTask) { excludeFilter = file("$projectDir/config/spotbugs/excludeFilter.xml") } +tasks.withType(Checkstyle) { + reports { + xml.enabled = false + html.enabled = true + } +} + task copyToDeploy(type: Copy) { from('properties') from jar diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 0000000..c426276 --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mobibot.ipr b/mobibot.ipr index 0a57b34..fbc1a69 100644 --- a/mobibot.ipr +++ b/mobibot.ipr @@ -1,5 +1,20 @@ + + + @@ -47,7 +62,6 @@ - @@ -55,7 +69,7 @@ - + diff --git a/src/main/java/net/thauvin/erik/mobibot/Commands.java b/src/main/java/net/thauvin/erik/mobibot/Commands.java index a6487a1..b0a825d 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Commands.java +++ b/src/main/java/net/thauvin/erik/mobibot/Commands.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; /** diff --git a/src/main/java/net/thauvin/erik/mobibot/EntriesMgr.java b/src/main/java/net/thauvin/erik/mobibot/EntriesMgr.java index d2299ae..a85efd8 100644 --- a/src/main/java/net/thauvin/erik/mobibot/EntriesMgr.java +++ b/src/main/java/net/thauvin/erik/mobibot/EntriesMgr.java @@ -29,14 +29,25 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; -import com.rometools.rome.feed.synd.*; +import com.rometools.rome.feed.synd.SyndContent; +import com.rometools.rome.feed.synd.SyndContentImpl; +import com.rometools.rome.feed.synd.SyndEntry; +import com.rometools.rome.feed.synd.SyndEntryImpl; +import com.rometools.rome.feed.synd.SyndFeed; +import com.rometools.rome.feed.synd.SyndFeedImpl; import com.rometools.rome.io.FeedException; import com.rometools.rome.io.SyndFeedInput; import com.rometools.rome.io.SyndFeedOutput; -import java.io.*; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.Writer; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Calendar; @@ -125,7 +136,8 @@ final class EntriesMgr { final String today; - try (final 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()); @@ -263,13 +275,14 @@ final class EntriesMgr { history.remove(0); } } - + try (final Writer fw = new OutputStreamWriter( new FileOutputStream(bot.getLogsDir() + NAV_XML), StandardCharsets.UTF_8)) { rss = new SyndFeedImpl(); rss.setFeedType("rss_2.0"); rss.setTitle(bot.getChannel() + " IRC Links Backlogs"); - rss.setDescription("Backlogs of Links from " + bot.getIrcServer() + " on " + bot.getChannel()); + rss.setDescription("Backlogs of Links from " + bot.getIrcServer() + " on " + + bot.getChannel()); rss.setLink(bot.getBacklogsUrl()); rss.setPublishedDate(Calendar.getInstance().getTime()); diff --git a/src/main/java/net/thauvin/erik/mobibot/EntryComment.java b/src/main/java/net/thauvin/erik/mobibot/EntryComment.java index d665179..0088f9f 100644 --- a/src/main/java/net/thauvin/erik/mobibot/EntryComment.java +++ b/src/main/java/net/thauvin/erik/mobibot/EntryComment.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; import java.io.Serializable; diff --git a/src/main/java/net/thauvin/erik/mobibot/EntryLink.java b/src/main/java/net/thauvin/erik/mobibot/EntryLink.java index 8820227..9a4405d 100644 --- a/src/main/java/net/thauvin/erik/mobibot/EntryLink.java +++ b/src/main/java/net/thauvin/erik/mobibot/EntryLink.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; import com.rometools.rome.feed.synd.SyndCategory; @@ -328,6 +329,15 @@ public class EntryLink implements Serializable { } } + /** + * Sets the tags. + * + * @param tags The tags. + */ + private void setTags(final List tags) { + this.tags.addAll(tags); + } + /** * Returns the comment's title. * @@ -377,15 +387,6 @@ public class EntryLink implements Serializable { } } - /** - * Sets the tags. - * - * @param tags The tags. - */ - private void setTags(final List tags) { - this.tags.addAll(tags); - } - /** * Returns a string representation of the object. * diff --git a/src/main/java/net/thauvin/erik/mobibot/FeedReader.java b/src/main/java/net/thauvin/erik/mobibot/FeedReader.java index e85f2c2..3ea1fcb 100644 --- a/src/main/java/net/thauvin/erik/mobibot/FeedReader.java +++ b/src/main/java/net/thauvin/erik/mobibot/FeedReader.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; import com.rometools.rome.feed.synd.SyndEntry; diff --git a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java index c0e9dc3..eeafd9d 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java +++ b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java @@ -29,14 +29,33 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; import com.rometools.rome.io.FeedException; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import net.thauvin.erik.mobibot.modules.*; +import net.thauvin.erik.mobibot.modules.AbstractModule; +import net.thauvin.erik.mobibot.modules.Calc; +import net.thauvin.erik.mobibot.modules.CurrencyConverter; +import net.thauvin.erik.mobibot.modules.Dice; +import net.thauvin.erik.mobibot.modules.GoogleSearch; +import net.thauvin.erik.mobibot.modules.Joke; +import net.thauvin.erik.mobibot.modules.Lookup; +import net.thauvin.erik.mobibot.modules.Ping; +import net.thauvin.erik.mobibot.modules.StockQuote; +import net.thauvin.erik.mobibot.modules.Twitter; +import net.thauvin.erik.mobibot.modules.War; +import net.thauvin.erik.mobibot.modules.Weather2; +import net.thauvin.erik.mobibot.modules.WorldTime; import net.thauvin.erik.mobibot.msg.Message; import net.thauvin.erik.semver.Version; -import org.apache.commons.cli.*; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -47,10 +66,20 @@ import org.jibble.pircbot.User; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintStream; import java.time.Clock; import java.time.LocalDateTime; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Properties; +import java.util.StringTokenizer; /** * Implements the #mobitopia bot. @@ -162,7 +191,7 @@ public class Mobibot extends PircBot { // The default tags/categories. private String defaultTags = ""; // The feed URL. - private String feedURL = ""; + private String feedUrl = ""; // The ident message. private String identMsg = ""; // The ident nick. @@ -237,7 +266,7 @@ public class Mobibot extends PircBot { // Set the URLs setWeblogUrl(getVersion()); - setFeedURL(p.getProperty("feed", "")); + setFeedUrl(p.getProperty("feed", "")); setBacklogsUrl(Utils.ensureDir(p.getProperty("backlogs", weblogUrl), true)); // Set the pinboard authentication @@ -443,8 +472,8 @@ public class Mobibot extends PircBot { * @param sender The nick of the person who sent the private message. */ private void feedResponse(final String sender) { - if (Utils.isValidString(feedURL)) { - new Thread(new FeedReader(this, sender, feedURL)).start(); + if (Utils.isValidString(feedUrl)) { + new Thread(new FeedReader(this, sender, feedUrl)).start(); } else { send(sender, "There is no weblog setup for this channel."); } @@ -1009,9 +1038,7 @@ public class Mobibot extends PircBot { send(sender, Utils.bold("Duplicate") + " >> " + Utils.buildLink(dupIndex, entry)); } } - } - // mobibot: - else if (message.matches(getNickPattern() + ":.*")) { + } else if (message.matches(getNickPattern() + ":.*")) { // mobibot: isCommand = true; final String[] cmds = message.substring(message.indexOf(':') + 1).trim().split(" ", 2); @@ -1023,45 +1050,27 @@ public class Mobibot extends PircBot { args = cmds[1].trim(); } - // mobibot: help - if (cmd.startsWith(Commands.HELP_CMD)) { + + if (cmd.startsWith(Commands.HELP_CMD)) { // mobibot: help helpResponse(sender, args); - } - // mobibot: recap - else if (cmd.equals(Commands.RECAP_CMD)) { + } else if (cmd.equals(Commands.RECAP_CMD)) { // mobibot: recap recapResponse(sender, false); - } - // mobibot: users - else if (cmd.equals(Commands.USERS_CMD)) { + } else if (cmd.equals(Commands.USERS_CMD)) { // mobibot: users usersResponse(sender, false); - } - // mobibot: info - else if (cmd.equals(Commands.INFO_CMD)) { + } else if (cmd.equals(Commands.INFO_CMD)) { // mobibot: info infoResponse(sender, false); - } - // mobbiot: version - else if (cmd.equals(Commands.VERSION_CMD)) { + } else if (cmd.equals(Commands.VERSION_CMD)) { // mobbiot: version versionResponse(sender, false); - } - // mobibot: - else if (cmd.equalsIgnoreCase(channel.substring(1))) { + } else if (cmd.equalsIgnoreCase(channel.substring(1))) { // mobibot: feedResponse(sender); - } - // mobibot: view - else if (cmd.startsWith(Commands.VIEW_CMD)) { + } else if (cmd.startsWith(Commands.VIEW_CMD)) { // mobibot: view viewResponse(sender, args, false); - } - // mobibot: tell - else if (cmd.startsWith(Tell.TELL_CMD) && tell.isEnabled()) { + } else if (cmd.startsWith(Tell.TELL_CMD) && tell.isEnabled()) { // mobibot: tell tell.response(sender, args); - } - // mobibot: ignore - else if (cmd.startsWith(Commands.IGNORE_CMD)) { + } else if (cmd.startsWith(Commands.IGNORE_CMD)) { // mobibot: ignore ignoreResponse(sender, args); - } - // modules - else { - for (final AbstractModule module : MODULES) { + } else { + for (final AbstractModule module : MODULES) { // modules for (final String c : module.getCommands()) { if (cmd.startsWith(c)) { module.commandResponse(this, sender, args, false); @@ -1069,9 +1078,7 @@ public class Mobibot extends PircBot { } } } - } - // L1:, L1:-, L1:|, etc. - else if (message.matches(Commands.LINK_CMD + "[0-9]+:.*")) { + } else if (message.matches(Commands.LINK_CMD + "[0-9]+:.*")) { // L1:<comment>, L1:-, L1:|<title>, etc. isCommand = true; final String[] cmds = message.substring(1).split(":", 2); @@ -1112,9 +1119,7 @@ public class Mobibot extends PircBot { } else { send(sender, "Please ask a channel op to remove this entry for you."); } - } - // L1:|<title> - else if (cmd.charAt(0) == '|') { + } else if (cmd.charAt(0) == '|') { // L1:|<title> if (cmd.length() > 1) { final EntryLink entry = entries.get(index); entry.setTitle(cmd.substring(1).trim()); @@ -1126,9 +1131,7 @@ public class Mobibot extends PircBot { send(channel, Utils.buildLink(index, entry)); saveEntries(false); } - } - // L1:=<url> - else if (cmd.charAt(0) == '=') { + } else if (cmd.charAt(0) == '=') { // L1:=<url> final EntryLink entry = entries.get(index); if (entry.getLogin().equals(login) || isOp(sender)) { @@ -1149,9 +1152,7 @@ public class Mobibot extends PircBot { } else { send(sender, "Please ask a channel op to change this link for you."); } - } - // L1:?<author> - else if (cmd.charAt(0) == '?') { + } else if (cmd.charAt(0) == '?') { // L1:?<author> if (isOp(sender)) { if (cmd.length() > 1) { final EntryLink entry = entries.get(index); @@ -1172,9 +1173,7 @@ public class Mobibot extends PircBot { } } } - } - // L1T:<+-tag> - else if (message.matches(Commands.LINK_CMD + "[0-9]+T:.*")) { + } else if (message.matches(Commands.LINK_CMD + "[0-9]+T:.*")) { // L1T:<+-tag> isCommand = true; final String[] cmds = message.substring(1).split("T:", 2); @@ -1206,9 +1205,7 @@ public class Mobibot extends PircBot { } } } - } - // L1.1:<command> - else if (message.matches(Commands.LINK_CMD + "[0-9]+\\.[0-9]+:.*")) { + } else if (message.matches(Commands.LINK_CMD + "[0-9]+\\.[0-9]+:.*")) { // L1.1:<command> isCommand = true; final String[] cmds = message.substring(1).split("[.:]", 3); @@ -1225,15 +1222,11 @@ public class Mobibot extends PircBot { if (cmd.length() == 0) { final EntryComment comment = entry.getComment(cindex); send(channel, Utils.buildComment(index, cindex, comment)); - } - // L1.1:- - else if ("-".equals(cmd)) { + } else if ("-".equals(cmd)) { // L1.1:- entry.deleteComment(cindex); send(channel, "Comment " + Commands.LINK_CMD + (index + 1) + '.' + (cindex + 1) + " removed."); saveEntries(false); - } - // L1.1:?<author> - else if (cmd.charAt(0) == '?') { + } else if (cmd.charAt(0) == '?') { // L1.1:?<author> if (isOp(sender)) { if (cmd.length() > 1) { final EntryComment comment = entry.getComment(cindex); @@ -1490,10 +1483,10 @@ public class Mobibot extends PircBot { /** * Sets the feed URL. * - * @param feedURL The feed URL. + * @param feedUrl The feed URL. */ - private void setFeedURL(final String feedURL) { - this.feedURL = feedURL; + private void setFeedUrl(final String feedUrl) { + this.feedUrl = feedUrl; } /** @@ -1652,9 +1645,9 @@ public class Mobibot extends PircBot { entry = entries.get(i); if (lcArgs.length() > 0) { - if ((entry.getLink().toLowerCase().contains(lcArgs)) || - (entry.getTitle().toLowerCase().contains(lcArgs)) || - (entry.getNick().toLowerCase().contains(lcArgs))) { + if ((entry.getLink().toLowerCase().contains(lcArgs)) + || (entry.getTitle().toLowerCase().contains(lcArgs)) + || (entry.getNick().toLowerCase().contains(lcArgs))) { if (sent > MAX_ENTRIES) { send(sender, "To view more, try: " + Utils diff --git a/src/main/java/net/thauvin/erik/mobibot/Pinboard.java b/src/main/java/net/thauvin/erik/mobibot/Pinboard.java index 5682456..d7b5274 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Pinboard.java +++ b/src/main/java/net/thauvin/erik/mobibot/Pinboard.java @@ -29,11 +29,12 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; import net.thauvin.erik.pinboard.PinboardPoster; -import javax.swing.*; +import javax.swing.SwingWorker; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; diff --git a/src/main/java/net/thauvin/erik/mobibot/Tell.java b/src/main/java/net/thauvin/erik/mobibot/Tell.java index de149c8..35d0a8c 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Tell.java +++ b/src/main/java/net/thauvin/erik/mobibot/Tell.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; import java.util.List; @@ -81,6 +82,13 @@ public class Tell { // The serialized object file. private final String serializedObject; + /** + * Creates a new instance. + * + * @param bot The bot. + * @param maxDays Max days. + * @param maxSize Max size. + */ public Tell(final Mobibot bot, final String maxDays, final String maxSize) { this.bot = bot; this.maxDays = Utils.getIntProperty(maxDays, DEFAULT_TELL_MAX_DAYS); @@ -264,7 +272,9 @@ public class Tell { } } - if (clean()) save(); + if (clean()) { + save(); + } } /** diff --git a/src/main/java/net/thauvin/erik/mobibot/TellMessage.java b/src/main/java/net/thauvin/erik/mobibot/TellMessage.java index bb4c607..2b3c193 100644 --- a/src/main/java/net/thauvin/erik/mobibot/TellMessage.java +++ b/src/main/java/net/thauvin/erik/mobibot/TellMessage.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; import java.io.Serializable; diff --git a/src/main/java/net/thauvin/erik/mobibot/TellMessagesMgr.java b/src/main/java/net/thauvin/erik/mobibot/TellMessagesMgr.java index 8d6cdde..47c104b 100644 --- a/src/main/java/net/thauvin/erik/mobibot/TellMessagesMgr.java +++ b/src/main/java/net/thauvin/erik/mobibot/TellMessagesMgr.java @@ -29,11 +29,21 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; import org.apache.logging.log4j.Logger; -import java.io.*; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectInputStream; +import java.io.ObjectOutput; +import java.io.ObjectOutputStream; import java.time.Clock; import java.time.LocalDateTime; import java.util.ArrayList; @@ -52,12 +62,12 @@ final class TellMessagesMgr { * * @throws UnsupportedOperationException If the constructor is called. */ - private TellMessagesMgr() { + private TellMessagesMgr() { throw new UnsupportedOperationException("Illegal constructor call."); } /** - * Cleans the messages queue + * Cleans the messages queue. * * @param tellMessages The messages list. * @param tellMaxDays The maximum number of days to keep messages for. @@ -117,7 +127,8 @@ final class TellMessagesMgr { public static void save(final String file, final List<TellMessage> messages, final Logger logger) { try { - try (final 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."); } diff --git a/src/main/java/net/thauvin/erik/mobibot/TwitterOAuth.java b/src/main/java/net/thauvin/erik/mobibot/TwitterOAuth.java index 6745d30..e84758c 100644 --- a/src/main/java/net/thauvin/erik/mobibot/TwitterOAuth.java +++ b/src/main/java/net/thauvin/erik/mobibot/TwitterOAuth.java @@ -17,7 +17,7 @@ import java.io.InputStreamReader; * Then execute: * <p> * <code> - * java -cp "mobibot.jar:lib/*"net.thauvin.erik.mobibot.TwitterOAuth <consumerKey> <consumerSecret> + * java -cp "mobibot.jar:lib/*" net.thauvin.erik.mobibot.TwitterOAuth <consumerKey> <consumerSecret> * </code> * </p> * and follow the prompts/instructions. @@ -28,6 +28,11 @@ import java.io.InputStreamReader; * @since 1.0 */ public final class TwitterOAuth { + /** + * Twitter OAuth Client Registration. + * + * @param args The consumerKey and consumerSecret should be passed as arguments. + */ @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING") public static void main(final String[] args) throws Exception { diff --git a/src/main/java/net/thauvin/erik/mobibot/Utils.java b/src/main/java/net/thauvin/erik/mobibot/Utils.java index 648ad7d..e754c69 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Utils.java +++ b/src/main/java/net/thauvin/erik/mobibot/Utils.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; import org.jibble.pircbot.Colors; @@ -170,7 +171,7 @@ public final class Utils { } /** - * Meks the given string cyan + * Meks the given string cyan. * * @param s The string. * @return The cyan string. @@ -323,7 +324,7 @@ public final class Utils { } /** - * Returns the specified date formatted as <code>yyyy-MM-dd HH:mm</code> + * Returns the specified date formatted as <code>yyyy-MM-dd HH:mm</code>. * * @param date The date. * @return The fromatted date. @@ -333,7 +334,7 @@ public final class Utils { } /** - * Returns the specified date formatted as <code>yyyy-MM-dd HH:mm</code> + * Returns the specified date formatted as <code>yyyy-MM-dd HH:mm</code>. * * @param date The date. * @return The formatted date. diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/AbstractModule.java b/src/main/java/net/thauvin/erik/mobibot/modules/AbstractModule.java index c58830a..af9fbe3 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/AbstractModule.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/AbstractModule.java @@ -29,12 +29,17 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.Mobibot; import net.thauvin.erik.mobibot.Utils; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * The <code>Module</code> abstract class. diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/Calc.java b/src/main/java/net/thauvin/erik/mobibot/modules/Calc.java index 22810fa..12880df 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/Calc.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/Calc.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.objecthunter.exp4j.Expression; diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java b/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java index d45fa32..a35d588 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -149,7 +150,9 @@ public final class CurrencyConverter extends ThreadedModule { int i = 0; for (final Map.Entry<String, String> rate : EXCHANGE_RATES.entrySet()) { - if (i > 0) buff.append(", "); + if (i > 0) { + buff.append(", "); + } buff.append(rate.getKey()).append(": ").append(rate.getValue()); i++; } diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/Dice.java b/src/main/java/net/thauvin/erik/mobibot/modules/Dice.java index 8c8085b..8c45f48 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/Dice.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/Dice.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.Mobibot; diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/GoogleSearch.java b/src/main/java/net/thauvin/erik/mobibot/modules/GoogleSearch.java index 9a4af37..4894afa 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/GoogleSearch.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/GoogleSearch.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/Joke.java b/src/main/java/net/thauvin/erik/mobibot/modules/Joke.java index cbd8084..2e6a840 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/Joke.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/Joke.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.Mobibot; @@ -112,7 +113,7 @@ public final class Joke extends ThreadedModule { } /** - * Returns a random joke from <a href="http://www.icndb.com/">The Internet Chuck Norris Database</a> + * Returns a random joke from <a href="http://www.icndb.com/">The Internet Chuck Norris Database</a>. */ void run(final Mobibot bot, final String sender, String arg) { try { diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/Lookup.java b/src/main/java/net/thauvin/erik/mobibot/modules/Lookup.java index 014b9ad..ace6bca 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/Lookup.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/Lookup.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.Mobibot; @@ -55,7 +56,7 @@ public final class Lookup extends AbstractModule { private static final String LOOKUP_CMD = "lookup"; /** - * The default constructor + * The default constructor. */ public Lookup() { commands.add(LOOKUP_CMD); @@ -154,8 +155,8 @@ public final class Lookup extends AbstractModule { bot.send(Lookup.lookup(args)); } catch (UnknownHostException ignore) { if (args.matches( - "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\." + - "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")) { + "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\." + + "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")) { try { final String[] lines = Lookup.whois(args); diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/ModuleException.java b/src/main/java/net/thauvin/erik/mobibot/modules/ModuleException.java index 9c3009c..35710b9 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/ModuleException.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/ModuleException.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import okhttp3.HttpUrl; @@ -100,11 +101,13 @@ class ModuleException extends Exception { final String causeMessage = getCause().getMessage(); final Matcher matcher = urlPattern.matcher(causeMessage); if (matcher.find()) { - final HttpUrl url = HttpUrl.parse(matcher.group(1)+matcher.group(2)); - if (url != null){ + final HttpUrl url = HttpUrl.parse(matcher.group(1) + matcher.group(2)); + if (url != null) { final StringBuilder query = new StringBuilder("?"); for (int i = 0, size = url.querySize(); i < size; i++) { - if (i > 0) query.append('&'); + if (i > 0) { + query.append('&'); + } query.append(url.queryParameterName(i)).append('=').append('[') .append(url.queryParameterValue(i).length()).append(']'); } diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/Ping.java b/src/main/java/net/thauvin/erik/mobibot/modules/Ping.java index a8a075d..bb554f5 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/Ping.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/Ping.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.Mobibot; diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/StockQuote.java b/src/main/java/net/thauvin/erik/mobibot/modules/StockQuote.java index 3805592..aae368d 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/StockQuote.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/StockQuote.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.Mobibot; diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/ThreadedModule.java b/src/main/java/net/thauvin/erik/mobibot/modules/ThreadedModule.java index 59e99ce..99917f7 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/ThreadedModule.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/ThreadedModule.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.Mobibot; diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/Twitter.java b/src/main/java/net/thauvin/erik/mobibot/modules/Twitter.java index 14d508a..ef067a6 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/Twitter.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/Twitter.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.Mobibot; diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/War.java b/src/main/java/net/thauvin/erik/mobibot/modules/War.java index 3f6349b..b6c3442 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/War.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/War.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.Mobibot; diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/Weather2.java b/src/main/java/net/thauvin/erik/mobibot/modules/Weather2.java index 6fffb11..2f51d3a 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/Weather2.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/Weather2.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.aksingh.owmjapis.api.APIException; @@ -72,7 +73,8 @@ public class Weather2 extends ThreadedModule { properties.put(OWM_API_KEY_PROP, ""); } - private static String fAndC(final Double d) { + @SuppressWarnings("AvoidEscapedUnicodeCharacters") + private static String getTemps(final Double d) { final double c = (d - 32) * 5 / 9; return Math.round(d) + " \u00B0F, " + Math.round(c) + " \u00B0C"; } @@ -122,7 +124,7 @@ public class Weather2 extends ThreadedModule { final Main main = cwd.getMainData(); if (main != null) { if (main.hasTemp()) { - messages.add(new PublicMessage("Temperature: " + fAndC(main.getTemp()))); + messages.add(new PublicMessage("Temperature: " + getTemps(main.getTemp()))); } if (main.hasHumidity() && (main.getHumidity() != null)) { diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/WorldTime.java b/src/main/java/net/thauvin/erik/mobibot/modules/WorldTime.java index 01842c5..d0b5c0b 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/WorldTime.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/WorldTime.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.Mobibot; @@ -55,7 +56,7 @@ public final class WorldTime extends AbstractModule { private static final String BEATS_KEYWORD = ".beats"; // The supported countries. private static final Map<String, String> COUNTRIES_MAP = new TreeMap<>(); - + /** * The time command. */ @@ -138,10 +139,10 @@ public final class WorldTime extends AbstractModule { COUNTRIES_MAP.put("ZULU", "Zulu"); COUNTRIES_MAP.put("INTERNET", BEATS_KEYWORD); COUNTRIES_MAP.put("BEATS", BEATS_KEYWORD); - - ZoneId.getAvailableZoneIds().stream().filter( - tz -> !tz.contains("/") && tz.length() == 3 && !COUNTRIES_MAP.containsKey(tz)).forEach( - tz -> COUNTRIES_MAP.put(tz, tz)); + + ZoneId.getAvailableZoneIds().stream().filter(tz -> + !tz.contains("/") && tz.length() == 3 && !COUNTRIES_MAP.containsKey(tz)).forEach(tz -> + COUNTRIES_MAP.put(tz, tz)); } /** diff --git a/src/main/java/net/thauvin/erik/mobibot/msg/ErrorMessage.java b/src/main/java/net/thauvin/erik/mobibot/msg/ErrorMessage.java index 9bd0ea7..a558dc0 100644 --- a/src/main/java/net/thauvin/erik/mobibot/msg/ErrorMessage.java +++ b/src/main/java/net/thauvin/erik/mobibot/msg/ErrorMessage.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.msg; /** @@ -39,11 +40,23 @@ package net.thauvin.erik.mobibot.msg; * @since 1.0 */ public class ErrorMessage extends Message { + /** + * Creates a new error message. + * + * @param message The error message. + */ public ErrorMessage(final String message) { this.setMessage(message); this.setError(true); this.setNotice(true); } + + /** + * Creates a new error message. + * + * @param message The message. + * @param color The message color. + */ public ErrorMessage(final String message, final String color) { this.setMessage(message); this.setError(true); diff --git a/src/main/java/net/thauvin/erik/mobibot/msg/Message.java b/src/main/java/net/thauvin/erik/mobibot/msg/Message.java index b86de8a..47c3f1e 100644 --- a/src/main/java/net/thauvin/erik/mobibot/msg/Message.java +++ b/src/main/java/net/thauvin/erik/mobibot/msg/Message.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.msg; import org.jibble.pircbot.Colors; @@ -101,7 +102,7 @@ public class Message { } /** - * Set the color + * Set the color. * * @param color The new color. */ @@ -175,9 +176,9 @@ public class Message { /** * Sets the message private flag. * - * @param aPrivate The private flag. + * @param isPrivate The private flag. */ - public void setPrivate(boolean aPrivate) { - isPrivate = aPrivate; + public void setPrivate(boolean isPrivate) { + this.isPrivate = isPrivate; } } diff --git a/src/main/java/net/thauvin/erik/mobibot/msg/NoticeMessage.java b/src/main/java/net/thauvin/erik/mobibot/msg/NoticeMessage.java index 80bfe9e..f4eb3db 100644 --- a/src/main/java/net/thauvin/erik/mobibot/msg/NoticeMessage.java +++ b/src/main/java/net/thauvin/erik/mobibot/msg/NoticeMessage.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.msg; /** @@ -39,11 +40,22 @@ package net.thauvin.erik.mobibot.msg; * @since 1.0 */ public class NoticeMessage extends Message { + /** + * Creates a new notice. + * + * @param message The notice's message. + */ public NoticeMessage(final String message) { this.setMessage(message); this.setNotice(true); } + /** + * Create a new notice. + * + * @param message The ntoice's message. + * @param color The color. + */ public NoticeMessage(final String message, final String color) { this.setMessage(message); this.setNotice(true); diff --git a/src/main/java/net/thauvin/erik/mobibot/msg/PrivateMessage.java b/src/main/java/net/thauvin/erik/mobibot/msg/PrivateMessage.java index b8a3541..18bf7a2 100644 --- a/src/main/java/net/thauvin/erik/mobibot/msg/PrivateMessage.java +++ b/src/main/java/net/thauvin/erik/mobibot/msg/PrivateMessage.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.msg; /** diff --git a/src/main/java/net/thauvin/erik/mobibot/msg/PublicMessage.java b/src/main/java/net/thauvin/erik/mobibot/msg/PublicMessage.java index d7556b1..d8ab1b2 100644 --- a/src/main/java/net/thauvin/erik/mobibot/msg/PublicMessage.java +++ b/src/main/java/net/thauvin/erik/mobibot/msg/PublicMessage.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.msg; /** diff --git a/src/test/java/net/thauvin/erik/mobibot/UtilsTest.java b/src/test/java/net/thauvin/erik/mobibot/UtilsTest.java index ba469d7..43193b5 100644 --- a/src/test/java/net/thauvin/erik/mobibot/UtilsTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/UtilsTest.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot; import org.jibble.pircbot.Colors; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/AbstractModuleTest.java b/src/test/java/net/thauvin/erik/mobibot/modules/AbstractModuleTest.java index 94e3fca..eb678c5 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/AbstractModuleTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/AbstractModuleTest.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/CalcTest.java b/src/test/java/net/thauvin/erik/mobibot/modules/CalcTest.java index b70450b..efb3f81 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/CalcTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/CalcTest.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import org.testng.annotations.Test; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/CurrencyConverterTest.java b/src/test/java/net/thauvin/erik/mobibot/modules/CurrencyConverterTest.java index a134ca4..34425c9 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/CurrencyConverterTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/CurrencyConverterTest.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import org.testng.annotations.Test; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/GoogleSearchTest.java b/src/test/java/net/thauvin/erik/mobibot/modules/GoogleSearchTest.java index d222eec..92d63ae 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/GoogleSearchTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/GoogleSearchTest.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.msg.Message; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/JokeTest.java b/src/test/java/net/thauvin/erik/mobibot/modules/JokeTest.java index edc821d..d62cd2e 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/JokeTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/JokeTest.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import org.testng.annotations.Test; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/LocalProperties.java b/src/test/java/net/thauvin/erik/mobibot/modules/LocalProperties.java index 3510285..2f96c16 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/LocalProperties.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/LocalProperties.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import org.testng.annotations.BeforeSuite; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/LookupTest.java b/src/test/java/net/thauvin/erik/mobibot/modules/LookupTest.java index eefe3e9..95288a5 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/LookupTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/LookupTest.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import org.testng.annotations.Test; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/ModuleExceptionTest.java b/src/test/java/net/thauvin/erik/mobibot/modules/ModuleExceptionTest.java index aa639e3..c058317 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/ModuleExceptionTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/ModuleExceptionTest.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import org.testng.annotations.DataProvider; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/PingTest.java b/src/test/java/net/thauvin/erik/mobibot/modules/PingTest.java index 81c4427..8dc6c8e 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/PingTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/PingTest.java @@ -29,11 +29,13 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import org.testng.annotations.Test; import static org.assertj.core.api.Assertions.assertThat; + /** * The <code>PingTest</code> class. * @@ -49,6 +51,6 @@ public class PingTest { @Test public void testPingsArray() { - assertThat(Ping.PINGS).as("Pings array is not empty.").isNotEmpty(); + assertThat(Ping.PINGS).as("Pings array is not empty.").isNotEmpty(); } } diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/StockQuoteTest.java b/src/test/java/net/thauvin/erik/mobibot/modules/StockQuoteTest.java index 7fbc87a..fc2ccec 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/StockQuoteTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/StockQuoteTest.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.msg.Message; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/Weather2Test.java b/src/test/java/net/thauvin/erik/mobibot/modules/Weather2Test.java index bcd4a66..97e395f 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/Weather2Test.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/Weather2Test.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import net.thauvin.erik.mobibot.msg.Message; diff --git a/src/test/java/net/thauvin/erik/mobibot/modules/WordTimeTest.java b/src/test/java/net/thauvin/erik/mobibot/modules/WordTimeTest.java index 97d420a..de5cd1f 100644 --- a/src/test/java/net/thauvin/erik/mobibot/modules/WordTimeTest.java +++ b/src/test/java/net/thauvin/erik/mobibot/modules/WordTimeTest.java @@ -29,6 +29,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package net.thauvin.erik.mobibot.modules; import org.testng.annotations.Test;