Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Correct infinite loops caused by CommentAdded
CommentAdded events were not be processed with the correct
gerritEvent() signature. This caused builds be triggered needlessly
and sometimes caused infinite loops between Jenkins and Gerrit.

This fix exposes the EventListener as a public class so that the Gerrit Events
Gerrit Handler can correctly invoke the appropriate methods.

This also corrects a NPE during a BuildStarted notification.

[JENKINS-23152]

Change-Id: Ief95fc05d5cf0a5d2e0dc95330e74bb6d52f425c
  • Loading branch information
Scott Hebert committed Feb 20, 2015
1 parent 060f2d9 commit 5604387
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -788,7 +788,7 @@ public AbstractProject getProject() {
@CheckForNull
public AbstractBuild getBuild() {
AbstractProject p = getProject();
if (p != null) {
if (p != null && build != null) {
return p.getBuild(build);
} else {
return null;
Expand Down
Expand Up @@ -58,7 +58,7 @@
*
* @author Robert Sandell <rsandell@cloudbees.com>.
*/
final class EventListener implements GerritEventListener {
public final class EventListener implements GerritEventListener {

private static final Logger logger = LoggerFactory.getLogger(EventListener.class);

Expand Down

0 comments on commit 5604387

Please sign in to comment.