With ExpressionFlipStrategy
conflict with AND
and &
in UI and Store
#529
Labels
ExpressionFlipStrategy
conflict with AND
and &
in UI and Store
#529
Hi,
As mentioned in ##237 we have the same problem
see the source code 'org.ff4j.utils.MappingUtil'
public static final Map<String, String> toMap(String strParam) {
LinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();
if (strParam != null) {
//this line****************************
String[] chunks = strParam.split("" + SEPARATOR);
for (String chunk : chunks) {
int idxEqual = chunk.indexOf("=");
if (idxEqual > 0 && idxEqual < chunk.length()) {
String paramName = chunk.substring(0, idxEqual);
String paramValue = chunk.substring(idxEqual + 1);
parameters.put(paramName, paramValue);
}
}
We use :
The problem is not present with InMemoryFeatureStore because this implementation does not use MappingUtil.toMap.
The data is correctly stored but not read with MongoFeatureStore. The mapper gives 'dummy ' instead of 'dummy & foo'.
If we use AND as workaround, it is not working because ExpressionParser uses the constant AND declered as '&' and not 'AND' (String value).
For instance the expression dummy AND foo is not interpreted as feature 'dummy' AND feature 'foo' but only feature 'dummyANDfoo' which does not exist in this case.
The text was updated successfully, but these errors were encountered: