Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.22
-
None
Description
As I reported on the mailing list, there is a bug with AliasInterceptor not handling the Parameter.Empty that is returned from HttpParameters.get(). Since HttpParameters.get() always returns a non-null value, the Evaluated object is treated as always being defined, which results in the empty value being set incorrectly on the stack.
The bug was originally introduced here:
The fix is easy; this code:
// workaround HttpParameters contextParameters = ActionContext.getContext().getParameters(); if (null != contextParameters) { value = new Evaluated(contextParameters.get(name)); }
needs to be updated to:
// workaround HttpParameters contextParameters = ActionContext.getContext().getParameters(); if (null != contextParameters) { Parameter param = contextParameters.get(name); value = new Evaluated(param.isDefined() ? param : null); }
This way, it ensures the Evaluated value is only defined when appropriate.