Accept null as empty content for load and convert #1148
Merged
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.
Both empty and null String are accepted as valid for load/convert methods for safety.
Fixes #1146
Thank you for opening a pull request and contributing to AsciidoctorJ!
Please take a bit of time giving some details about your pull request:
Kind of change
Description
What is the goal of this pull request?
Simply adds some extra consistency and safety to load and convert methods.
There are also some javadoc fixes and test refactors.
How does it achieve that?
Adds additional validations in case of nulls.
Are there any alternative ways to implement this?
We could consider null an invalid value as now and try to fail with a user friendly message.
But semantically null and empty string are the same here imho.
Are there any implications of this pull request? Anything a user must know?
No, I think it should be unnoticed by most users.
Issue
If this PR fixes an open issue, please add a line of the form:
Fixes #Issue
Fixes #1146
Release notes
Please add a corresponding entry to the file CHANGELOG.adoc