This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-930f35ca-3647-4053-bbe9-bf14e0eae1ec XWIKI-25811 Open

XarInstalledExtensionRepository#getBackwardDependencies returns null instead of an empty collection for non-XAR extensions

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-00d24cdc-5696-405b-af18-889ed0a07d8b Thomas Mortagne created this issue on 20/Nov/26 09:23
 
Summary: XarInstalledExtensionRepository#getBackwardDependencies returns null instead of an empty collection for non-XAR extensions
Issue Type: cid:jira-generated-image-avatar-930f35ca-3647-4053-bbe9-bf14e0eae1ec Bug
Affects Versions: 8.1-milestone-2
Assignee: Unassigned
Components: Extension - XAR
Created: 20/Nov/26 09:23
Priority: cid:jira-generated-image-static-major-a1b41e0a-6c7d-4ca6-968c-830168e943dd Major
Reporter: Thomas Mortagne
Description:

The xar InstalledExtensionRepository component (XarInstalledExtensionRepository) returns null from both getBackwardDependencies methods when the extension is not a XAR extension. The InstalledExtensionRepository contract says these methods return an empty collection when no backward dependency is found, so code that gets this repository through the generic role and calls isEmpty() or iterates over the result fails with a NullPointerException.

In addition, getBackwardDependencies(ExtensionId, boolean withOptional) ignores withOptional: it always calls getBackwardDependencies(ExtensionId), so optional backward dependencies are never returned for a XAR extension.

Expected

  • An empty collection (or map) is returned for an extension which is not a XAR.
  • withOptional is passed through to the underlying repository.

SonarCloud reports this as possible NullPointerException}}s in callers such as {{OrphanedExtensionsResolver (rule javabugs:S2259).

 
 

1 update

 
cid:jira-generated-image-avatar-00d24cdc-5696-405b-af18-889ed0a07d8b Changes by Thomas Mortagne on 20/Nov/26 09:23
 
Assignee: Thomas Mortagne