private void replaceTemporaryTypes(DataType type, List<DataType> seenStructs) { if (type instanceof WeightedSetDataType) { replaceTemporaryTypesInWeightedSet((WeightedSetDataType) type, seenStructs); } else if (type instanceof MapDataType) { replaceTemporaryTypesInMap((MapDataType) type, seenStructs); } else if (type instanceof CollectionDataType) { replaceTemporaryTypesInCollection((CollectionDataType) type, seenStructs); } else if (type instanceof StructDataType) { replaceTemporaryTypesInStruct((StructDataType) type, seenStructs); } else if (type instanceof PrimitiveDataType) { //OK because these types are always present } else if (type instanceof AnnotationReferenceDataType) { //OK because this type is always present } else if (type instanceof DocumentType) { //OK because this type is always present } else if (type instanceof TensorDataType) { //OK because this type is always present } else if (type instanceof ReferenceDataType) { replaceTemporaryTypeInReference((ReferenceDataType) type); } else if (type instanceof TemporaryDataType) { throw new IllegalStateException("TemporaryDataType registered in DocumentTypeManager, BUG!!"); } else { log.warning("Don't know how to replace temporary data types in " + type); } }