You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Alexander Klimetschek (JIRA)" <ji...@apache.org> on 2008/06/16 12:25:45 UTC

[jira] Updated: (SLING-538) SlingPropertyValueHelper.setPropertyAsIs() handles impossible empty-value-list case

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

Alexander Klimetschek updated SLING-538:
----------------------------------------

    Attachment: SLING-538.patch

Removes the code in question and adds explaining comments/javadoc.

> SlingPropertyValueHelper.setPropertyAsIs() handles impossible empty-value-list case
> -----------------------------------------------------------------------------------
>
>                 Key: SLING-538
>                 URL: https://issues.apache.org/jira/browse/SLING-538
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Priority: Minor
>         Attachments: SLING-538.patch
>
>
> The list of values of the request property can never have the length of null - RequestProperty.getStringValues() ensures this, and it also does not make any sense with form posts, since a request parameter must always have at least one value, otherwise it would simply not exist in the request. So this code is superfluous (also for single-value property handling):
>         } else if (values.length == 0) {
>             // do not create new prop here, but clear existing
>             if (parent.hasProperty(prop.getName())) {
>                 response.onModified(
>                     parent.setProperty(prop.getName(), "").getPath()
>                 );
>             }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.