Skip to content
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

v2.5.x: Fixes #1096. Make Cell extend StructuralNode instead of ContentNode. #1101

Conversation

robertpanzer
Copy link
Member

@robertpanzer robertpanzer commented Jul 24, 2022

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

  • 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

@robertpanzer robertpanzer changed the title Fixes #1096. Make Cell extend StructuralNode instead of ContentNode. v2.5.x: Fixes #1096. Make Cell extend StructuralNode instead of ContentNode. Jul 24, 2022
@robertpanzer robertpanzer reopened this Jul 24, 2022
@robertpanzer robertpanzer merged commit 1882974 into asciidoctor:v2.5.x Jul 26, 2022
@robertpanzer robertpanzer deleted the fix-1096-2.5.x-cell-structuralnode branch July 26, 2022 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant