prefix = oldPrefix + oldSep + targetPrefix;
}
setProjectHelperProps(prefix, prefixSeparator,
isInIncludeMode());
ProjectHelper subHelper = ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
importedResource);
// push current stacks into the sub helper
subHelper.getImportStack().addAll(helper.getImportStack());
subHelper.getExtensionStack().addAll(helper.getExtensionStack());
getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE, subHelper);
subHelper.parse(getProject(), importedResource);
// push back the stack from the sub helper to the main one
getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE, helper);
helper.getImportStack().clear();
helper.getImportStack().addAll(subHelper.getImportStack());
helper.getExtensionStack().clear();
helper.getExtensionStack().addAll(subHelper.getExtensionStack());
} catch (BuildException ex) {
throw ProjectHelper.addLocationToBuildException(
ex, getLocation());
} finally {
setProjectHelperProps(oldPrefix, oldSep, oldIncludeMode);