/** * Get imported module by its name and revision from moduleGraph. */ private static ModuleNodeImpl getModuleByNameAndRevision( final Table<String, Optional<Revision>, ModuleNodeImpl> moduleGraph, final String fromName, final Optional<Revision> fromRevision, final String toName, final Optional<Revision> toRevision) { final ModuleNodeImpl exact = moduleGraph.get(toName, toRevision); if (exact != null) { return exact; } // If revision is not specified in import, but module exists with different revisions, take first one if (!toRevision.isPresent()) { final Map<Optional<Revision>, ModuleNodeImpl> modulerevs = moduleGraph.row(toName); if (!modulerevs.isEmpty()) { final ModuleNodeImpl first = modulerevs.values().iterator().next(); if (LOG.isTraceEnabled()) { LOG.trace("Import:{}:{} by module:{}:{} does not specify revision, using:{}:{}" + " for module dependency sort", toName, formatRevDate(toRevision), fromName, formatRevDate(fromRevision), first.getName(), formatRevDate(first.getRevision())); } return first; } } LOG.warn("Not existing module imported:{}:{} by:{}:{}", toName, formatRevDate(toRevision), fromName, formatRevDate(fromRevision)); LOG.warn("Available models: {}", moduleGraph); throw new IllegalArgumentException(String.format("Not existing module imported:%s:%s by:%s:%s", toName, formatRevDate(toRevision), fromName, formatRevDate(fromRevision))); }
/** * Get imported module by its name and revision from moduleGraph. */ private static ModuleNodeImpl getModuleByNameAndRevision( final Table<String, Optional<Revision>, ModuleNodeImpl> moduleGraph, final String fromName, final Optional<Revision> fromRevision, final String toName, final Optional<Revision> toRevision) { final ModuleNodeImpl exact = moduleGraph.get(toName, toRevision); if (exact != null) { return exact; } // If revision is not specified in import, but module exists with different revisions, take first one if (!toRevision.isPresent()) { final Map<Optional<Revision>, ModuleNodeImpl> modulerevs = moduleGraph.row(toName); if (!modulerevs.isEmpty()) { final ModuleNodeImpl first = modulerevs.values().iterator().next(); if (LOG.isTraceEnabled()) { LOG.trace("Import:{}:{} by module:{}:{} does not specify revision, using:{}:{}" + " for module dependency sort", toName, formatRevDate(toRevision), fromName, formatRevDate(fromRevision), first.getName(), formatRevDate(first.getRevision())); } return first; } } LOG.warn("Not existing module imported:{}:{} by:{}:{}", toName, formatRevDate(toRevision), fromName, formatRevDate(fromRevision)); LOG.warn("Available models: {}", moduleGraph); throw new IllegalArgumentException(String.format("Not existing module imported:%s:%s by:%s:%s", toName, formatRevDate(toRevision), fromName, formatRevDate(fromRevision))); }
@Override public String toString() { return "Module [name=" + name + ", revision=" + formatRevDate(getRevision()) + "]"; }
@Override public String toString() { return "Module [name=" + name + ", revision=" + formatRevDate(getRevision()) + "]"; }