* @param md
* @param ns
* @return
*/
public static ModuleDescriptor transformInstance(ModuleDescriptor md, Namespace ns) {
NamespaceTransformer t = ns.getToSystemTransformer();
if (t.isIdentity()) {
return md;
}
DefaultModuleDescriptor nmd = new DefaultModuleDescriptor(md.getParser(), md.getResource());
nmd.revId = t.transform(md.getModuleRevisionId());
nmd.resolvedRevId = t.transform(md.getResolvedModuleRevisionId());
nmd.status = md.getStatus();
nmd.publicationDate = md.getPublicationDate();
nmd.resolvedPublicationDate = md.getResolvedPublicationDate();
ExtendsDescriptor[] ed = md.getInheritedDescriptors();
for (int i = 0; i < ed.length; ++i) {
ModuleDescriptor parentMd = ed[i].getParentMd();
DefaultModuleDescriptor parentNmd = new DefaultModuleDescriptor(parentMd.getParser(),
parentMd.getResource());
parentNmd.revId = t.transform(parentMd.getModuleRevisionId());
parentNmd.resolvedRevId = t.transform(parentMd.getResolvedModuleRevisionId());
parentNmd.status = parentMd.getStatus();
parentNmd.publicationDate = parentMd.getPublicationDate();
parentNmd.resolvedPublicationDate = parentMd.getResolvedPublicationDate();
nmd.inheritedDescriptors.add(new DefaultExtendsDescriptor(parentNmd, ed[i]