External external = field.getAnnotation(External.class);
String serviceProtocol = protocol != null ? protocol.value() : DEFAULT_PROTOCOL;
String serviceAlias = alias != null ? alias.value() : name.value();</BUG>
Boolean serviceExternal = external != null && external.value();
<BUG>Service serviceInstance = getService(name.value());
serviceInstance.getAdditionalProperties().put(ALIAS, serviceAlias);</BUG>
serviceInstance.getAdditionalProperties().put(PROTOCOL, serviceProtocol);
serviceInstance.getAdditionalProperties().put(EXTERNAL, serviceExternal);
<BUG>Class targetClass = field.getType();
BeanDefinitionHolder holder = createServiceDefinition(serviceInstance, serviceAlias, serviceProtocol, targetClass);
</BUG>
BeanDefinitionReaderUtils.registerBeanDefinition(holder, registry);

External external = field.getAnnotation(External.class);
String serviceName = name != null ? name.value() : null;
Service serviceInstance = new ServiceBuilder(getService(serviceName)).build();
String servicePort = port != null ? port.value() : null;
String serviceProtocol = protocol != null ? protocol.value() : DEFAULT_PROTOCOL;
Boolean serviceExternal = external != null && external.value();
String serviceAlias = alias != null ? alias.value() : createAlias(serviceName, targetClass, serviceProtocol, servicePort, serviceExternal);
serviceInstance.getAdditionalProperties().put(ALIAS, serviceAlias);
serviceInstance.getAdditionalProperties().put(PROTOCOL, serviceProtocol);
serviceInstance.getAdditionalProperties().put(EXTERNAL, serviceExternal);
if (port != null) {
serviceInstance.getAdditionalProperties().put(PORT, servicePort);
