}
private void addType(Class<?> declaringType, String name, Class<?> type, Type genericType) {
Class<?> existingType = types.put(name, type);
if (existingType != null && !existingType.equals(type)) {
throw new XOException("Get and set methods for property '" + name + "' of type '" + declaringType.getName() + "' do not declare the same type: " + existingType.getName() + " <> " + type.getName());
}
Type existingGenericType = genericTypes.put(name, genericType);
if (existingGenericType != null && !existingGenericType.equals(genericType)) {
throw new XOException("Get and set methods for property '" + name + "' of type '" + declaringType.getName() + "' do not declare the same generic type: " + existingGenericType + " <> " + type.getName());
}
}