}
public synchronized ResourceOracle getBuildResourceOracle() {
if (lazyResourcesOracle == null) {
lazyResourcesOracle = new ResourceOracleImpl(TreeLogger.NULL, resources);
PathPrefixSet pathPrefixes = lazySourceOracle.getPathPrefixes();
// For backwards compatibility, register source resource paths as build resource paths as
// well.
PathPrefixSet newPathPrefixes = new PathPrefixSet();
for (PathPrefix pathPrefix : pathPrefixes.values()) {
newPathPrefixes.add(new PathPrefix(pathPrefix.getModuleName(), pathPrefix.getPrefix(),
NON_JAVA_RESOURCES, pathPrefix.shouldReroot(), null));
}
// Register build resource paths.
for (PathPrefix resourcePathPrefix : resourcePrefixes) {
newPathPrefixes.add(resourcePathPrefix);
}
lazyResourcesOracle.setPathPrefixes(newPathPrefixes);
lazyResourcesOracle.scanResources(TreeLogger.NULL);
} else {
ensureResourcesScanned();