{
Pair<EventType[], Set<EventType>> mapSuperTypes = getSuperTypesDepthFirst(optionalConfig != null ? optionalConfig.getSuperTypes() : null, true);
EventTypeMetadata metadata = EventTypeMetadata.createNonPojoApplicationType(EventTypeMetadata.ApplicationType.MAP, eventTypeName, isPreconfiguredStatic, isPreconfigured, isConfigured, namedWindow, insertInto);
int typeId = eventTypeIdGenerator.getTypeId(eventTypeName);
MapEventType newEventType = new MapEventType(metadata, eventTypeName, typeId, this, propertyTypes, mapSuperTypes.getFirst(), mapSuperTypes.getSecond(), optionalConfig);
EventType existingType = nameToTypeMap.get(eventTypeName);
if (existingType != null)
{
// The existing type must be the same as the type createdStatement
if (!newEventType.equalsCompareType(existingType))
{
String message = newEventType.getEqualsMessage(existingType);
throw new EventAdapterException("Event type named '" + eventTypeName +
"' has already been declared with differing column name or type information: " + message);
}
// Since it's the same, return the existing type