Retype the parser hooks that take SinkEventAttributeSet, then drop the deprecated class
- Dominant language
- Java
- Stars
- 34
- Forks
- 54
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 16
Description
### 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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the five protected hooks in AbstractXmlParser and Xhtml5BaseParser within doxia-core, then inspect their callers and uses of SinkEventAttributes. Done means the hooks use the interface, the deprecated org.apache.maven.doxia.sink.impl.SinkEventAttributeSet has no remaining references, and the parser behavior remains covered by the project checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100