retrieve all pages and attachments only if we have to build the reference manager
@@ -584,15 +584,16 @@ public class WikiEngine implements Engine {
*/
public void initReferenceManager() throws WikiException {
try {
+ // Build a new manager with default key lists.
+ if( getManager( ReferenceManager.class ) == null ) {
final ArrayList< Page > pages = new ArrayList<>();
pages.addAll( getManager( PageManager.class ).getAllPages() );
pages.addAll( getManager( AttachmentManager.class ).getAllAttachments() );
- // Build a new manager with default key lists.
- if( getManager( ReferenceManager.class ) == null ) {
m_referenceManager = ClassUtil.getMappedObject( ReferenceManager.class.getName(), this );
- m_referenceManager.initialize( pages );
managers.put( ReferenceManager.class, m_referenceManager );
+
+ m_referenceManager.initialize( pages );
}
} catch( final ProviderException e ) {
