Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-155

Allow customisation of core classes via ClassUtil.getMappedObject

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.6.0
    • 2.10
    • Core & storage
    • None

    Description

      The WikiEngine class uses the ClassUtils.getMappedObject method to locate its critical helper objects, rather than just call "new".

      The intentention of this existing code is for people to be able to override the core implementations with custom ones - with the warning that these core objects do not have stable public apis, and may change in any release. Unfortunately because (a) the returned object is cast to a concrete type, and (b) many of these concrete types are declared "final" this facility is actually almost useless.

      It would be nice for the "final" to be removed from these classes, and from their member methods so that getMappedObject becomes useful. Alternately, interfaces could be created for the concrete classes that WikiEngine currently uses, and all code modified to use the interface instead; the existing implementations could then remain final. That approach is much more intrusive though.

      Note that in discussions on the email lists it has been suggested that the "final" qualifier on these classes helps make jspwiki more secure. Personally I'm not at all convinced that is true though.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              skitching Simon Kitching
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: