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" ) ; private static final String DEPLOYED = ".deployed" ; private File deploymentDir ; private long scanInterval = 0 ; private volatile boolean scanEnabled = false ; private ScheduledFuture < ? > scanTask ; private final Lock scanLock = new ReentrantLock ( ) ; private Set < String > deployed = new HashSet < String > ( ) ; private final ServerModel serverModel ; private final ScheduledExecutorService scheduledExecutor ; private final ServerController serverController ; private final DeploymentRepository deploymentRepository ; private FileFilter filter = new ExtensibleFilter ( ) ; FileSystemDeploymentService ( final File deploymentDir , final long scanInterval , final ServerModel serverModel , final ServerController serverController , final ScheduledExecutorService scheduledExecutor , DeploymentRepository deploymentRepository ) { } public boolean isEnabled ( ) { } public long getScanInterval ( ) { } public synchronized void setScanInterval ( long scanInterval ) { } public boolean isScanEnabled ( ) { } public synchronized void startScanner ( ) { } public synchronized void stopScanner ( ) { } void validate ( ) { } private void establishDeployedContentList ( File dir ) { } private void scan ( ) { } private Set < String > cleanSpuriousMarkerFiles ( Map < String , File > found ) { } private void scanDirectory ( File directory , final List < AbstractServerModelUpdate < ? > > updates , Map < String , File > foundDeployed , Set < String > newlyAdded ) { File [ ] children = directory . listFiles ( filter ) ; if ( children == null ) { return ; } for ( File child : children ) { String fileName = child . getName ( ) ; if ( fileName . endsWith ( FileSystemDeploymentService . DEPLOYED ) ) { String origName = fileName . substring ( 0 , ( ( fileName . length ( ) ) - ( FileSystemDeploymentService . DEPLOYED . length ( ) ) ) ) ; foundDeployed . put ( origName , child ) ; } else if ( child . isDirectory ( ) ) { int idx = fileName . lastIndexOf ( '.' ) ; if ( ( idx > ( - 1 ) ) && ( FileSystemDeploymentService . ARCHIVES . contains ( fileName . substring ( idx ) ) ) ) { FileSystemDeploymentService . log . warnf ( "%s<seq2seq4repair_space>is<seq2seq4repair_space>an<seq2seq4repair_space>exploded<seq2seq4repair_space>deployment<seq2seq4repair_space>and<seq2seq4repair_space>exploded<seq2seq4repair_space>deployments<seq2seq4repair_space>are<seq2seq4repair_space>not<seq2seq4repair_space>currently<seq2seq4repair_space>handled<seq2seq4repair_space>by<seq2seq4repair_space>%s" , child . getName ( ) , getClass ( ) . getSimpleName ( ) ) ; } else { scanDirectory ( child , updates , foundDeployed , newlyAdded ) ; } } else { boolean uploaded = false ; ServerGroupDeploymentElement deployment = serverModel . getDeployment ( fileName ) ; if ( deployment != null ) { byte [ ] hash = new byte [ 0 ] ; try { final InputStream inputStream = new FileInputStream ( child ) ; hash = deploymentRepository . addDeploymentContent ( deployment . getUniqueName ( ) , deployment . getRuntimeName ( ) , inputStream ) ; } 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>[" + fileName ) + "]" ) , e ) ; continue ; } updates . add ( new org . jboss . as . server . deployment . ServerModelDeploymentFullReplaceUpdate ( deployment . getUniqueName ( ) , deployment . getRuntimeName ( ) , hash , true ) ) ; uploaded = true ; } else { byte [ ] hash = new byte [ 0 ] ; try { final InputStream inputStream = new FileInputStream ( child ) ; hash = deploymentRepository . addDeploymentContent ( fileName , fileName , inputStream ) ; } 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>[" + fileName ) + "]" ) , e ) ; continue ; } updates . add ( new ServerModelDeploymentAdd ( fileName , fileName , hash ) ) ; <START_BUG> updates . add ( new ServerModelDeploymentStartUpdate ( fileName , fileName , hash ) ) ; <END_BUG> uploaded = true ; } if ( uploaded && ( replaceWithDeployedMarker ( child ) ) ) { newlyAdded . add ( fileName ) ; } } } } private boolean replaceWithDeployedMarker ( File child ) { } private synchronized void startScan ( ) { } private void cancelScan ( ) { } }

Fix:
updates . add ( new ServerModelDeploymentStartUpdate ( fileName ) ) ;