asciidoctor / asciidoctorj

:coffee: Java bindings for Asciidoctor. Asciidoctor on the JVM!
http://asciidoctor.org
Apache License 2.0
623 stars 173 forks source link

Accept null as empty content for load and convert #1148

Closed abelsromero closed 1 year ago

abelsromero commented 1 year ago

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

robertpanzer commented 1 year ago

Thank you!