You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2022/10/28 11:10:00 UTC
[jira] [Commented] (MCHANGES-413) Jira report throws NPE when the resolution field is missing the "name" attribute
[ https://issues.apache.org/jira/browse/MCHANGES-413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17625614#comment-17625614 ]
Gary D. Gregory commented on MCHANGES-413:
------------------------------------------
I'd prefer the plugin be made more resilient. It's quite the debugging hunt for anyone else to track this down when using the plugin as a plain user.
> Jira report throws NPE when the resolution field is missing the "name" attribute
> --------------------------------------------------------------------------------
>
> Key: MCHANGES-413
> URL: https://issues.apache.org/jira/browse/MCHANGES-413
> Project: Maven Changes Plugin
> Issue Type: Bug
> Components: jira
> Affects Versions: 2.12.1
> Reporter: Alex Herbert
> Priority: Trivial
>
> The `jira-report` goal throws a NullPointerException when the resolution JsonNode has no "name" attribute.
> At Commons BCEL we had some tickets that were created from external issues. The priority field was set to an enum in [P0, P1, P2, P3, P4, P5]. See for example [BCEL-4|https://issues.apache.org/jira/projects/BCEL/issues/BCEL-4]. This field did not use the standard [Major, Minor, etc] and may have been a custom field. (The details of how these tickets were created is unknown.) The "standard" priority field was missing and the data downloaded by the \{{RestJiraDownloader}} had no "name" attribute for this node. Thus the NPE from this line:
> {code:java}
> // Note: val is not null here
> issue.setPriority( val.get( "name" ).asText() );{code}
> Patching the latest maven-changes-plugin to print all these offending tickets allowed them to be identified and corrected by adding a "standard" priority. In the example mentioned (BCEL-4) there are still two priority fields in the ticket.
> Note that when the missing priority was ignored the Jira report completed successfully.
> The solution is either:
> * Patch the RestJiraDownloader to be robust to this field missing the expected data
> * Label as not-a-bug because this field is mandatory and BCEL has somehow created invalid Jira tickets in the past
--
This message was sent by Atlassian Jira
(v8.20.10#820010)