Buggy code:
if ( openToscaHttpService == null ) { this . state . currentState = PlanGenerationStates . CSARDOWNLOADFAILED ; this . state . currentMessage = "Couldn't<seq2seq4repair_space>aquire<seq2seq4repair_space>internal<seq2seq4repair_space>HTTP<seq2seq4repair_space>Service<seq2seq4repair_space>to<seq2seq4repair_space>download<seq2seq4repair_space>CSAR" ; TaskWorkerRunnable . LOG . error ( "Couldn't<seq2seq4repair_space>aquire<seq2seq4repair_space>internal<seq2seq4repair_space>HTTP<seq2seq4repair_space>Service<seq2seq4repair_space>to<seq2seq4repair_space>download<seq2seq4repair_space>CSAR" ) ; return ; } InputStream csarInputStream = null ; try { TaskWorkerRunnable . LOG . debug ( ( "Downloading<seq2seq4repair_space>CSAR<seq2seq4repair_space>" + ( this . state . getCsarUrl ( ) ) ) ) ; HttpResponse csarResponse = openToscaHttpService . Get ( this . state . getCsarUrl ( ) . toString ( ) ) ; csarInputStream = csarResponse . getEntity ( ) . getContent ( ) ; } catch ( ClientProtocolException e ) { this . state . currentState = PlanGenerationStates . CSARDOWNLOADFAILED ; this . state . currentMessage = "Couldn't<seq2seq4repair_space>download<seq2seq4repair_space>CSAR" ; TaskWorkerRunnable . LOG . error ( "Couldn't<seq2seq4repair_space>download<seq2seq4repair_space>CSAR" ) ; return ; } catch ( IOException e ) { this . state . currentState = PlanGenerationStates . CSARDOWNLOADFAILED ; this . state . currentMessage = "Couldn't<seq2seq4repair_space>download<seq2seq4repair_space>CSAR" ; TaskWorkerRunnable . LOG . error ( "Couldn't<seq2seq4repair_space>download<seq2seq4repair_space>CSAR" ) ; return ; } if ( csarInputStream == null ) { this . state . currentState = PlanGenerationStates . CSARDOWNLOADFAILED ; this . state . currentMessage = "Couldn't<seq2seq4repair_space>download<seq2seq4repair_space>CSAR" ; TaskWorkerRunnable . LOG . error ( "Couldn't<seq2seq4repair_space>download<seq2seq4repair_space>CSAR" ) ; return ; } this . state . currentState = PlanGenerationStates . CSARDOWNLOADED ; this . state . currentMessage = "Downloaded<seq2seq4repair_space>CSAR" ; TaskWorkerRunnable . LOG . debug ( "CSAR<seq2seq4repair_space>download<seq2seq4repair_space>finished" ) ; TaskWorkerRunnable . LOG . debug ( "Storing<seq2seq4repair_space>CSAR" ) ; CSARID csarId = Util . storeCSAR ( ( ( System . currentTimeMillis ( ) ) + ".csar" ) , csarInputStream ) ; if ( csarId != null ) { this . state . currentState = PlanGenerationStates . PLANGENERATING ; this . state . currentMessage = "Generating<seq2seq4repair_space>Plan" ; TaskWorkerRunnable . LOG . debug ( "Starting<seq2seq4repair_space>to<seq2seq4repair_space>generate<seq2seq4repair_space>Plan" ) ; } else { this . state . currentState = PlanGenerationStates . CSARDOWNLOADFAILED ; this . state . currentMessage = "Couldn't<seq2seq4repair_space>store<seq2seq4repair_space>CSAR" ; TaskWorkerRunnable . LOG . error ( "Couldn't<seq2seq4repair_space>store<seq2seq4repair_space>CSAR" ) ; Util . deleteCSAR ( csarId ) ; return ; } List < BuildPlan > buildPlans = Util . startPlanBuilder ( csarId ) ; if ( ( buildPlans . size ( ) ) <= 0 ) { this . state . currentState = PlanGenerationStates . PLANGENERATIONFAILED ; this . state . currentMessage = "No<seq2seq4repair_space>plans<seq2seq4repair_space>could<seq2seq4repair_space>be<seq2seq4repair_space>generated" ; Util . deleteCSAR ( csarId ) ; TaskWorkerRunnable . LOG . error ( "No<seq2seq4repair_space>plans<seq2seq4repair_space>could<seq2seq4repair_space>be<seq2seq4repair_space>generated" ) ; return ; } File planTmpFile = Util . writePlan2TmpFolder ( buildPlans . get ( 0 ) ) ; this . state . currentState = PlanGenerationStates . PLANGENERATED ; this . state . currentMessage = "Stored<seq2seq4repair_space>and<seq2seq4repair_space>generated<seq2seq4repair_space>Plan" ; TaskWorkerRunnable . LOG . debug ( "Stored<seq2seq4repair_space>and<seq2seq4repair_space>generated<seq2seq4repair_space>Plan" ) ; MultipartEntity mpEntity = new MultipartEntity ( ) ; try { mpEntity . addPart ( "planName" , new StringBody ( planTmpFile . getName ( ) ) ) ; mpEntity . addPart ( "planType" , new StringBody ( "http:////docs.oasis-open.org//tosca//ns//2011//12//PlanTypes//BuildPlan" ) ) ; mpEntity . addPart ( "planLanguage" , new StringBody ( "http:////docs.oasis-open.org//wsbpel//2.0//process//executable" ) ) ; } catch ( UnsupportedEncodingException e1 ) { this . state . currentState = PlanGenerationStates . PLANGENERATIONFAILED ; this . state . currentMessage = "Couldn't<seq2seq4repair_space>generate<seq2seq4repair_space>Upload<seq2seq4repair_space>request<seq2seq4repair_space>to<seq2seq4repair_space>PLANPOSTURL" ; Util . deleteCSAR ( csarId ) ; TaskWorkerRunnable . LOG . error ( "Couldn't<seq2seq4repair_space>generate<seq2seq4repair_space>Upload<seq2seq4repair_space>request<seq2seq4repair_space>to<seq2seq4repair_space>PLANPOSTURL" ) ; return ; } FileBody bin = new FileBody ( planTmpFile ) ; ContentBody cb = ( ( ContentBody ) ( bin ) ) ; <START_BUG> mpEntity . addPart ( "planfile" , cb ) ; <END_BUG> try { this . state . currentState = PlanGenerationStates . PLANSENDING ; this . state . currentMessage = "Sending<seq2seq4repair_space>Plan" ; TaskWorkerRunnable . LOG . debug ( "Sending<seq2seq4repair_space>Plan" ) ; HttpResponse uploadResponse = openToscaHttpService . Post ( this . state . getPostUrl ( ) . toString ( ) , mpEntity ) ; if ( ( uploadResponse . getStatusLine ( ) . getStatusCode ( ) ) >= 300 ) { this . state . currentState = PlanGenerationStates . PLANSENDINGFAILED ; this . state . currentMessage = "Couldn't<seq2seq4repair_space>send<seq2seq4repair_space>plan.<seq2seq4repair_space>Server<seq2seq4repair_space>send<seq2seq4repair_space>status<seq2seq4repair_space>" + ( uploadResponse . getStatusLine ( ) . getStatusCode ( ) ) ; Util . deleteCSAR ( csarId ) ; TaskWorkerRunnable . LOG . error ( ( "Couldn't<seq2seq4repair_space>send<seq2seq4repair_space>plan.<seq2seq4repair_space>Server<seq2seq4repair_space>send<seq2seq4repair_space>status<seq2seq4repair_space>" + ( uploadResponse . getStatusLine ( ) . getStatusCode ( ) ) ) ) ; return ; } else { Header locationHeader = uploadResponse . getHeaders ( "Location" ) [ 0 ] ; String planLocation = "" ; if ( locationHeader == null ) { planLocation = ( this . state . getPostUrl ( ) ) + ( planTmpFile . getName ( ) ) ; } else { planLocation = locationHeader . getValue ( ) ; } BuildPlan buildPlan = buildPlans . get ( 0 ) ; for ( String inputParam : buildPlan . getWsdl ( ) . getInputMessageLocalNames ( ) ) { String inputParamPostUrl = planLocation + "//inputparameters//" ; List < NameValuePair > params = new ArrayList < NameValuePair > ( ) ; params . add ( Util . createNameValuePair ( "name" , inputParam ) ) ; params . add ( Util . createNameValuePair ( "type" , "String" ) ) ; params . add ( Util . createNameValuePair ( "required" , "on" ) ) ; UrlEncodedFormEntity encodedForm = new UrlEncodedFormEntity ( params ) ; HttpResponse inputParamPostResponse = openToscaHttpService . Post ( inputParamPostUrl , encodedForm ) ; if ( ( inputParamPostResponse . getStatusLine ( ) . getStatusCode ( ) ) >= 300 ) { this . state . currentState = PlanGenerationStates . PLANSENDINGFAILED ; this . state . currentMessage = ( ( ( ( "Couldn't<seq2seq4repair_space>set<seq2seq4repair_space>inputParameters.<seq2seq4repair_space>Setting<seq2seq4repair_space>InputParam<seq2seq4repair_space>(postURL:<seq2seq4repair_space>" + inputParamPostUrl ) + ")<seq2seq4repair_space>" ) + inputParam ) + "<seq2seq4repair_space>failed,<seq2seq4repair_space>Service<seq2seq4repair_space>for<seq2seq4repair_space>Plan<seq2seq4repair_space>Upload<seq2seq4repair_space>sent<seq2seq4repair_space>statusCode<seq2seq4repair_space>" ) + ( inputParamPostResponse . getStatusLine ( ) . getStatusCode ( ) ) ; Util . deleteCSAR ( csarId ) ; TaskWorkerRunnable . LOG . error ( ( ( ( ( ( "Couldn't<seq2seq4repair_space>set<seq2seq4repair_space>inputParameters.<seq2seq4repair_space>Setting<seq2seq4repair_space>InputParam<seq2seq4repair_space>(postURL:<seq2seq4repair_space>" + inputParamPostUrl ) + ")<seq2seq4repair_space>" ) + inputParam ) + "<seq2seq4repair_space>failed,<seq2seq4repair_space>Service<seq2seq4repair_space>for<seq2seq4repair_space>Plan<seq2seq4repair_space>Upload<seq2seq4repair_space>sent<seq2seq4repair_space>statusCode<seq2seq4repair_space>" ) + ( inputParamPostResponse . getStatusLine ( ) . getStatusCode ( ) ) ) ) ; return ; } TaskWorkerRunnable . LOG . debug ( ( "Sent<seq2seq4repair_space>inputParameter<seq2seq4repair_space>" + inputParam ) ) ; }

Fix:
mpEntity . addPart ( "file" , cb ) ;