Code cleanup.
This commit is contained in:
parent
43e31ddf63
commit
19898d2c1c
6 changed files with 10 additions and 9 deletions
|
@ -4,6 +4,7 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
|
||||
<description>Erik's Ruleset</description>
|
||||
<!-- BEST PRACTICES -->
|
||||
<rule ref="category/java/bestpractices.xml/AvoidStringBufferField"/>
|
||||
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
|
||||
<rule ref="category/java/bestpractices.xml/CheckResultSet"/>
|
||||
|
|
|
@ -99,7 +99,7 @@ import java.util.StringTokenizer;
|
|||
* @since 1.0
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Version(properties = "version.properties", template = "mobibot.mustache", className = "ReleaseInfo")
|
||||
@Version(properties = "version.properties", className = "ReleaseInfo")
|
||||
public class Mobibot extends PircBot {
|
||||
|
||||
// The default port.
|
||||
|
@ -1653,10 +1653,9 @@ public class Mobibot extends PircBot {
|
|||
* @param isPrivate Set to <code>true</code> if the response should be sent as a private message.
|
||||
*/
|
||||
private void viewResponse(final String sender, final String args, final boolean isPrivate) {
|
||||
String lcArgs = args.toLowerCase(Constants.LOCALE);
|
||||
|
||||
if (!entries.isEmpty()) {
|
||||
final int max = entries.size();
|
||||
String lcArgs = args.toLowerCase(Constants.LOCALE);
|
||||
int i = 0;
|
||||
|
||||
if ((lcArgs.length() <= 0) && (max > MAX_ENTRIES)) {
|
||||
|
|
|
@ -54,6 +54,7 @@ import java.nio.file.Files;
|
|||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -99,7 +100,7 @@ public final class EntriesMgr {
|
|||
* @throws IOException If the file was not found or could not be read.
|
||||
* @throws FeedException If an error occurred while reading the feed.
|
||||
*/
|
||||
public static void loadBacklogs(final String file, final List<String> history)
|
||||
public static void loadBacklogs(final String file, final Collection<String> history)
|
||||
throws IOException, FeedException {
|
||||
history.clear();
|
||||
|
||||
|
@ -131,7 +132,7 @@ public final class EntriesMgr {
|
|||
* @throws FeedException If an error occurred while reading the feed.
|
||||
*/
|
||||
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
|
||||
public static String loadEntries(final String file, final String channel, final List<EntryLink> entries)
|
||||
public static String loadEntries(final String file, final String channel, final Collection<EntryLink> entries)
|
||||
throws IOException, FeedException {
|
||||
entries.clear();
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ import java.time.LocalDateTime;
|
|||
*/
|
||||
public class EntryComment implements Serializable {
|
||||
// The serial version UID.
|
||||
static final long serialVersionUID = 6957415292233553224L;
|
||||
static final long serialVersionUID = 1L;
|
||||
|
||||
// The creation date.
|
||||
private final LocalDateTime date = LocalDateTime.now();
|
||||
|
|
|
@ -52,7 +52,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||
*/
|
||||
public class EntryLink implements Serializable {
|
||||
// The serial version UID.
|
||||
static final long serialVersionUID = 3676245542270899086L;
|
||||
static final long serialVersionUID = 1L;
|
||||
|
||||
// The link's comments
|
||||
private final List<EntryComment> comments = new CopyOnWriteArrayList<>();
|
||||
|
|
|
@ -45,7 +45,7 @@ import java.util.regex.Pattern;
|
|||
* @since 1.0
|
||||
*/
|
||||
public class ModuleException extends Exception {
|
||||
private static final long serialVersionUID = -3036774290621088107L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final String debugMessage;
|
||||
private final Pattern urlPattern = Pattern.compile("(https?://\\S+)(\\?\\S+)");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue