Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Java-SCA-1.5.1
-
None
-
Patch Available
Description
A PolicyConfigurationException may be raised incorrectly when using operation policy as shown in the example below.
<composite ...>
<component ... requires='A'>
<implementation.java class="test.MyServiceImpl"/>
<service name="MyService">
<operation name="setXYZZY" requires="B"/>
</service>
</component>
</composite>
Let's say intent 'A' constrains an implementation rather than a binding. Constraints aren't examined until the final step of propagating the intents into the binding. So 'A' gets inherited by the service and then the service operation. Now the code in PolicyComputationUtil.addInheritedOpConfOnBindings gets control to inherit the service operation intents to the binding. If it can find a matching operation element under the binding, it goes through logic that applies the constraint (among among things). This would keep 'A' from being inherited by the binding level. However if it can't find an operation element under the binding, it simply adds a new operation element without doing any checking on it. This leads to a PolicyConfigurationException because there is no policy that applies to the binding and satisfies 'A'.
I am attaching a patch that changes the logic in PolicyComputationUtil.addInheritedOpConfOnBindings so that added binding operations go through the same logic as existing operations.