Buggy code:
public class MergeAction implements Action { final MergeAction . MergingParameters actionParameters = new MergeAction . MergingParameters ( ) ; @ Override public void go ( ActionHelper helper ) throws Exception { <START_BUG> final MismatchOnlyPairedReadMerger merger = new MismatchOnlyPairedReadMerger ( actionParameters . overlap , ( 1.0 - ( actionParameters . similarity ) ) ) ; <END_BUG> long total = 0 ; long overlapped = 0 ; try ( PairedFastqReader reader = new PairedFastqReader ( actionParameters . getR1 ( ) , actionParameters . getR2 ( ) ) ; SingleFastqWriter mainWriter = MiCLIUtil . createSingleWriter ( actionParameters . getOutput ( ) ) ; SingleFastqWriter nfWriter = ( ( actionParameters . forwardNegative ) == null ) ? null : new SingleFastqWriter ( actionParameters . forwardNegative ) ; SingleFastqWriter nrWriter = ( ( actionParameters . reverseNegative ) == null ) ? null : new SingleFastqWriter ( actionParameters . reverseNegative ) ) { SmartProgressReporter . startProgressReport ( "Merging" , reader , System . err ) ; final Merger < PairedRead > buffered = CUtils . buffered ( reader , 256 ) ; ParallelProcessor < PairedRead , PairedReadMergingResult > processor = new ParallelProcessor ( buffered , merger , 1024 , actionParameters . threads ) ; OrderedOutputPort < PairedReadMergingResult > oop = new OrderedOutputPort ( processor , new cc . redberry . pipe . util . Indexer < PairedReadMergingResult > ( ) { @ Override public long getIndex ( PairedReadMergingResult pairedReadMergingResult ) { return pairedReadMergingResult . getOriginalRead ( ) . getId ( ) ; } } ) ; final boolean includeNonOverlapped = actionParameters . includeNonOverlapped ; long id = 0 ; for ( PairedReadMergingResult result : CUtils . it ( oop ) ) { ++ total ; if ( result . isSuccessful ( ) ) { mainWriter . write ( new com . milaboratory . core . io . sequence . SingleReadImpl ( result . getOriginalRead ( ) . getId ( ) , result . getOverlappedSequence ( ) , result . getOriginalRead ( ) . getR1 ( ) . getDescription ( ) ) ) ; ++ overlapped ; } else { if ( nfWriter != null ) { nfWriter . write ( result . getOriginalRead ( ) . getR1 ( ) ) ; } if ( nrWriter != null ) { nrWriter . write ( result . getOriginalRead ( ) . getR2 ( ) ) ; } if ( includeNonOverlapped ) { mainWriter . write ( result . getOriginalRead ( ) . getR1 ( ) ) ; mainWriter . write ( result . getOriginalRead ( ) . getR2 ( ) ) ; } } } } if ( ( actionParameters . report ) != null ) { boolean n = ! ( new File ( actionParameters . report ) . exists ( ) ) ; try ( PrintStream reportStream = new PrintStream ( new FileOutputStream ( actionParameters . report , true ) ) ) { if ( n ) reportStream . println ( "OutputFileName\tTotal\tOverlapped\tOverlappedPercent" ) ; reportStream . println ( ( ( ( ( ( ( ( actionParameters . getOutput ( ) ) + "\t" ) + total ) + "\t" ) + overlapped ) + "\t" ) + ( ( 100.0 * overlapped ) // total ) ) ) ; } } } @ Override public String command ( ) { } @ Override public ActionParameters params ( ) { } @ Parameters ( commandDescription = "Merge<seq2seq4repair_space>overlapping<seq2seq4repair_space>paired-end<seq2seq4repair_space>reads." , optionPrefixes = "-" ) public static final class MergingParameters extends ActionParameters { @ Parameter ( description = "input_file_R1.fastq[.gz]<seq2seq4repair_space>input_file_R2.fastq[.gz]<seq2seq4repair_space>-|output_file.fastq[.gz]" , variableArity = true ) public List < String > parameters = new ArrayList < > ( ) ; @ Parameter ( description = "FASTQ<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>put<seq2seq4repair_space>non-overlapped<seq2seq4repair_space>forward<seq2seq4repair_space>reads<seq2seq4repair_space>(supported<seq2seq4repair_space>formats:<seq2seq4repair_space>" + "*.fastq<seq2seq4repair_space>and<seq2seq4repair_space>*.fastq.gz)." , names = { "-nf" , "--negative-forward" } , converter = FileConverter . class ) File forwardNegative ; @ Parameter ( description = "FASTQ<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>put<seq2seq4repair_space>non-overlapped<seq2seq4repair_space>reverse<seq2seq4repair_space>reads<seq2seq4repair_space>(supported<seq2seq4repair_space>formats:<seq2seq4repair_space>" + "*.fastq<seq2seq4repair_space>and<seq2seq4repair_space>*.fastq.gz)." , names = { "-nr" , "--negative-reverse" } , converter = FileConverter . class ) File reverseNegative ; @ Parameter ( description = "Report<seq2seq4repair_space>file." , names = { "-r" , "--report" } ) String report ; @ Parameter ( description = "Include<seq2seq4repair_space>both<seq2seq4repair_space>paired-end<seq2seq4repair_space>reads<seq2seq4repair_space>for<seq2seq4repair_space>pairs<seq2seq4repair_space>where<seq2seq4repair_space>no<seq2seq4repair_space>overlap<seq2seq4repair_space>was<seq2seq4repair_space>found." , names = { "-i" , "--include-non-overlapped" } ) boolean includeNonOverlapped ; @ Parameter ( description = "Discard<seq2seq4repair_space>original<seq2seq4repair_space>sequence<seq2seq4repair_space>header<seq2seq4repair_space>and<seq2seq4repair_space>put<seq2seq4repair_space>sequential<seq2seq4repair_space>ids." , names = { "-d" , "--discard-header" } ) boolean discardHeader ; @ Parameter ( description = "Minimal<seq2seq4repair_space>overlap." , names = { "-p" , "--overlap" } , validateWith = PositiveInteger . class ) int overlap = 15 ; @ Parameter ( description = "Minimal<seq2seq4repair_space>allowed<seq2seq4repair_space>similarity" , names = { "-s" , "--similarity" } ) double similarity = 0.85 ; @ Parameter ( description = "Threads" , names = { "-t" , "--threads" } , validateWith = PositiveInteger . class ) int threads = Math . min ( Runtime . getRuntime ( ) . availableProcessors ( ) , 4 ) ; public String getR1 ( ) { } public String getR2 ( ) { } public String getOutput ( ) { } @ Override public void validate ( ) { } } }

Fix:
final MismatchOnlyPairedReadMerger merger = new MismatchOnlyPairedReadMerger ( actionParameters . overlap , actionParameters . similarity ) ;