-
Notifications
You must be signed in to change notification settings - Fork 41
Call SpdxModelFactory::init when constructing LicenseCreatorAgent
#287
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
Conversation
|
It appears that the creation of a I think that this is the only place in the code where this occurs since the other classes which call |
I'm not sure if this path will always be taken - it's possible to create an SPDX model without a reference to a license or listed license I haven't been able to come up with a single entrypoint to hook the init to. |
|
It could still be possible to have it here as a guard to initialize it if it hasn't been initialized already and keep best practices to call it manually. At least for the library code itself, it has to be initialized here or it throws an exception. To put it another way, it has to be initialized by the time we get here, so why not call it rather than fail? As long as it's not being called too early, it seems harmless to me. At least in my usage, it removes the need to call it manually, but as you said, depending upon the use case, the caller may need to do it. |
@dwalluck - I agree with your logic. We should add a comment to this effect in the code - I'll make a proposal in a review comment. |
goneall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposed comment clarification
Signed-off-by: Gary O'Neall <[email protected]>
goneall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
I added some documentation in #286 I'll go ahead and merge this PR. |
Is something like this possible? It could remove the need to manually call
SpdxModelFactory::init.