Hi devs,
Since this is about removing public APIs I need to send a vote.
While looking at org.xwiki.rendering.wikimodel.xwiki.* in xwiki-rendering-wikimodel, I noticed that the WikiModel serializers are dead code. They came in with the original WikiModel import (XRENDERING-173, 2011) and were never wired to anything: XWiki serializes through the Renderer/Listener implementations in xwiki-rendering-syntaxes (e.g. XWikiSyntaxRenderer), never through WikiModel’s own serializers.
So I propose to remove these 4 classes:
org.xwiki.rendering.wikimodel.IWikiSerializer(34 lines) — interface with no implementors and no callersorg.xwiki.rendering.wikimodel.jspwiki.JspWikiSerializer(463 lines) — its javadoc literally says “Not ready yet.”org.xwiki.rendering.wikimodel.xwiki.xwiki10.XWikiSerializer(185 lines) — XWiki 1.0 syntax serializerorg.xwiki.rendering.wikimodel.xwiki.xwiki20.XWikiSerializer2(666 lines) — XWiki 2.0 syntax serializer
That’s ~1350 lines. I checked xwiki-rendering, xwiki-commons, xwiki-platform and the xwiki-contrib repos I have locally, and there isn’t a single reference to any of them. The only mentions anywhere are the two @see javadoc tags with which XWikiSerializer and XWikiSerializer2 point at each other.
To be clear, the rest of org.xwiki.rendering.wikimodel.xwiki.* stays: xwiki20.XWikiParser, xwiki21.XWikiParser, xwiki20.XWikiReferenceParser, xwiki20.XWikiScannerUtil and xwiki20.XWikiWikiParameters are all very much alive — the XWiki 2.0/2.1 parsers in xwiki-rendering-syntaxes delegate to them, and the JavaCC scanners import them.
I don’t think these 4 are worth moving to xwiki-rendering-legacy-wikimodel: they’re standalone leaf classes (nothing extends or implements them inside the codebase), and if someone really does use one, the 18.6.0 jar can still be added manually. So I’d go with a Revapi ignore in the root pom.xml:
<item>
<ignore>true</ignore>
<code>java.class.removed</code>
<old>interface org.xwiki.rendering.wikimodel.IWikiSerializer</old>
<criticality>highlight</criticality>
<justification>Unused WikiModel serializer API. XWiki serializes through the Renderer/Listener implementations
in xwiki-rendering-syntaxes, never through WikiModel's serializers. This interface was imported with
WikiModel in XRENDERING-173 and has never had an implementor nor a caller.</justification>
</item>
<item>
<ignore>true</ignore>
<code>java.class.removed</code>
<old>class org.xwiki.rendering.wikimodel.jspwiki.JspWikiSerializer</old>
<criticality>highlight</criticality>
<justification>Unused WikiModel serializer, never completed (its javadoc says "Not ready yet.") and never
called. JSPWiki rendering is handled by xwiki-rendering-syntax-jspwiki.</justification>
</item>
<item>
<ignore>true</ignore>
<code>java.class.removed</code>
<old>class org.xwiki.rendering.wikimodel.xwiki.xwiki10.XWikiSerializer</old>
<criticality>highlight</criticality>
<justification>Unused WikiModel serializer for XWiki 1.0 syntax, imported with WikiModel in XRENDERING-173 and
never called. XWiki syntax rendering is handled by the renderers in xwiki-rendering-syntaxes.</justification>
</item>
<item>
<ignore>true</ignore>
<code>java.class.removed</code>
<old>class org.xwiki.rendering.wikimodel.xwiki.xwiki20.XWikiSerializer2</old>
<criticality>highlight</criticality>
<justification>Unused WikiModel serializer for XWiki 2.0 syntax, imported with WikiModel in XRENDERING-173 and
never called. XWiki syntax rendering is handled by the renderers in xwiki-rendering-syntaxes.</justification>
</item>
WDYT?
Here’s my +1
Thanks