Skip to content

Retype the parser hooks that take SinkEventAttributeSet, then drop the deprecated class #1074

Description

@slachiewicz

New feature, improvement proposal

Follow-up to #1072 / #1073, which moves SinkEventAttributeSet to doxia-sink-api and leaves a deprecated subclass in org.apache.maven.doxia.sink.impl.

That deprecated class cannot be removed while these protected hooks in doxia-core still take or return it, so the deprecation cannot be fulfilled within 2.x:

  • AbstractXmlParser.getAttributesFromParser(XmlPullParser)
  • AbstractXmlParser.handleUnknown(String, SinkEventAttributeSet, Sink, int)
  • Xhtml5BaseParser.baseStartTag(String, SinkEventAttributeSet, Sink)
  • Xhtml5BaseParser.baseEndTag(String, SinkEventAttributeSet, Sink)
  • Xhtml5BaseParser.consecutiveSections(int, Sink, SinkEventAttributeSet)

They were left alone in #1073 on purpose. Retyping them is not a loud break but a silent one: a subclass compiled against the old signature stops overriding the method and is simply never called again, with no error at build or run time. Adding overloads does not help either, since the framework calls these, and it can only call one of them.

Proposal

For the next major version, retype them to take the SinkEventAttributes interface rather than a concrete attribute set. A parser hook has no reason to require the implementation type; everything these methods do with the argument is available on the interface. Then org.apache.maven.doxia.sink.impl.SinkEventAttributeSet has no remaining references and can go.

Worth doing in that order, and in a release where a signature change on protected extension points is expected, rather than trying to sneak either half into 2.x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions