Fixed bug that caused the wrong Controller Service to be de-referenced when a component that used to reference a Controller Service is changed to reference a different Controller Service
@@ -347,7 +347,8 @@ public abstract class AbstractComponentNode implements ComponentNode {
if (!propertyConfiguration.equals(oldConfiguration)) {
if (descriptor.getControllerServiceDefinition() != null) {
if (oldConfiguration != null) {
- final ControllerServiceNode oldNode = serviceProvider.getControllerServiceNode(effectiveValue);
+ final String oldEffectiveValue = oldConfiguration.getEffectiveValue(getParameterContext());
+ final ControllerServiceNode oldNode = serviceProvider.getControllerServiceNode(oldEffectiveValue);
if (oldNode != null) {
oldNode.removeReference(this, descriptor);
}
