You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2018/09/27 10:28:00 UTC

[jira] [Resolved] (WICKET-6567) Concatenation of semicolons in FormComponent's inputChanged method

     [ https://issues.apache.org/jira/browse/WICKET-6567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier resolved WICKET-6567.
--------------------------------
    Resolution: Incomplete
      Assignee: Sven Meier

Nothing to do until a problem is demonstrated.

> Concatenation of semicolons in FormComponent's inputChanged method
> ------------------------------------------------------------------
>
>                 Key: WICKET-6567
>                 URL: https://issues.apache.org/jira/browse/WICKET-6567
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.29.0
>            Reporter: Max van den Aker
>            Assignee: Sven Meier
>            Priority: Minor
>
>  
> {code:java}
> public final void inputChanged() {
>   if (this.isVisibleInHierarchy() && this.isEnabledInHierarchy()) {
>     String[] input = this.getInputAsArray();
>     if (input != null && input.length > 0 && input[0] != null) {
>       this.rawInput = StringList.valueOf(input).join(";");
>     } else if (this.isInputNullable()) {
>     this.rawInput = null;
>     } else {
>       this.rawInput = "[-NO-RAW-INPUT-]";
>     }
>   }
> }
> {code}
> In the implementation listed above, occasionally this will join an array of empty strings, and result in this.rawInput = ";", and on each subsequent invocation adds another semicolon to rawInput.
> A fix might be to consider !input[0].isEmpty() in the condition as well:
> {code:java}
> public final void inputChanged() {
>   if (this.isVisibleInHierarchy() && this.isEnabledInHierarchy()) {
>     String[] input = this.getInputAsArray();
>     if (input != null && input.length > 0 && input[0] != null && !input[0].isEmpty()) {
>       this.rawInput = StringList.valueOf(input).join(";");
>     } else if (this.isInputNullable()) {
>     this.rawInput = null;
>     } else {
>       this.rawInput = "[-NO-RAW-INPUT-]";
>     }
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)