*
* @param logger status and error details are written here
*/
public void refresh(TreeLogger logger) {
PerfLogger.start("ResourceOracleImpl.refresh");
TreeLogger refreshBranch = Messages.REFRESHING_RESOURCES.branch(logger,
null);
/*
* Allocate fresh data structures in anticipation of needing to honor the
* "new identity for the collections if anything changes" guarantee. Use a
* LinkedHashMap because we do not want the order to change.
*/
Map<String, ResourceData> newInternalMap = new LinkedHashMap<String, ResourceData>();
/*
* Walk across path roots (i.e. classpath entries) in priority order. This
* is a "reverse painter's algorithm", relying on being careful never to add
* a resource that has already been added to the new map under construction
* to create the effect that resources founder earlier on the classpath take
* precedence.
*
* Exceptions: super has priority over non-super; and if there are two super
* resources with the same path, the one with the higher-priority path
* prefix wins.
*/
for (ClassPathEntry pathRoot : classPath) {
TreeLogger branchForClassPathEntry = Messages.EXAMINING_PATH_ROOT.branch(
refreshBranch, pathRoot.getLocation(), null);
Map<AbstractResource, PathPrefix> resourceToPrefixMap = pathRoot.findApplicableResources(
branchForClassPathEntry, pathPrefixSet);
for (Entry<AbstractResource, PathPrefix> entry : resourceToPrefixMap.entrySet()) {