Buggy code:
class FileSystemDeploymentService implements DeploymentScanner { private static final Set < String > ARCHIVES = new HashSet < String > ( Arrays . asList ( ".jar" , ".war" , ".ear" , ".rar" , ".sar" , ".beans" ) ) ; private static final Logger log = Logger . getLogger ( "org.jboss.as.deployment" ) ; static final String DEPLOYED = ".isdeployed" ; static final String FAILED_DEPLOY = ".faileddeploy" ; static final String DO_DEPLOY = ".dodeploy" ; static final String DEPLOYING = ".deploying" ; static final String UNDEPLOYING = ".undeploying" ; static final String UNDEPLOYED = ".undeployed" ; private File deploymentDir ; private long scanInterval = 0 ; private volatile boolean scanEnabled = false ; private ScheduledFuture < ? > scanTask ; private final Lock scanLock = new ReentrantLock ( ) ; private final Map < String , FileSystemDeploymentService . DeploymentMarker > deployed = new HashMap < String , FileSystemDeploymentService . DeploymentMarker > ( ) ; private final ScheduledExecutorService scheduledExecutor ; private final ServerController serverController ; private final ServerDeploymentRepository deploymentRepository ; private FileFilter filter = new ExtensibleFilter ( ) ; FileSystemDeploymentService ( final File deploymentDir , final long scanInterval , final ServerController serverController , final ScheduledExecutorService scheduledExecutor , ServerDeploymentRepository deploymentRepository ) throws OperationFailedException { } @ Override public boolean isEnabled ( ) { } @ Override public long getScanInterval ( ) { } @ Override public synchronized void setScanInterval ( long scanInterval ) { } public boolean isScanEnabled ( ) { } @ Override public synchronized void startScanner ( ) { } @ Override public synchronized void stopScanner ( ) { } private void establishDeployedContentList ( File dir ) throws OperationFailedException { } void scan ( ) { } private void scanDirectory ( final File directory , final List < FileSystemDeploymentService . ScannerTask > events , final Set < String > registeredDeployments , final Set < String > toRemove ) { } private synchronized void startScan ( ) { } private void cancelScan ( ) { } private Set < String > getDeploymentNames ( ) throws CancellationException { } private ModelNode getCompositeUpdate ( final List < ModelNode > updates ) { } private ModelNode getCompositeUpdate ( final ModelNode ... updates ) { } private void safeClose ( final Closeable closeable ) { } private void writeFailedMarker ( final File deploymentFile , final ModelNode failureDescription ) { } private abstract class ScannerTask { protected final String deploymentName ; protected final String parent ; private final String inProgressMarkerSuffix ; private ScannerTask ( final String deploymentName , final File parent , final String inProgressMarkerSuffix ) { } protected abstract ModelNode getUpdate ( ) ; protected abstract void handleSuccessResult ( ) { } protected abstract void handleFailureResult ( final ModelNode result ) { } protected void createMarkerFile ( final File marker ) { } protected void deleteUndeployedMarker ( ) { } protected void removeInProgressMarker ( ) { } } private abstract class ContentAddingTask extends FileSystemDeploymentService . ScannerTask { protected final File deploymentFile ; protected final long doDeployTimestamp ; protected ContentAddingTask ( final String deploymentName , final File deploymentFile , long markerTimestamp ) { } @ Override protected ModelNode getUpdate ( ) { byte [ ] hash = new byte [ 0 ] ; if ( deploymentFile . isDirectory ( ) ) { try { hash = deploymentRepository . addExternalFileReference ( deploymentFile ) ; } catch ( IOException e ) { FileSystemDeploymentService . log . error ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>add<seq2seq4repair_space>content<seq2seq4repair_space>to<seq2seq4repair_space>deployment<seq2seq4repair_space>repository<seq2seq4repair_space>for<seq2seq4repair_space>[" + ( deploymentName ) ) + "]" ) , e ) ; } return getUpdatesAfterContent ( hash ) ; } InputStream inputStream = null ; try { inputStream = new FileInputStream ( deploymentFile ) ; <START_BUG> hash = deploymentRepository . addDeploymentContent ( deploymentName , deploymentName , inputStream ) ; <END_BUG> } catch ( IOException e ) { FileSystemDeploymentService . log . error ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>add<seq2seq4repair_space>content<seq2seq4repair_space>to<seq2seq4repair_space>deployment<seq2seq4repair_space>repository<seq2seq4repair_space>for<seq2seq4repair_space>[" + ( deploymentName ) ) + "]" ) , e ) ; } finally { safeClose ( inputStream ) ; } return getUpdatesAfterContent ( hash ) ; } protected abstract ModelNode getUpdatesAfterContent ( final byte [ ] hash ) { } @ Override protected void handleSuccessResult ( ) { } } private final class DeployTask extends FileSystemDeploymentService . ContentAddingTask { private DeployTask ( final String deploymentName , final File deploymentFile , long markerTimestamp ) { } @ Override protected ModelNode getUpdatesAfterContent ( final byte [ ] hash ) { } @ Override protected void handleFailureResult ( final ModelNode result ) { } } private final class ReplaceTask extends FileSystemDeploymentService . ContentAddingTask { private ReplaceTask ( String deploymentName , File deploymentFile , long markerTimestamp ) { } @ Override protected ModelNode getUpdatesAfterContent ( byte [ ] hash ) { } @ Override protected void handleFailureResult ( ModelNode result ) { } } private final class RedeployTask extends FileSystemDeploymentService . ScannerTask { private final long markerLastModified ; private RedeployTask ( final String deploymentName , final long markerLastModified , final File parent ) { } @ Override protected ModelNode getUpdate ( ) { final ModelNode address = new ModelNode ( ) . add ( DEPLOYMENT , deploymentName ) ; return Util . getEmptyOperation ( OPERATION_NAME , address ) ; } @ Override protected void handleSuccessResult ( ) { } @ Override protected void handleFailureResult ( ModelNode result ) { } } private final class UndeployTask extends FileSystemDeploymentService . ScannerTask { private UndeployTask ( final String deploymentName , final File parent ) { } @ Override protected ModelNode getUpdate ( ) { final ModelNode address = new ModelNode ( ) . add ( DEPLOYMENT , deploymentName ) ; final ModelNode undeployOp = Util . getEmptyOperation ( DeploymentUndeployHandler . OPERATION_NAME , address ) ; final ModelNode removeOp = Util . getEmptyOperation ( DeploymentRemoveHandler . OPERATION_NAME , address ) ; return getCompositeUpdate ( undeployOp , removeOp ) ; } @ Override protected void handleSuccessResult ( ) { } @ Override protected void handleFailureResult ( ModelNode result ) { } } private class DeploymentMarker { private long lastModified ; private DeploymentMarker ( final long lastModified ) { } } }

Fix:
hash = deploymentRepository . addDeploymentContent ( inputStream ) ;