Feature page type cache

Shouldn't the class ref for document.getXObject(...) use the wiki of document? So instead of
getContext().getDatabase()
use
document.getDocumentReference().getLastSpaceReference().extractReference(EntityType.WIKI).getName()