Integrated: 1291: NPE in org.openjdk.skara.issuetracker.Label.compareTo

Erik Joelsson erikj at
Mon Dec 20 22:47:59 UTC 2021

On Thu, 16 Dec 2021 22:37:01 GMT, Erik Joelsson <erikj at> wrote:

> Recently, we have started seeing NPEs being thrown in org.openjdk.skara.issuetracker.Label::compareTo when called from GitLabMergeRequest::links. This seems to be caused by adding of labels while the GitLabMergeRequest object is active. The labelNameToLabel map is initiated in the constructor based on the repository labels. This may get outdated while the GitLabMergeRequest instance is still alive. 
> This patch makes the initialization of the map lazy by wrapping all calls to the map in a private method. The map is re-initialized any time an element isn't found in it. I also added a filter on null labels before the sorting to avoid the NPE in case it still slips through.

This pull request has now been integrated.

Changeset: 87d9845d
Author:    Erik Joelsson <erikj at>
Stats:     24 lines in 1 file changed: 17 ins; 4 del; 3 mod

1291: NPE in org.openjdk.skara.issuetracker.Label.compareTo

Reviewed-by: kcr



More information about the skara-dev mailing list