Logic or Exception Message is incorrect in ModalWindow.setCookieName
--------------------------------------------------------------------
Key: WICKET-4317
URL: https://issues.apache.org/jira/browse/WICKET-4317
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.4.18
Environment: software
Reporter: R. Brian Amesbury
Priority: Minor
The logic of the compound conditional statement is incorrect or the message
passed to the Exception is incorrect.
/**
* Sets the name of the cookie that is used to remember window position
(and size if the window
* is resizable).
*
* @param cookieName
* Name of the cookie
* @return this
*/
public StatelessModalWindow setCookieName(String cookieName)
{
if (cookieName != null && cookieName.indexOf(",") != -1 &&
cookieName.indexOf("|") != -1)
{
throw new IllegalArgumentException("Cookie name may not
contain ',' or '|' characters.");
}
this.cookieName = cookieName;
return this;
}
The logic reads:
If the String is not null and it contains a comma and it contains a
pipe, then throw the exception.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira