Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NCL-8681] Retrieve the license information from Build Finder and add the licenses to the FinderResult #643

Merged
merged 4 commits into from
Jul 1, 2024

Conversation

vibe13
Copy link
Contributor

@vibe13 vibe13 commented Jun 28, 2024

No description provided.

@vibe13 vibe13 merged commit efb4bf1 into project-ncl:master Jul 1, 2024
8 checks passed
@vibe13 vibe13 deleted the NCL-8681 branch July 1, 2024 15:01
Comment on lines +68 to +72
Set<LicenseInfo> licenses = Optional.ofNullable(localArchive.getLicenses())
.orElse(Collections.emptySet())
.stream()
.map(FinderResultCreator::toDTO)
.collect(Collectors.toSet());
Copy link
Collaborator

@dwalluck dwalluck Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, getLicenses() should never return null. The default is initialized to an empty TreeSet, so you should be able to just simplify to localArchive.getLicenses().stream().

https://github.com/project-ncl/build-finder/blob/f28d5b17de194fd7e43132eb2282fbbc2a5ac2c3/core/src/main/java/org/jboss/pnc/build/finder/koji/KojiLocalArchive.java#L44-L65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants