Fix #358, #352 NPE on site generation caused by null returned by deprecated MavenProject.getDependencyArtifacts()#373
Merged
slawekjaranowski merged 6 commits intoJul 3, 2023
Conversation
…precated MavenProject.getDependencyArtifacts()
…precated MavenProject.getDependencyArtifacts()
Contributor
|
@tomred-net hi, sound a nice patch. But i can't accept it like this, the format of files has changed, and should not. thanks |
|
@tomred-net can you make the change requested by @tchemit ? |
Contributor
Author
|
@mistic100 happy to make the change but I can't see what format has changed beyond the changes required for the bug fix. @tchemit can you be specific about what formatting you are unhappy with? |
Contributor
Author
|
@mistic100 @tchemit I have tabbed a couple of lines to make it look like it did before. Let me know if there is anything else you would like updated. |
Member
|
files mode was changed |
…-generation-fork # Conflicts: # src/main/java/org/codehaus/mojo/license/AbstractThirdPartyReportMojo.java # src/main/java/org/codehaus/mojo/license/AddThirdPartyMojo.java # src/main/java/org/codehaus/mojo/license/AggregateDownloadLicensesMojo.java # src/main/java/org/codehaus/mojo/license/DownloadLicensesMojo.java # src/main/java/org/codehaus/mojo/license/LicensesXmlInsertVersionsMojo.java # src/main/java/org/codehaus/mojo/license/utils/MojoHelper.java
This was
linked to
issues
Jul 3, 2023
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix resolves the NPE by adding a check for the null and replacing with an empty set in the case where the deprecated MavenProject.getDependencyArtifacts() returns null.
It should be noted that this PR does not resolve the fact that MavenProject.getDependencyArtifacts() is deprecated. This PR also does not suggest an alternative source of non-transitive dependencies.
This PR puts in a check and returns the code and accompanying test case to a runnable state. Unfortunately many artifact related method on MavenProject are now deprecated but without reference to an alternative source of functionality offered.