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
[x] Bug fix
[ ] New non-breaking feature
[ ] New breaking feature
[ ] Documentation update
[ ] Build improvement
Description
What is the goal of this pull request?
Similar to #1099 this PR makes org.asciidoctor.ast.Cell extend StructuralNode instead of ContentNode.
This matches also the class hierarchy in Asciidoctor Ruby.
That way, if Document.findBy() returns a Cell in the result list there will no longer be a ClassCastException.
How does it achieve that?
Are there any alternative ways to implement this?
Probably.
Are there any implications of this pull request? Anything a user must know?
I'd like to argue that this is an almost fully compatible change that doesn't even break binary compatibility: https://docs.oracle.com/javase/specs/jls/se7/html/jls-13.html
Someone might have been able to write code that would now break (assert !StructuralNode.class.isInstance(cell)), but that can be said for any bugfix.
Please note that this PR is for the v2.5.x maintenance branch!!!
Issue
If this PR fixes an open issue, please add a line of the form:
Fixes #1096
Release notes
Please add a corresponding entry to the file CHANGELOG.adoc
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?
Similar to #1099 this PR makes org.asciidoctor.ast.Cell extend StructuralNode instead of ContentNode. This matches also the class hierarchy in Asciidoctor Ruby. That way, if Document.findBy() returns a Cell in the result list there will no longer be a ClassCastException.
How does it achieve that?
Are there any alternative ways to implement this?
Probably.
Are there any implications of this pull request? Anything a user must know?
I'd like to argue that this is an almost fully compatible change that doesn't even break binary compatibility: https://docs.oracle.com/javase/specs/jls/se7/html/jls-13.html Someone might have been able to write code that would now break (
assert !StructuralNode.class.isInstance(cell)
), but that can be said for any bugfix.Please note that this PR is for the v2.5.x maintenance branch!!!
Issue
If this PR fixes an open issue, please add a line of the form:
Fixes #1096
Release notes
Please add a corresponding entry to the file CHANGELOG.adoc