}
} else {
// There are modules, let's merge
MapFromStringTo<Node> existing = Collections.mapFromStringTo();
for (int i = 0; i < m; i++) {
Node opt = opts.item(i);
Node attr = opt.getAttributes().getNamedItem("value");
if (attr != null)
existing.put(attr.getNodeValue(), opt);
}
m = modules.size();
for (int i = 0; i < m; i++) {
GwtRecompile module = modules.get(i);
Node duplicate = existing.get(module.getModule());
if (duplicate != null) {
// TODO check revision # and take freshest
duplicate.removeFromParent();
}
OptionElement opt = createOption(module, i == 0);
list.appendChild(opt);
}
}