Buggy code:
class DomainApiHandler implements ManagementHttpHandler { private static final String DOMAIN_API_CONTEXT = "//management" ; private static final String UPLOAD_REQUEST = ( DomainApiHandler . DOMAIN_API_CONTEXT ) + "//add-content" ; private static Pattern MULTIPART_FD_BOUNDARY = Pattern . compile ( "^multipart//form-data.*;\\s*boundary=(.*)$" ) ; private static Pattern DISPOSITION_FILE = Pattern . compile ( "^form-data.*filename=\"?([^\"]*)?\"?.*$" ) ; private static final Logger log = Logger . getLogger ( "org.jboss.as.domain.http.api" ) ; enum GetOperation { RESOURCE ( "read-resource" ) , ATTRIBUTE ( "read-attribute" ) , RESOURCE_DESCRIPTION ( "read-resource-description" ) , OPERATION_DESCRIPTION ( "read-operation-description" ) , OPERATION_NAMES ( "read-operation-names" ) ; private String realOperation ; GetOperation ( String realOperation ) { } public String realOperation ( ) { } } private NewModelControllerClient modelController ; DomainApiHandler ( NewModelControllerClient modelController ) { } public void handle ( HttpExchange http ) throws IOException { } private void processUploadRequest ( final HttpExchange http ) throws IOException { File tempUploadFile = null ; ModelNode response = null ; try { DomainApiHandler . SeekResult result = seekToDeployment ( http ) ; final ModelNode dmr = new ModelNode ( ) ; dmr . get ( "operation" ) . set ( "upload-deployment-stream" ) ; dmr . get ( "address" ) . setEmptyList ( ) ; dmr . get ( "input-stream-index" ) . set ( 0 ) ; <START_BUG> NewOperationBuilder operation = Factory . create ( dmr ) ; <END_BUG> operation . addInputStream ( result . stream ) ; response = modelController . execute ( operation . build ( ) ) ; drain ( http . getRequestBody ( ) ) ; } catch ( Throwable t ) { DomainApiHandler . log . error ( "Unexpected<seq2seq4repair_space>error<seq2seq4repair_space>executing<seq2seq4repair_space>deployment<seq2seq4repair_space>upload<seq2seq4repair_space>request" , t ) ; http . sendResponseHeaders ( Constants . INTERNAL_SERVER_ERROR , ( - 1 ) ) ; return ; } writeResponse ( http , false , false , response , Constants . OK , false , Constants . TEXT_HTML ) ; } private void processRequest ( final HttpExchange http ) throws IOException { } private void writeResponse ( final HttpExchange http , boolean isGet , boolean pretty , ModelNode response , int status , boolean encode ) throws IOException { } private void writeResponse ( final HttpExchange http , boolean isGet , boolean pretty , ModelNode response , int status , boolean encode , String contentType ) throws IOException { } private static final class SeekResult { BoundaryDelimitedInputStream stream ; String fileName ; } private DomainApiHandler . SeekResult seekToDeployment ( final HttpExchange http ) throws IOException { } private void drain ( InputStream stream ) { } private void safeClose ( Closeable close ) { } private ModelNode convertPostRequest ( InputStream stream , boolean encode ) throws IOException { } private ModelNode convertGetRequest ( URI request ) { } private ArrayList < String > decodePath ( String path ) { } private String unescape ( String string ) { } private Map < String , String > decodeQuery ( String query ) { } public void start ( HttpServer httpServer , SecurityRealm securityRealm ) { } public void stop ( HttpServer httpServer ) { } }

Fix:
NewOperationBuilder operation = new NewOperationBuilder ( dmr ) ;