• Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • Assets - Import
    • 2
    • 9
    • We collect Jira Service Desk feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Problem Definition

      We're coming across multiple {{NullPointerException}}s in Assets Import process assembler due to the code not being fully null-safe.

      Example:

      • JSDSERVER-15463
        • 2024-03-13 05:21:33,109+0000 insight-InsightThreadGroup-worker-thread-1814 ERROR jiraadmin     [c.r.j.p.i.s.analytics.service.ImportExportAnalyticsServiceImpl] Could not publish import result analytics
          java.lang.NullPointerException
                  at com.riadalabs.jira.plugins.insight.services.analytics.service.ImportExportAnalyticsServiceImpl.publishImportFinishedEvent(ImportExportAnalyticsServiceImpl.java:41)
                  at com.riadalabs.jira.plugins.insight.services.imports.common.DefaultImportService.finishProgress(DefaultImportService.java:1733)
                  at com.riadalabs.jira.plugins.insight.services.imports.common.DefaultImportService.doImportFromSource(DefaultImportService.java:873)
          
      • JSDSERVER-15678:
        • 2024-11-14 06:41:12,176+0000 http-nio-8080-exec-24 url: /jsm/rest/insight/1.0/progress/result/objectschema/2; user: admin ERROR admin 401x759x1 p8bdnl 172.29.187.89,172.50.0.3 /rest/insight/1.0/progress/result/objectschema/2 [c.r.j.p.i.c.w.a.r.exception.mapper.DefaultMapper] Unexpected exception was thrown while processing the request
          java.lang.NullPointerException: Cannot invoke "java.util.Date.toInstant()" because the return value of "com.riadalabs.jira.plugins.insight.services.imports.common.ImportResult.getStarted()" is null
          	at com.riadalabs.jira.plugins.insight.channel.web.api.rest.transformation.RestBeanAssemblerImpl.assembleImportResultEntry(RestBeanAssemblerImpl.java:599)
          	at com.riadalabs.jira.plugins.insight.channel.web.api.rest.services.progress.ProgressAssemblerInJira.assembleResultEntry(ProgressAssemblerInJira.java:42)
          	at com.riadalabs.jira.plugins.insight.channel.web.api.rest.services.progress.ProgressAssemblerBase.assembleProgressResultEntries(ProgressAssemblerBase.java:58)
          	at com.riadalabs.jira.plugins.insight.channel.web.api.rest.services.progress.ProgressResource.getAllProgressResultForObjectSchema(ProgressResource.java:341)
          

      And potentially more to come.

      Suggested Solution

      • Introduce null tests
      • Introduce null-safety to handle such NPEs more gracefully

            [JSDSERVER-15679] Introduce null-safety to Assets import result assembler

            SET Analytics Bot made changes -
            Support reference count Original: 8 New: 9
            SET Analytics Bot made changes -
            UIS Original: 1 New: 2
            SET Analytics Bot made changes -
            Support reference count New: 8
            SET Analytics Bot made changes -
            UIS Original: 0 New: 1
            Marc Dacanay made changes -
            Labels New: ril
            Marc Dacanay made changes -
            Remote Link New: This issue links to "Internal ticket (Web Link)" [ 978890 ]
            SET Analytics Bot made changes -
            UIS Original: 1 New: 0
            SET Analytics Bot made changes -
            UIS New: 1
            Suddha made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 964410 ]
            Suddha made changes -
            Link New: This issue causes JSDSERVER-15678 [ JSDSERVER-15678 ]

              Unassigned Unassigned
              smitra2@atlassian.com Suddha
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: