/** * Utility method for populating the aOutputMergedTypes argument in the mergeTypeSystems method. * * @param aOutputMergedTypes * Map to populate * @param currentType * TypeDescription currently being processed * @param existingType * TypeDescription that already existed for the same name */ private static void reportMerge(Map<String, Set<String>> aOutputMergedTypes, TypeDescription currentType, TypeDescription existingType) { if (aOutputMergedTypes != null) { String typeName = currentType.getName(); Set<String> descriptorUrls = aOutputMergedTypes.get(typeName); if (descriptorUrls == null) { descriptorUrls = new TreeSet<String>(); descriptorUrls.add(existingType.getSourceUrlString()); descriptorUrls.add(currentType.getSourceUrlString()); aOutputMergedTypes.put(typeName, descriptorUrls); } else { descriptorUrls.add(currentType.getSourceUrlString()); } } }
protected boolean isOutOfScope(TypeDescription td, String projectDirPath) { URI typeDefinitionUri; try { typeDefinitionUri = new URI(td.getSourceUrlString()); } catch (URISyntaxException e) { return true; // may be overkill - but if td's source can't be parsed ... likely out of project
URI typeDefinitionUri; try { typeDefinitionUri = new URI (td.getSourceUrlString()); } catch (URISyntaxException e) { if (IS_TRACE_LIMITED) { error.newError(IError.INFO, "debug isOutOfScope: got URISyntaxException, td.getSourceUrlstring: " + ((td.getSourceUrlString() == null) ? "null" : td.getSourceUrlString()), e);
throw new ResourceInitializationException( ResourceInitializationException.NO_SUPERTYPE, new Object[] { typeName, curTypeDesc.getSourceUrlString() }); ResourceInitializationException.REDEFINING_BUILTIN_TYPE, new Object[] { typeSystemMgr.getParent(builtIn), typeName, superTypeName, curTypeDesc.getSourceUrlString() }); throw new ResourceInitializationException( ResourceInitializationException.MISSING_ALLOWED_VALUES, new Object[] { typeName, curTypeDesc.getSourceUrlString() }); throw new ResourceInitializationException( ResourceInitializationException.ALLOWED_VALUES_ON_NON_STRING_TYPE, new Object[] { typeName, curTypeDesc.getSourceUrlString() }); throw new ResourceInitializationException( ResourceInitializationException.UNDEFINED_SUPERTYPE, new Object[] { td_i.getSupertypeName(), td_i.getName(), td_i.getSourceUrlString() }); ResourceInitializationException.UNDEFINED_SUPERTYPE, new Object[] { firstFailed.getSupertypeName(), firstFailed.getName(), firstFailed.getSourceUrlString() });
ResourceInitializationException.INCOMPATIBLE_RANGE_TYPES, new Object[] { aType.getName() + ":" + feat.getName(), rangeTypeName, feat.getRangeTypeName(), aType.getSourceUrlString() }); throw new ResourceInitializationException( ResourceInitializationException.INCOMPATIBLE_MULTI_REFS, new Object[] { aType.getName() + ":" + feat.getName(), aType.getSourceUrlString() }); ResourceInitializationException.INCOMPATIBLE_ELEMENT_RANGE_TYPES, new Object[] { aType.getName() + TypeSystem.FEATURE_SEPARATOR + feat.getName(), elementTypeName, feat.getElementType(), aType.getSourceUrlString() });
ResourceInitializationException.INCOMPATIBLE_SUPERTYPES, new Object[] { typeName, supertypeName, existingSupertypeName, type.getSourceUrlString() }); ResourceInitializationException.ALLOWED_VALUES_NOT_IDENTICAL, new Object[] { typeName, avAsString(av1), avAsString(av2), type.getSourceUrlString() });