}
for (ExtendDescriptor extendDescriptor : extendTypes) {
GenericDescriptor res = searchType(extendDescriptor.getName(), null);
if (res == null) {
throw new DescriptorParserException("Extension error: type " + extendDescriptor.getName() + " not found");
}
extendDescriptor.setExtendedMessage((Descriptor) res); //todo [anistor] is it possible to extend an enum?
}
// check duplicate type definitions
for (String typeName : types.keySet()) {
GenericDescriptor existing = allTypes.get(typeName);
if (existing != null) {
List<String> locations = Arrays.asList(name, existing.getFileDescriptor().getName());
Collections.sort(locations);
throw new DescriptorParserException("Duplicate definition of " + typeName + " in " + locations.get(0) + " and " + locations.get(1));
}
}
for (FileDescriptor fd : pubDeps) {
fd.dependants.put(name, this);