Implementation of protected handleMultipart method requires private method
--------------------------------------------------------------------------

                 Key: WICKET-3371
                 URL: https://issues.apache.org/jira/browse/WICKET-3371
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5-M3
            Reporter: Willis Blackburn


In Form is a method called handleMultipart, which is protected, presumably so 
that it can be overridden in subclasses.  I want to override it in order to 
create a different multipart request wrapper--one that can handle multiple 
uploads from the same field.  But the first line of the Form.handleMultipart 
method is:

if (isMultipart()) ...

and isMultipart is a private method, so my new implementation can't check to 
see if the form is actually in multipart mode.

Could isMultipart just be public?  After all setMultipart is.  I see that the 
method examines the component tree, so it may not be appropriate to call 
isMultipart at any arbitrary time, but that's true with most other methods too. 
 (If I set my component's visibility in onConfigure, for example, then calling 
isVisible before onConfigure during request processing might return the "wrong" 
visibility state.)

Alternately the calling line could be changed from:

if (handleMultipart()) ...

to 

if (!isMultipart() || handleMultipart()) ...

In other words, don't call handleMultipart if the form isn't mutlipart.

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

Reply via email to