}
if(m == null)
worked(ticker, 1);
else {
File f = mdProvider[0];
ModuleName moduleName = m.getName();
if(options.isCheckModuleSemantics() && isOnPath(pathToFile(f.getAbsolutePath(), root), searchPath)) {
// remember the metadata and where it came from
// and if it represents a NODE as opposed to a regular MODULE
moduleData.put(
moduleName, new MetadataInfo(m, f, nodeRootPath.isPrefixOf(new Path(f.getAbsolutePath()))));
}
if(isValidationWanted(examinedFiles, f)) {
validateModuleMetadata(m, diagnostics, f, root, options, ticker.newChild(1));
}
else
worked(ticker, 1);
}
}
if(options.isCheckModuleSemantics()) {
for(ModuleName key : moduleData.keySet()) {
// check there is only one version of each module
Collection<MetadataInfo> versions = moduleData.get(key);
boolean redeclared = versions.size() > 1;
for(MetadataInfo info : versions) {
// processed dependencies for one version of a modulefile (in case of errors, there may not be as many ticks as
// originally requested)
// this ticks before the fact (but there is "one for the pot" left at the end),
// as this makes it easier to just do "continue" below.
worked(ticker, 1);
// skip checks for unwanted
final boolean shouldDiagnosticBeReported = isValidationWanted(examinedFiles, info.getFile());
// if(!) continue;
if(redeclared && shouldDiagnosticBeReported) {
addFileError(
diagnostics, info.getFile(), root, "Redefinition - equally named already exists",
IValidationConstants.ISSUE__MODULEFILE_REDEFINITION);
}
// Resolve all dependencies
for(Dependency d : info.getMetadata().getDependencies()) {
// check dependency name and version requirement
final ModuleName requiredName = d.getName();
if(requiredName == null) {
if(shouldDiagnosticBeReported)
addFileError(
diagnostics, info.getFile(), root, "Dependency without name",
IValidationConstants.ISSUE__MODULEFILE_DEPENDENCY_ERROR);