Closed mdrozdo closed 3 years ago
The issue was introduced in https://github.com/wso2/balana/commit/647338610fc689d799af0f3d4e8222947ef42155 due to overriding in GeneralBagFunction:
@Override
public final boolean returnsBag() {
return getReturnsBag(getFunctionName());
}
I tried removing this override and the tests pass (it should just use the returnsBag field underneath). Is there any reason for this override?
Closing as the PR is merged. Thank you for your valuable contribution.
Description: If Balana is configured with a custom data type and a bag function operating on it (i.e. registered using the
public GeneralBagFunction(String functionName, String datatype, String functionType)
constructor), the code throws NullReferenceException from theGeneralBagFunction.returnsBag()
function.Affected Product Version: 1.2.5
Steps to reproduce: Register a custom datatype e.g.:
and register an associated bag function:
Then try to evaluate the policy using such function.
The problem is due to the fact that when using the aforementioned constructor, the paramMap collection is not initialized with the function name, but rather the function type (e.g. "-one-and-only"). Therefore the GeneralBagFunction.returnsBag() should also use function type and not function name.