private XMLLump resolveCall(XMLLump sourcescope, UIContainer child) { String searchID = child instanceof UIJointContainer ? ((UIJointContainer) child).jointID : child.ID; SplitID split = new SplitID(searchID); String defprefix = split.prefix + SplitID.SEPARATOR; BestMatch bestmatch = new BestMatch(); if (Logger.log.isDebugEnabled()) { Logger.log.debug("Resolving call for ID " + searchID + " from container " + child.debugChildren()); } // first get lumps in THIS SCOPE with EXACTLY MATCHING ID. resolveInScope(searchID, defprefix, bestmatch, sourcescope.downmap, child); if (bestmatch.deficit == 0) { return bestmatch.bestlump; } // only enable global resolution if it is a branch if (child instanceof UIBranchContainer) { if (sourcescope.parent.isstatictemplate) { // make sure we can resolve local (intra-template) branches in the static case resolveInScope(searchID, defprefix, bestmatch, sourcescope.parent.globalmap, child); } resolveInScope(searchID, defprefix, bestmatch, globalmap, child); } return bestmatch.bestlump; }