Buggy code:
private boolean _isExitAfterEOF ; private boolean _isSafeFileList = true ; private boolean _isDelete ; private boolean _isDeleteExcluded ; private final boolean _isDeleteBefore = true ; private int _ioError ; private Receiver . PathResolver _pathResolver ; public Receiver ( Generator generator , ReadableByteChannel in , Charset charset , String targetPathName ) { } public static Receiver newServerInstance ( Generator generator , ReadableByteChannel in , Charset charset , String targetPathName ) { } public static Receiver newClientInstance ( Generator generator , ReadableByteChannel in , Charset charset , String targetPathName ) { } public Receiver setIsRecursive ( boolean isRecursive ) { } public Receiver setIsListOnly ( boolean isListOnly ) { } public Receiver setIsPreservePermissions ( boolean isPreservePermissions ) { } public Receiver setIsPreserveTimes ( boolean isPreserveTimes ) { } public Receiver setIsPreserveUser ( boolean isPreserveUser ) { } public Receiver setIsDeferredWrite ( boolean isDeferredWrite ) { } public Receiver setIsDelete ( boolean isDelete ) { } public Receiver setIsDeleteExcluded ( boolean isDeleteExcluded ) { } public Receiver setIsExitAfterEOF ( boolean isExitAfterEOF ) { } public Receiver setIsInterruptible ( boolean isInterruptible ) { } public Receiver setIsSendFilterRules ( boolean isSendFilterRules ) { } public Receiver setFilterRuleConfiguration ( FilterRuleConfiguration filterRuleConfiguration ) { } public Receiver setIsReceiveStatistics ( boolean isReceiveStatistics ) { } public Receiver setIsExitEarlyIfEmptyList ( boolean isExitEarlyIfEmptyList ) { } public Receiver setIsSafeFileList ( boolean isSafeFileList ) { } @ Override public boolean isInterruptible ( ) { } @ Override public void closeChannel ( ) throws ChannelException { } @ Override public Boolean call ( ) throws RsyncException , InterruptedException { } private Map < Integer , User > receiveUserList ( ) throws ChannelException { } private void addUserNameToStubs ( Map < Integer , User > uidUserMap , List < Receiver . FileInfoStub > stubs ) throws ChannelException { } private Receiver . PathResolver getPathResolver ( final Path targetPath , final List < Receiver . FileInfoStub > stubs ) throws Receiver . PathResolverException { } private void receiveStatistics ( ) throws ChannelException { } private void sendFilterRules ( ) throws InterruptedException { } private List < String > receiveFilterRules ( ) throws ChannelException { } public Statistics statistics ( ) { } @ Override public void handleMessage ( Message message ) { } private void printMessage ( Message message ) { } private void handleMessageNoSend ( int index ) { } private Header receiveChecksumHeader ( ) throws ChannelException { } private void receiveFiles ( Filelist fileList , Filelist . Segment firstSegment ) throws ChannelException , InterruptedException { } private boolean isRemoteAndLocalFileIdentical ( Path localFile , MessageDigest md , FileInfo fileInfo ) throws ChannelException { } private void moveTempfileToTarget ( Path tempFile , Path target ) { } private void updateAttrsIfDiffer ( Path path , RsyncFileAttributes targetAttrs ) throws IOException { } private void matchData ( Filelist . Segment segment , int index , FileInfo fileInfo , Checksum . Header checksumHeader , Path tempFile ) throws ChannelException , InterruptedException { } private int receiveAndDecodeInt ( ) throws ChannelException { } private long receiveAndDecodeLong ( int minBytes ) throws ChannelException { } private int receiveFileMetaDataInto ( List < Receiver . FileInfoStub > builder ) throws ChannelException { } private int extractFileMetadata ( List < Receiver . FileInfoStub > stubs , Filelist . SegmentBuilder builder ) throws InterruptedException { } private byte [ ] receivePathNameBytes ( char xflags ) throws ChannelException { } private RsyncFileAttributes receiveRsyncFileAttributes ( char xflags ) throws ChannelException { } private User getPreviousUser ( ) { } private User receiveIncompleteUser ( ) throws ChannelException { } private int receiveUserId ( ) throws ChannelException { } private String receiveUserName ( ) throws ChannelException { } private User receiveUser ( ) throws ChannelException { } private void discardData ( Checksum . Header checksumHeader ) throws ChannelException { } private Path mergeDataFromPeerAndReplica ( FileInfo fileInfo , Path tempFile , Checksum . Header checksumHeader , MessageDigest md ) throws ChannelException { } private boolean combineDataToFile ( SeekableByteChannel replica , SeekableByteChannel outFile , Checksum . Header checksumHeader , MessageDigest md ) throws ChannelException , IOException { } private void copyRemoteBlocks ( SeekableByteChannel outFile , int length , MessageDigest md ) throws ChannelException { } private void verifyBlockRange ( int endIndex , Checksum . Header checksumHeader , SeekableByteChannel replica , MessageDigest md ) throws IOException { } private void copyBlockRange ( int endIndex , Checksum . Header checksumHeader , SeekableByteChannel replica , SeekableByteChannel outFile , MessageDigest md ) throws IOException { } private void matchReplica ( int blockIndex , Checksum . Header checksumHeader , SeekableByteChannel replica , SeekableByteChannel outFile , MessageDigest md ) throws IOException { } private int sizeForChecksumBlock ( int blockIndex , Checksum . Header checksumHeader ) { } private void writeOut ( SeekableByteChannel outFile , ByteBuffer src ) { } public void readAllMessagesUntilEOF ( ) throws ChannelException { } public int deleteUnmatchedFiles ( Filelist . SegmentBuilder builder , Path path ) { } private boolean deleteUnmatchedFile ( Filelist . SegmentBuilder builder , Path entry ) throws IOException { Path relativePath = _pathResolver . relativePathOf ( entry ) ; if ( relativePath . equals ( EMPTY ) ) { return false ; } String relativePathName = Text . withSlashAsPathSepator ( relativePath . toString ( ) ) ; byte [ ] pathNameBytes = _characterEncoder . encodeOrNull ( relativePathName ) ; if ( pathNameBytes != null ) { FileInfo fileInfo = new FileInfo ( entry , relativePath , pathNameBytes , RsyncFileAttributes . stat ( entry ) ) ; <START_BUG> boolean isEntryExcluded = _filterRuleConfiguration . getFilterRuleList ( ) . exclude ( ( ".//" + relativePathName ) , Files . isDirectory ( entry ) ) ; <END_BUG> if ( ( ( ! isEntryExcluded ) && ( _isDelete ) ) && ( ! ( builder . contains ( fileInfo ) ) ) ) { PathOps . deleteIfExists ( fileInfo . path ( ) ) ; return true ; } else if ( isEntryExcluded && ( _isDeleteExcluded ) ) { PathOps . deleteIfExists ( fileInfo . path ( ) ) ; return true ; } } return false ; } }

Fix:
boolean isEntryExcluded = _filterRuleConfiguration . exclude ( ( ".//" + relativePathName ) , Files . isDirectory ( entry ) ) ;