Buggy code:
@ Override public void setAutoDeployExplodedContent ( boolean autoDeployExploded ) { } @ Override public boolean isEnabled ( ) { } @ Override public long getScanInterval ( ) { } @ Override public synchronized void setScanInterval ( long scanInterval ) { } @ Override public void setDeploymentTimeout ( long deploymentTimeout ) { } @ Override public synchronized void startScanner ( ) { } @ Override public synchronized void stopScanner ( ) { } void setMaxNoProgress ( long max ) { } private void establishDeployedContentList ( File dir ) throws OperationFailedException { } void scan ( ) { } private void scanDirectory ( final File directory , final String relativePath , final FileSystemDeploymentService . ScanContext scanContext ) { } private long addContentAddingTask ( final String path , final boolean archive , final String deploymentName , final File deploymentFile , final long timestamp , final FileSystemDeploymentService . ScanContext scanContext ) { } private boolean isZipComplete ( File file ) throws NonScannableZipException { } private boolean isAutoDeployDisabled ( File file ) { } private long getDeploymentTimestamp ( File deploymentFile ) { } private boolean isEEArchive ( String fileName ) { } private void removeExtraneousMarker ( File child , final String fileName ) { } private FileSystemDeploymentService . ScanStatus handleAutoDeployFailures ( FileSystemDeploymentService . ScanContext scanContext ) { } 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 createMarkerFile ( final File marker , String deploymentName ) { } private void writeFailedMarker ( final File deploymentFile , final ModelNode failureDescription , long failureTimestamp ) { } 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 void recordInProgress ( ) { } protected abstract ModelNode getUpdate ( ) { } protected abstract void handleSuccessResult ( ) ; protected abstract void handleFailureResult ( final ModelNode result ) { } protected void deletePendingMarker ( ) { } protected void deleteUndeployedMarker ( ) { } protected void deleteDeployedMarker ( ) { } protected void removeInProgressMarker ( ) { } } private abstract class ContentAddingTask extends FileSystemDeploymentService . ScannerTask { private final String path ; private final boolean archive ; protected final File deploymentFile ; protected final long doDeployTimestamp ; protected ContentAddingTask ( final String path , final boolean archive , final String deploymentName , final File deploymentFile , long markerTimestamp ) { } protected ModelNode createContent ( ) { } @ Override protected void handleSuccessResult ( ) { final File doDeployMarker = new File ( new File ( parent ) , ( ( deploymentFile . getName ( ) ) + ( FileSystemDeploymentService . DO_DEPLOY ) ) ) ; if ( ( doDeployMarker . exists ( ) ) && ( ! ( doDeployMarker . delete ( ) ) ) ) { FileSystemDeploymentService . log . errorf ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>delete<seq2seq4repair_space>deployment<seq2seq4repair_space>marker<seq2seq4repair_space>file<seq2seq4repair_space>%s" , doDeployMarker . getAbsolutePath ( ) ) ; } final File failedMarker = new File ( deploymentFile . getParent ( ) , ( ( deploymentFile . getName ( ) ) + ( FileSystemDeploymentService . FAILED_DEPLOY ) ) ) ; if ( ( failedMarker . exists ( ) ) && ( ! ( failedMarker . delete ( ) ) ) ) { FileSystemDeploymentService . log . warnf ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>remove<seq2seq4repair_space>marker<seq2seq4repair_space>file<seq2seq4repair_space>%s" , failedMarker ) ; } removeInProgressMarker ( ) ; final File deployedMarker = new File ( parent , ( ( deploymentFile . getName ( ) ) + ( FileSystemDeploymentService . DEPLOYED ) ) ) ; createMarkerFile ( deployedMarker , deploymentName ) ; deployedMarker . setLastModified ( doDeployTimestamp ) ; if ( deployed . containsKey ( deploymentName ) ) { deployed . remove ( deploymentName ) ; } <START_BUG> deployed . put ( deploymentName , new FileSystemDeploymentService . DeploymentMarker ( deployedMarker . lastModified ( ) , archive ) ) ; <END_BUG> } } private final class DeployTask extends FileSystemDeploymentService . ContentAddingTask { private DeployTask ( final String path , final boolean archive , final String deploymentName , final File deploymentFile , long markerTimestamp ) { } @ Override protected ModelNode getUpdate ( ) { } @ Override protected void handleFailureResult ( final ModelNode result ) { } } private final class ReplaceTask extends FileSystemDeploymentService . ContentAddingTask { private ReplaceTask ( final String path , final boolean archive , String deploymentName , File deploymentFile , long markerTimestamp ) { } @ Override protected ModelNode getUpdate ( ) { } @ Override protected void handleFailureResult ( ModelNode result ) { } } private final class RedeployTask extends FileSystemDeploymentService . ScannerTask { private final long markerLastModified ; private final boolean archive ; private RedeployTask ( final String deploymentName , final long markerLastModified , final File parent , boolean archive ) { } @ Override protected ModelNode getUpdate ( ) { } @ Override protected void handleSuccessResult ( ) { removeInProgressMarker ( ) ; deployed . remove ( deploymentName ) ; deployed . put ( deploymentName , new FileSystemDeploymentService . DeploymentMarker ( markerLastModified , archive ) ) ; } @ Override protected void handleFailureResult ( ModelNode result ) { } } private final class UndeployTask extends FileSystemDeploymentService . ScannerTask { private final long scanStartTime ; private UndeployTask ( final String deploymentName , final File parent , final long scanStartTime ) { } @ Override protected ModelNode getUpdate ( ) { } @ Override protected void handleSuccessResult ( ) { removeInProgressMarker ( ) ; deleteDeployedMarker ( ) ; final File undeployedMarker = new File ( parent , ( ( deploymentName ) + ( FileSystemDeploymentService . UNDEPLOYED ) ) ) ; createMarkerFile ( undeployedMarker , deploymentName ) ; undeployedMarker . setLastModified ( scanStartTime ) ; deployed . remove ( deploymentName ) ;

Fix:
deployed . put ( deploymentName , new FileSystemDeploymentService . DeploymentMarker ( doDeployTimestamp , archive ) ) ;