Buggy code:
} class FormDispatchRequest extends Request { private final ValueMap params = new ValueMap ( ) ; private final Request realRequest ; private final String url ; public FormDispatchRequest ( final Request realRequest , final String url ) { } public Locale getLocale ( ) { } public String getParameter ( String key ) { } public Map getParameterMap ( ) { } public String [ ] getParameters ( String key ) { } public String getPath ( ) { } public String getRelativePathPrefixToContextRoot ( ) { } public String getRelativePathPrefixToWicketHandler ( ) { } public String getURL ( ) { } } public static final String METHOD_GET = "get" ; public static final String METHOD_POST = "post" ; private static final short FLAG_SUBMITTED = FLAG_RESERVED1 ; private static final Logger log = LoggerFactory . getLogger ( Form . class ) ; private static final long serialVersionUID = 1L ; private static final String UPLOAD_FAILED_RESOURCE_KEY = "uploadFailed" ; private static final String UPLOAD_TOO_LARGE_RESOURCE_KEY = "uploadTooLarge" ; private IFormSubmittingComponent defaultSubmittingComponent ; private Object formValidators = null ; private String javascriptId ; private Bytes maxSize = null ; private boolean multiPart = false ; public Form ( final String id ) { } public Form ( final String id , IModel model ) { } public void add ( IFormValidator validator ) { } public void remove ( IFormValidator validator ) { } private final int formValidators_indexOf ( IFormValidator validator ) { } private final IFormValidator formValidators_remove ( IFormValidator validator ) { } private final IFormValidator formValidators_remove ( int index ) { } public final void clearInput ( ) { } public final void error ( String error , Map args ) { } public final IFormSubmittingComponent findSubmittingButton ( ) { } public final IFormSubmittingComponent getDefaultButton ( ) { } public final CharSequence getJsForInterfaceUrl ( CharSequence url ) { } public Bytes getMaxSize ( ) { } public Form getRootForm ( ) { } public String getValidatorKeyPrefix ( ) { } public final boolean hasError ( ) { } public boolean isRootForm ( ) { } public final boolean isSubmitted ( ) { } public boolean isVersioned ( ) { } public final void loadPersistentFormComponentValues ( ) { } public final void onFormSubmitted ( ) { } public boolean process ( ) { } private void callOnError ( ) { } private void markFormsSubmitted ( ) { } public void removePersistentFormComponentValues ( final boolean disablePersistence ) { } public final void setDefaultButton ( IFormSubmittingComponent submittingComponent ) { } public void setMaxSize ( final Bytes maxSize ) { } public void setMultiPart ( boolean multiPart ) { } public final Component setVersioned ( final boolean isVersioned ) { } public final void visitFormComponents ( final FormComponent . IVisitor visitor ) { } public final void visitFormComponentsPostOrder ( final FormComponent . IVisitor visitor ) { } private void visitChildrenInContainingBorder ( final FormComponent . IVisitor visitor ) { } private boolean anyFormComponentError ( ) { } private void dispatchEvent ( final Page page , final String url ) { } private void formValidators_add ( final IFormValidator validator ) { } private IFormValidator formValidators_get ( int index ) { } private int formValidators_size ( ) { } private void inputChanged ( ) { } private void persistFormComponentData ( ) { } protected void appendDefaultButtonField ( final MarkupStream markupStream , final ComponentTag openTag ) { } protected void beforeUpdateFormComponentModels ( ) { } protected void delegateSubmit ( IFormSubmittingComponent submittingComponent ) { } protected final String getHiddenFieldId ( ) { } protected final String getJavascriptId ( ) { } protected String getMethod ( ) { } protected boolean getStatelessHint ( ) { } protected IValuePersister getValuePersister ( ) { } protected boolean handleMultiPart ( ) { <START_BUG> if ( multiPart ) { <END_BUG> try { final WebRequest multipartWebRequest = ( ( WebRequest ) ( getRequest ( ) ) ) . newMultipartWebRequest ( getMaxSize ( ) ) ; getRequestCycle ( ) . setRequest ( multipartWebRequest ) ; } catch ( WicketRuntimeException wre ) { if ( ( ( wre . getCause ( ) ) == null ) || ( ! ( ( wre . getCause ( ) ) instanceof FileUploadException ) ) ) { throw wre ; } FileUploadException e = ( ( FileUploadException ) ( wre . getCause ( ) ) ) ; final Map model = new HashMap ( ) ; model . put ( "exception" , e ) ; model . put ( "maxSize" , getMaxSize ( ) ) ; if ( e instanceof SizeLimitExceededException ) { final String defaultValue = "Upload<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>less<seq2seq4repair_space>than<seq2seq4repair_space>" + ( getMaxSize ( ) ) ; String msg = getString ( ( ( ( getId ( ) ) + "." ) + ( Form . UPLOAD_TOO_LARGE_RESOURCE_KEY ) ) , Model . valueOf ( model ) , defaultValue ) ; error ( msg ) ; } else { final String defaultValue = "Upload<seq2seq4repair_space>failed:<seq2seq4repair_space>" + ( e . getLocalizedMessage ( ) ) ; String msg = getString ( ( ( ( getId ( ) ) + "." ) + ( Form . UPLOAD_FAILED_RESOURCE_KEY ) ) , Model . valueOf ( model ) , defaultValue ) ; error ( msg ) ; Form . log . warn ( msg , e ) ; } return false ; } } return true ; } protected void internalOnModelChanged ( ) { } protected final void markFormComponentsInvalid ( ) { } protected final void markFormComponentsValid ( ) { } private void markNestedFormComponentsValid ( ) { } private void internalMarkFormComponentsValid ( ) { } protected void onComponentTag ( final ComponentTag tag ) { } protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } protected void onDetach ( ) { } protected void onError ( ) { } protected void onRender ( final MarkupStream markupStream ) { } protected void onSubmit ( ) { } protected final void updateFormComponentModels ( ) { } private final void updateNestedFormComponentModels ( ) { } private void internalUpdateFormComponentModels ( ) { }

Fix:
if ( ( multiPart ) && ( ! ( ( ( WebRequest ) ( getRequest ( ) ) ) . isAjax ( ) ) ) ) {