[JIRA] (JENKINS-38974) Comment Added event crashes with NullPointerException

2016-11-28 Thread tobias.ur...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Tobias Urdin commented on  JENKINS-38974  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Comment Added event crashes with NullPointerException   
 

  
 
 
 
 

 
 Hello Dan, Thanks for fixing this issue! Best regards  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-38974) Comment Added event crashes with NullPointerException

2016-11-27 Thread scm_issue_l...@java.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 SCM/JIRA link daemon commented on  JENKINS-38974  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Comment Added event crashes with NullPointerException   
 

  
 
 
 
 

 
 Code changed in jenkins User: Robert Sandell Path: src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTrigger.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/spec/BackCompat2173JenkinsTest.java http://jenkins-ci.org/commit/gerrit-trigger-plugin/579b5bdfa17430134d3fd50d3c72dbd0393a2336 Log: Merge pull request #301 from beaker-project/JENKINS-38974-commentTextParameterMode-NPE JENKINS-38974 fill in commentTextParameterMode if it's missing Compare: https://github.com/jenkinsci/gerrit-trigger-plugin/compare/166b26cf6c3c...579b5bdfa174  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-38974) Comment Added event crashes with NullPointerException

2016-11-27 Thread scm_issue_l...@java.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 SCM/JIRA link daemon commented on  JENKINS-38974  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Comment Added event crashes with NullPointerException   
 

  
 
 
 
 

 
 Code changed in jenkins User: Dan Callaghan Path: src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTrigger.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/spec/BackCompat2173JenkinsTest.java http://jenkins-ci.org/commit/gerrit-trigger-plugin/814b85b771c9abdbca0273b6aa9bb8064762fef4 Log: JENKINS-38974 fill in commentTextParameterMode if it's missing Any existing jobs which were configured before this option was added (or jobs uploaded as raw XML produced by Jenkins Job Builder, for example) will not have . Ensure it is filled in with the default value to avoid a NullPointerException later in the comment event handling.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-38974) Comment Added event crashes with NullPointerException

2016-11-24 Thread d...@djc.id.au (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dan C commented on  JENKINS-38974  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Comment Added event crashes with NullPointerException   
 

  
 
 
 
 

 
 BTW the above commit from Andres Rodriguez seems to be totally unrelated...  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-38974) Comment Added event crashes with NullPointerException

2016-11-24 Thread d...@djc.id.au (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dan C commented on  JENKINS-38974  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Comment Added event crashes with NullPointerException   
 

  
 
 
 
 

 
 Here is a PR including reproducer: https://github.com/jenkinsci/gerrit-trigger-plugin/pull/301 Not sure if that's really the best place for the test though... Also, this has the downside of still requiring every job definition to be re-saved in order to avoid the NPE. I wonder if it might also be worthwhile to be defensive on the opposite side when handling the comment-added event, to use PLAIN if the option is set to null?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-38974) Comment Added event crashes with NullPointerException

2016-11-24 Thread d...@djc.id.au (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dan C commented on  JENKINS-38974  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Comment Added event crashes with NullPointerException   
 

  
 
 
 
 

 
 Scratch that... doesn't require every job to be re-saved, I didn't realise that that readResolve() method magically fixes up any existing job definitions when the plugin is upgraded.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-38974) Comment Added event crashes with NullPointerException

2016-11-24 Thread d...@djc.id.au (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dan C commented on  JENKINS-38974  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Comment Added event crashes with NullPointerException   
 

  
 
 
 
 

 
 The problem seems to be that  is missing from existing job definitions. It's also not filled in by the plugin when an XML job definition is saved (for example when using Jenkins Job Builder, which doesn't generate any of the *ParameterMode elements). When that option is missing from the job definition the getter is returning null which means that commentTextMode is null in this block: 

 

if (event instanceof CommentAdded) {
String comment = ((CommentAdded)event).getComment();
if (comment != null) {
commentTextMode.setOrCreateParameterValue(GERRIT_EVENT_COMMENT_TEXT,
parameters, comment, ParameterMode.PlainMode.TEXT, escapeQuotes);
}
}
 

 I see that in commit e94a36e0 there is some special handling for changeSubjectParameterMode, when it was added, to ensure that the default is filled in to the job definition. I guess a similar thing should have been done for commentTextParameterMode.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from 

[JIRA] (JENKINS-38974) Comment Added event crashes with NullPointerException

2016-10-14 Thread scm_issue_l...@java.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 SCM/JIRA link daemon commented on  JENKINS-38974  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Comment Added event crashes with NullPointerException   
 

  
 
 
 
 

 
 Code changed in jenkins User: Andres Rodriguez Path: src/main/java/org/jenkinsci/test/acceptance/po/PluginManager.java http://jenkins-ci.org/commit/acceptance-test-harness/f21bd79aaf72fda43caa2c4036eca7eacc18fae9 Log: Merge pull request #204 from andresrc/JENKINS-38794-not-null JENKINS-38974 Required version can be null Compare: https://github.com/jenkinsci/acceptance-test-harness/compare/4fe2d2b7479d...f21bd79aaf72  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-38974) Comment Added event crashes with NullPointerException

2016-10-14 Thread scm_issue_l...@java.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 SCM/JIRA link daemon commented on  JENKINS-38974  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Comment Added event crashes with NullPointerException   
 

  
 
 
 
 

 
 Code changed in jenkins User: Andres Rodriguez Path: src/main/java/org/jenkinsci/test/acceptance/po/PluginManager.java http://jenkins-ci.org/commit/acceptance-test-harness/2a9789069cdb9f8d7b99524564fb24b6208e0aac Log: JENKINS-38974 Required version can be null  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-38974) Comment Added event crashes with NullPointerException

2016-10-13 Thread tobias.ur...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Tobias Urdin created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-38974  
 
 
  Comment Added event crashes with NullPointerException   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 rsandell  
 
 
Components: 
 gerrit-trigger-plugin  
 
 
Created: 
 2016/Oct/13 8:56 PM  
 
 
Environment: 
 Debian 8   root@jenkins:~# dpkg -l | grep -i jenkins  ii jenkins 2.19.1 all continuous integration system   Gerrit-trigger plugin 2.22.0  
 
 
Priority: 
  Major  
 
 
Reporter: 
 Tobias Urdin  
 

  
 
 
 
 

 
 When a "comment added" event is detected it crashes with a NullException, see below. I also saw the following warning message: WARNING: No GerritHandler was specified, won't register as event listener, so no function. It looks like the whole thing is caused when a Null GerritHandler gets passed here. https://github.com/jenkinsci/gerrit-trigger-plugin/blob/master/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/replication/ReplicationQueueTaskDispatcher.java#L107 Here is logg when it crashes on a comment added event: INFO: Project [] triggered by Gerrit: [com.sonymobile.tools.gerrit.gerritevents.dto.events.CommentAdded@58561316] Oct 13, 2016 10:36:47 PM com.sonymobile.tools.gerrit.gerritevents.GerritHandler notifyListener SEVERE: Exception thrown during event handling. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.sonymobile.tools.gerrit.gerritevents.GerritHandler.notifyListener(GerritHandler.java:316) at com.sonymobile.tools.gerrit.gerritevents.GerritHandler.notifyListeners(GerritHandler.java:296) at