Hi,

As I've been digging around in the code related to the ReferenceManager,
I found a curiosity.

I'm not sure of the history surrounding LinkParsingOperations, but it
seems that we create an instance for every WikiContext, despite the
fact that both of the two methods that use it actually use it just to
obtain the WikiEngine. The other eight methods could be static, and
there's a StartingComparator inner static class that's not actually
used anywhere else in code so it could be removed (so far as I can see).

The linkIfExists(String) and linkExists(String) methods both do almost
the same thing, so in theory the latter could simply call the former to
obtain its boolean result.

Since all the places where these two methods are called (all are within
JSPWikiMarkupParser) have access to the WikiEngine it could be passed
in as an argument, and therefore all of the methods of the
LinkParsingOperations could be made static and turn this into a static
utility class.

There's clearly no urgency for this but it does seem like we could reduce
the number of objects created by adopting the above suggestions.

Cheers,

Murray

...........................................................................
Murray Altheim <murray18 at altheim dot com>                       = =  ===
http://www.altheim.com/murray/                                     ===  ===
                                                                   = =  ===
    In the evening
    The rice leaves in the garden
    Rustle in the autumn wind
    That blows through my reed hut.
           -- Minamoto no Tsunenobu

Reply via email to