Checkstyle fixes.

This commit is contained in:
Erik C. Thauvin 2019-04-17 00:23:02 -07:00
parent 7c724db67e
commit 64ffd95aba
48 changed files with 512 additions and 118 deletions

View file

@ -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

View file

@ -0,0 +1,267 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the Google coding conventions from Google Java Style
that can be found at https://google.github.io/styleguide/javaguide.html.
Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.sf.net (or in your downloaded distribution).
To completely disable a check, just comment it out or delete it from the file.
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
-->
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<property name="fileExtensions" value="java, properties, xml"/>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="SuppressWarningsFilter"/>
<module name="TreeWalker">
<module name="SuppressWarningsHolder"/>
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message"
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
</module>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="LineLength">
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="NeedBraces"/>
<module name="LeftCurly"/>
<module name="RightCurly">
<property name="id" value="RightCurlySame"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
LITERAL_DO"/>
</module>
<module name="RightCurly">
<property name="id" value="RightCurlyAlone"/>
<property name="option" value="alone"/>
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
INSTANCE_INIT"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="UpperEll"/>
<module name="ModifierOrder"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapDot"/>
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapComma"/>
<property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/258 -->
<property name="id" value="SeparatorWrapEllipsis"/>
<property name="tokens" value="ELLIPSIS"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/259 -->
<property name="id" value="SeparatorWrapArrayDeclarator"/>
<property name="tokens" value="ARRAY_DECLARATOR"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapMethodRef"/>
<property name="tokens" value="METHOD_REF"/>
<property name="option" value="nl"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LambdaParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="CatchParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="4"/>
<property name="throwsIndent" value="4"/>
<property name="lineWrappingIndentation" value="4"/>
<property name="arrayInitIndent" value="4"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="1"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="CustomImportOrder">
<property name="customImportOrderRules"
value="THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STANDARD_JAVA_PACKAGE###STATIC"/>
<property name="specialImportsRegExp" value="^javax\."/>
<property name="standardPackageRegExp" value="^java\."/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="false"/>
</module>
<module name="MethodParamPad"/>
<module name="NoWhitespaceBefore">
<property name="tokens"
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="ParenPad"/>
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens"
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationMostCases"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationVariables"/>
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocParagraph"/>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
<module name="CommentsIndentation"/>
</module>
</module>

View file

@ -1,5 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA">
<option name="configuration">
<map>
<entry key="active-configuration" value="LOCAL_FILE:$PROJECT_DIR$/config/checkstyle/checkstyle.xml:Erik's Checks" />
<entry key="checkstyle-version" value="8.19" />
<entry key="copy-libs" value="true" />
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
<entry key="location-2" value="LOCAL_FILE:$PROJECT_DIR$/config/checkstyle/checkstyle.xml:Erik's Checks" />
<entry key="scan-before-checkin" value="false" />
<entry key="scanscope" value="JavaOnlyWithTests" />
<entry key="suppress-errors" value="false" />
</map>
</option>
</component>
<component name="ClientPropertiesManager">
<properties class="javax.swing.AbstractButton">
<property name="hideActionText" class="java.lang.Boolean" />
@ -47,7 +62,6 @@
<element module="Source" copyright="Copyright" />
</module2copyright>
<LanguageOptions name="JAVA">
<option name="fileTypeOverride" value="3" />
<option name="addBlankAfter" value="false" />
</LanguageOptions>
<LanguageOptions name="__TEMPLATE__">
@ -55,7 +69,7 @@
</LanguageOptions>
</component>
<component name="DependencyValidationManager">
<scope name="Source" pattern="(file[mobibot]:src/generated/java//*.java||file[mobibot]:src/main/java//*.java||file[mobibot]:src/test/java//*.java)&amp;&amp;!file[mobibot]:src/main/java/net/thauvin/erik/mobibot/TwitterOAuth.java" />
<scope name="Copryight" pattern="(file[mobibot]:src/generated/java//*.java||file[mobibot]:src/main/java//*.java||file[mobibot]:src/test/java//*.java)&amp;&amp;!file[mobibot]:src/main/java/net/thauvin/erik/mobibot/TwitterOAuth.java" />
</component>
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />

View file

@ -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;
/**

View file

@ -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());

View file

@ -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;

View file

@ -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<SyndCategory> 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<SyndCategory> tags) {
this.tags.addAll(tags);
}
/**
* Returns a string representation of the object.
*

View file

@ -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;

View file

@ -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: <command>
else if (message.matches(getNickPattern() + ":.*")) {
} else if (message.matches(getNickPattern() + ":.*")) { // mobibot: <command>
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: <channel>
else if (cmd.equalsIgnoreCase(channel.substring(1))) {
} else if (cmd.equalsIgnoreCase(channel.substring(1))) { // mobibot: <channel>
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:<comment>, L1:-, L1:|<title>, 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

View file

@ -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;

View file

@ -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();
}
}
/**

View file

@ -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;

View file

@ -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.");
}

View file

@ -17,7 +17,7 @@ import java.io.InputStreamReader;
* Then execute:
* <p>
* <code>
* java -cp "mobibot.jar:lib/*"net.thauvin.erik.mobibot.TwitterOAuth &lt;consumerKey&gt; &lt;consumerSecret&gt;
* java -cp "mobibot.jar:lib/*" net.thauvin.erik.mobibot.TwitterOAuth &lt;consumerKey&gt; &lt;consumerSecret&gt;
* </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 {

View file

@ -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.

View file

@ -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.

View file

@ -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;

View file

@ -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++;
}

View file

@ -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;

View file

@ -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;

View file

@ -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 {

View file

@ -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);

View file

@ -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(']');
}

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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)) {

View file

@ -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));
}
/**

View file

@ -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);

View file

@ -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;
}
}

View file

@ -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);

View file

@ -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;
/**

View file

@ -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;
/**

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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();
}
}

View file

@ -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;

View file

@ -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;

View file

@ -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;