Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-811

Remove the 4 unused WikiModel serializers from xwiki-rendering-wikimodel

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 18.8.0-rc-1
    • 17.10.0
    • Wikimodel
    • None
    • Unknown
    • N/A

    Description

      Context

      Proposed and voted on the forum: https://forum.xwiki.org/t/remove-the-4-unused-wikimodel-serializers-from-xwiki-rendering-wikimodel/18724 (4 +1, no -1).

      The WikiModel serializers in xwiki-rendering-wikimodel 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.

      Classes to remove

      • org.xwiki.rendering.wikimodel.IWikiSerializer (34 lines) - interface with no implementors and no callers
      • org.xwiki.rendering.wikimodel.jspwiki.JspWikiSerializer (463 lines) - never finished, its javadoc says "Not ready yet."
      • org.xwiki.rendering.wikimodel.xwiki.xwiki10.XWikiSerializer (185 lines) - XWiki 1.0 syntax serializer
      • org.xwiki.rendering.wikimodel.xwiki.xwiki20.XWikiSerializer2 (666 lines) - XWiki 2.0 syntax serializer

      That's about 1350 lines. There isn't a single reference to any of them in xwiki-rendering, xwiki-commons, xwiki-platform nor the xwiki-contrib repos. The only mentions anywhere are the two @see javadoc tags with which XWikiSerializer and XWikiSerializer2 point at each other. Removing XWikiSerializer also empties the org.xwiki.rendering.wikimodel.xwiki.xwiki10 package, which goes away with it.

      What stays

      The rest of org.xwiki.rendering.wikimodel.xwiki.* is very much alive and is not touched: xwiki20.XWikiParser, xwiki21.XWikiParser, xwiki20.XWikiReferenceParser, xwiki20.XWikiScannerUtil and xwiki20.XWikiWikiParameters - the XWiki 2.0/2.1 parsers in xwiki-rendering-syntaxes delegate to them and the JavaCC scanners import them. Same for jspwiki.JspWikiParser and jspwiki.JspWikiReferenceParser.

      Backward compatibility

      Since this removes public APIs, the removal is declared to Revapi through 4 java.class.removed ignores with a highlight criticality in the root pom.xml.

      These classes are deliberately not moved to xwiki-rendering-legacy-wikimodel: they are standalone leaf classes (nothing extends or implements them inside the codebase), so there is nothing for a legacy aspect to hook onto, and anyone who really does use one can still add the 18.6.0 jar manually.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: