Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>instant-messaging-parent</artifactId>
<version>1.25</version>
<version>1.28-SNAPSHOT</version>
<relativePath>../instant-messaging-parent-plugin/pom.xml</relativePath>
</parent>

Expand All @@ -23,7 +23,7 @@
</licenses>

<properties>
<version.instant-messaging.plugin>1.35</version.instant-messaging.plugin>
<version.instant-messaging.plugin>1.36-SNAPSHOT</version.instant-messaging.plugin>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/hudson/plugins/ircbot/IrcPublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ private static List<JSONObject> fillChannelsFromJSON(JSONObject root){
/**
* @see hudson.model.Descriptor#configure(org.kohsuke.stapler.StaplerRequest)
*/
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
this.scrambledPasswords = true;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/ircbot/v2/IRCColorizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static String colorize(String message){
return message;
} else {
String line = colorForBuildResult(message);
if (line == message) { // line didn't contain a build result
if (line.equals(message)) { // line didn't contain a build result
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if line is null? I was elsewhere advised to use comparisons rather than .equals() with a risk of NPE (or make the nullness checks explicit).

Matcher m = TEST_CLASS_PATTERN.matcher(message);
if (m.matches()){
return Colors.BOLD + Colors.MAGENTA + line;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/hudson/plugins/ircbot/v2/IRCConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public IRCConnection(DescriptorImpl descriptor, AuthenticationHolder authenticat
config.setMessageDelay(this.descriptor.getMessageRate());
config.setEncoding(Charset.forName(this.descriptor.getCharset()));

this.listener = new PircListener(this.pircConnection, this.descriptor.getNick());
this.listener = new PircListener(this.descriptor.getNick());
this.listener.addJoinListener(this);
this.listener.addInviteListener(this);
this.listener.addPartListener(this);
Expand All @@ -137,7 +137,7 @@ public IRCConnection(DescriptorImpl descriptor, AuthenticationHolder authenticat

cfg = config;
}

//@Override
public void close() {
this.listener.explicitDisconnect = true;
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/hudson/plugins/ircbot/v2/PircListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
* @author kutzi (original)
* @author $Author: kutzi $ (last change)
*/
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("DM_STRING_CTOR")
public class PircListener extends ListenerAdapter<PircBotX> {

private static final Logger LOGGER = Logger.getLogger(PircListener.class.getName());

@SuppressWarnings(value = "DM_STRING_CTOR", justification = "we want a new instance here to enable reference comparison")

public static final String CHAT_ESTABLISHER = new String("<<<ChatEstablisher>>>");

private final List<IMConnectionListener> listeners = new CopyOnWriteArrayList<IMConnectionListener>();
Expand All @@ -55,11 +55,9 @@ public class PircListener extends ListenerAdapter<PircBotX> {


@java.lang.SuppressWarnings("unused")
private final PircBotX pircBot;
private final String nick;

public PircListener(PircBotX pircBot, String nick) {
this.pircBot = pircBot;
public PircListener(String nick) {
this.nick = nick;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:super="/hudson/plugins/im/IMPublisher">
<!--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:super="/hudson/plugins/im/IMPublisher">
<f:section title="IRC Notification">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:entry title="IRC Nick"
description="Your IRC Nick">
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/index.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Since we don't really have anything dynamic here, let's just use static HTML.
-->
<?jelly escape-by-default='true'?>
<div>
<p>This plugin is an IRC bot that can publish build results to IRC channels.</p>
<p>Note that the <b>instant-messaging plugin ${version.instant-messaging.plugin}</b> is required for this plugin.
Expand Down