//know which syntax the client used, and we cannot rely on correct percent-encoding of
//delimiter characters for both syntaxes. Therefore we simulate parsing using each syntax in
//turn, and choose the best match.
StringBuilder legacyParseError = new StringBuilder();
StringBuilder currentParseError = new StringBuilder();
CompoundKey legacyParsedKey = parseCompoundKey(urlString,
keys,
legacyParseError,
LEGACY_SIMPLE_KEY_DELIMETER_PATTERN,
LEGACY_KEY_VALUE_DELIMETER_PATTERN);
CompoundKey currentParsedKey = parseCompoundKey(urlString,
keys,
currentParseError,
SIMPLE_KEY_DELIMETER_PATTERN,
KEY_VALUE_DELIMETER_PATTERN);
if (legacyParsedKey != null && currentParsedKey != null)
{
boolean legacy = legacyParsedKey.getNumParts() > currentParsedKey.getNumParts();
_log.warn("Ambiguous compound key syntax, using heuristic decision for '{}', legacy: {}",
urlString, String.valueOf(legacy));
return legacy ? legacyParsedKey : currentParsedKey;
}
else if (legacyParsedKey == null && currentParsedKey == null)