Skip to content

Deprecate the parser hooks that will be retyped to SinkEventAttributes - #1094

Merged
slachiewicz merged 2 commits into
masterfrom
agent/deprecate-parser-hooks
Sep 3, 2026
Merged

slachiewicz merged 2 commits into
masterfrom
agent/deprecate-parser-hooks

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Marks the four hooks from #1074 that will be retyped to SinkEventAttributes in the next major.

The point is that the retype is a silent break: an override compiled against the old signature
stops overriding and is simply never called again, with nothing failing at build or run time.
A deprecation warning now is the only notice a downstream parser author gets. Of the five hooks
#1074 lists, only consecutiveSections was already marked.

Two things worth a reviewer's attention:

getAttributesFromParser is the weakest of the four. Its problem is only the return type, and all
seven call sites use nothing beyond the interface (getAttribute, addAttribute,
removeAttribute), so the eventual retype needs no caller changes at all. Nothing in the repo
overrides it either. So this one warns correct code to protect a hypothetical overrider — happy to
drop it from the set if you would rather.

Deprecating baseStartTag(String, ...) and baseEndTag(String, ...) also silences the
pre-existing impl.SinkEventAttributeSet warnings inside their bodies, because the JLS does not
warn for uses within a deprecated declaration. doxia-core goes from 84 deprecation warnings to 18.
Nothing was fixed; the warnings moved out of view. Flagging it so it is not mistaken for progress.

Verified: mvn verify green (japicmp, RAT, checkstyle, all tests); mvn javadoc:javadoc green with
0 errors and no warning on any added block; deprecation-warning counts compared against master
built to the identical reactor point.

Part of #1074

This change was created with AI assistance.

…yped

Retyping these to SinkEventAttributes is a silent break, not a loud one: an
override compiled against the old signature stops overriding and is simply
never called again, with nothing failing at build or run time. A deprecation
warning now is the only notice a downstream parser author gets before that.

Of the five hooks #1074 lists, only consecutiveSections was already marked.

Deprecating baseStartTag(String, ...) and baseEndTag(String, ...) also
silences the impl.SinkEventAttributeSet warnings inside their bodies, since
the JLS does not warn for uses within a deprecated declaration. That drops
doxia-core from 84 deprecation warnings to 18; nothing was fixed, the
warnings moved out of view.

Part of #1074
@slachiewicz slachiewicz added the deprecated Pull requests that deprecate features label Sep 3, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 3, 2026 22:29
@slachiewicz
slachiewicz merged commit 7bbfeba into master Sep 3, 2026
15 checks passed
@slachiewicz
slachiewicz deleted the agent/deprecate-parser-hooks branch September 3, 2026 23:04
@github-actions github-actions Bot added this to the 2.2.0 milestone Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecated Pull requests that deprecate features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant