Bug 451148 - NPE when retrieving certain SubmitRecords against Gerrit 2.9.1
Summary: NPE when retrieving certain SubmitRecords against Gerrit 2.9.1
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 2.5   Edit
Assignee: Miles Parker CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
: 453455 (view as bug list)
Depends on:
Blocks: 437825
  Show dependency tree
 
Reported: 2014-11-12 08:46 EST by Ron Peters CLA
Modified: 2014-12-11 19:16 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Peters CLA 2014-11-12 08:46:31 EST
Retrieving Reviews in a specific case causes a NPE against Gerrit 2.9.

As stated in https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-record , the field "need" contains a Map of labels that need to be given to submit. The value is currently an empty object.

This case is treated by the code as if it contains a Map of Labels with AccountInfos (GerritClient line 554 - 564) and causes a NPE.

Stacktrace (Line numbers may be slightly different a I use a local build with changes that are not yet submitted)
java.lang.NullPointerException
	at org.eclipse.mylyn.internal.gerrit.core.client.compat.SubmitRecord.createLabel(SubmitRecord.java:105)
	at org.eclipse.mylyn.internal.gerrit.core.client.GerritClient.currentSubmitRecord29(GerritClient.java:559)
	at org.eclipse.mylyn.internal.gerrit.core.client.GerritClient.getChangeDetail29(GerritClient.java:503)
	at org.eclipse.mylyn.internal.gerrit.core.client.GerritClient.getChangeDetail(GerritClient.java:610)
	at org.eclipse.mylyn.internal.gerrit.core.client.GerritClient.getChange(GerritClient.java:966)
	at org.eclipse.mylyn.internal.gerrit.core.remote.GerritReviewRemoteFactory.pull(GerritReviewRemoteFactory.java:91)
	at org.eclipse.mylyn.internal.gerrit.core.remote.GerritReviewRemoteFactory.pull(GerritReviewRemoteFactory.java:1)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.RemoteEmfConsumer.pull(RemoteEmfConsumer.java:128)
	at org.eclipse.mylyn.reviews.core.spi.remote.JobRemoteService$1.run(JobRemoteService.java:61)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Ron Peters CLA 2014-11-12 09:29:33 EST
While trying to fix this I ran into another NPE that might be another case.
I don't have time to look further into this today.

Writing a test case against the vm that reproduces this NPE would need a -2 against the remote Gerrit, that is currently not possible but will be after https://git.eclipse.org/r/#/c/36306/ or something similar is submitted and the vm is rebuilt with the changed settings.
Comment 2 Sam Davis CLA 2014-11-12 14:53:51 EST
Ron, are you planning to work on this? If so I'll assign to you.
Comment 3 Ron Peters CLA 2014-11-12 15:04:29 EST
I'd like to sort out issues with my other change first, so this might take some days. If there is no one else in between I can do this. We use 2.9.1 daily, have 2000+ Reviews done since we set it up and will run into some more issues for sure ;)
Comment 4 Sam Davis CLA 2014-11-12 15:38:55 EST
Ok, great. Out of curiosity, do you have any idea how many users you have using the Gerrit connector?
Comment 5 Ron Peters CLA 2014-11-13 07:07:39 EST
Currently we have 6 - 10 users on our Gerrit server that also use Eclipse with the plugin. That might go up to 80+ once other teams decide to use Gerrit in their process.
Comment 6 Ron Peters CLA 2014-11-14 11:17:25 EST
https://git.eclipse.org/r/36491
Comment 7 Sam Davis CLA 2014-12-04 13:55:27 EST
Ron, thanks for working on this. Since I haven't heard from you for a while, for now I'm assigning to mylyn-triaged so that somebody else can pick it up. It may be that we just need to merge your fix.
Comment 8 Ron Peters CLA 2014-12-08 11:58:12 EST
I'm ok with that. I can't promise to keep up - as I'm still under some heavy workload.
Comment 9 Miles Parker CLA 2014-12-08 12:33:43 EST
No worries at all, we appreciate what you've done so far..we're just going to try to get this into 3.14, these will be the last two fixes included.
Comment 10 Miles Parker CLA 2014-12-09 16:57:21 EST
Merged, thanks for another really helpful contribution Ron!
Comment 11 Miles Parker CLA 2014-12-09 16:58:02 EST
.
Comment 12 Sam Davis CLA 2014-12-11 19:16:43 EST
*** Bug 453455 has been marked as a duplicate of this bug. ***