Buggy code:
public class DictExpansion < T extends Comparable < T > > extends WeakListenerHolderImpl < DictExpansion < T > > { public static final double POISSON_SIGNIFICANCE = 0.05 ; public static final double EXTENSION_FACTOR = 1.33 ; public static final double MAX_POWER = 100000000 ; public static final double MAX_MIN_PROBABILITY = 1.0E-4 ; public static final int AGG_POWER = 100000 ; private final boolean isDynamic ; private int size ; private final PrintStream trace ; private final Dictionary < T > initial ; private volatile DictExpansion . DictionaryWithStat < T > suggest ; private volatile DictExpansion . DictionaryWithStat < T > current ; private DictExpansion . DictionaryWithStat < T > result ; private final int alphabetSize ; private double probFound = 0.1 ; private double bestCompressionRate = 1 ; private int noRateIncreaseTurns = 0 ; public DictExpansion ( final Collection < T > alphabet , final int size ) { } @ Deprecated public DictExpansion ( final Collection < T > alphabet , final int size , final boolean trace ) { } public DictExpansion ( final Collection < T > alphabet , final int size , final PrintStream trace ) { } public DictExpansion ( final Dictionary < T > alphabet , final int size ) { } public DictExpansion ( final Dictionary < T > alphabet , final int size , final PrintStream trace ) { } public DictExpansion ( int slots ) { } public DictExpansion ( int size , PrintStream trace ) { } @ NotNull private static < T extends Comparable < T > > DictExpansion . DictionaryWithStat < T > createDict ( Collection < Seq < T > > alphabet , boolean isDynamic , double minProbResult ) { } public Dictionary < T > result ( ) { } public Dictionary < T > alpha ( ) { } private final ReadWriteLock lock = new ReentrantReadWriteLock ( ) ; public void accept ( final Seq < T > seq ) { } private boolean update ( ) { lock . writeLock ( ) . lock ( ) ; try { <START_BUG> if ( ( ( ! ( current . enough ( probFound ) ) ) || ( ! ( current . enough ( probFound ) ) ) ) && ( ( suggest . power ) < ( DictExpansion . MAX_POWER ) ) ) <END_BUG> return false ; double sum = 0 ; double textLength = 0 ; for ( int i = 0 ; i < ( current . size ( ) ) ; i ++ ) { final int freq = current . freq ( i ) ; textLength += ( current . get ( i ) . length ( ) ) * freq ; if ( freq > 0 ) sum -= ( freq * ( Math . log ( freq ) ) ) // ( Math . log ( 2 ) ) ; } final double codeLength = ( sum + ( ( ( current . power ) * ( Math . log ( current . power ) ) ) // ( Math . log ( 2 ) ) ) ) // 8.0 ; final double compressionRate = codeLength // textLength ; if ( compressionRate < ( bestCompressionRate ) ) { bestCompressionRate = compressionRate ; noRateIncreaseTurns = 0 ; } else if ( ( ++ ( noRateIncreaseTurns ) ) > 3 ) { probFound *= 0.8 ; } result = current ; DictExpansion . invoke ( this ) ; if ( ( trace ) != null ) { final String message = ( ( ( ( "Size:<seq2seq4repair_space>" + ( current . size ( ) ) ) + "<seq2seq4repair_space>rate:<seq2seq4repair_space>" ) + compressionRate ) + "<seq2seq4repair_space>minimal<seq2seq4repair_space>probability:<seq2seq4repair_space>" ) + ( suggest . minProbability ) ; trace . println ( message ) ; } final DictExpansion . DictionaryWithStat < T > currentLocal = current ; current = suggest . reduce ( ( ( size ) - ( alphabetSize ) ) , isDynamic ) ; int slots ; if ( ( ( int ) ( ( currentLocal . size ( ) ) * ( ( DictExpansion . EXTENSION_FACTOR ) - 1 ) ) ) < 10 ) slots = ( size ) - ( alphabetSize ) ; else slots = Math . min ( ( ( size ) - ( alphabetSize ) ) , ( ( int ) ( ( currentLocal . size ( ) ) * ( ( DictExpansion . EXTENSION_FACTOR ) - 1 ) ) ) ) ; suggest = currentLocal . expand ( slots , isDynamic ) ; return true ; } finally { lock . writeLock ( ) . unlock ( ) ; } } public int [ ] resultFreqs ( ) { } public void printPairs ( Writer ps ) throws IOException { } public void print ( FileWriter fileWriter ) throws IOException { } public static class DictionaryWithStat < T extends Comparable < T > > extends DictionaryBase < T > { private final Dictionary < T > dict ; private final TIntArrayList symbolFreqs ; private double power = 0 ; private final LongIntMappingAsyncBuilder pairsFreqs ; private final double minProbability ; public DictionaryWithStat ( Dictionary < T > dict , double minProbResult ) { } public void updateSymbol ( int index , int freq ) { } @ Override public int search ( Seq < T > seq ) { } @ Override public Seq < T > get ( int index ) { } @ Override public int size ( ) { } @ Override public List < ? extends Seq < T > > alphabet ( ) { } @ Override public int parent ( int second ) { } public int freq ( int index ) { } public double codeLength ( ) { } private DictExpansion . DictionaryWithStat < T > reduce ( int slots , boolean isDynamic ) { } private DictExpansion . DictionaryWithStat < T > expand ( int slots , boolean isDynamic ) { } public boolean enough ( double probFound ) { }

Fix:
if ( ( ( ! ( current . enough ( probFound ) ) ) || ( ! ( suggest . enough ( probFound ) ) ) ) && ( ( suggest . power ) < ( DictExpansion . MAX_POWER ) ) )