Buggy code:
@ Description ( "Wilson-Balding<seq2seq4repair_space>operator<seq2seq4repair_space>for<seq2seq4repair_space>ACG<seq2seq4repair_space>clonal<seq2seq4repair_space>frames." ) public class CFWilsonBalding extends ConversionCreationOperator { public Input < Double > alphaInput = new feast . input . In < Double > ( "alpha" , ( "Root<seq2seq4repair_space>height<seq2seq4repair_space>" + "proposal<seq2seq4repair_space>parameter" ) ) . setRequired ( ) ; public Input < Boolean > includeRootInput = new feast . input . In < Boolean > ( "includeRoot" , "Whether<seq2seq4repair_space>to<seq2seq4repair_space>include<seq2seq4repair_space>root<seq2seq4repair_space>variants<seq2seq4repair_space>of<seq2seq4repair_space>move." ) . setDefault ( true ) ; public Input < RealParameter > rhoInput = new feast . input . In < RealParameter > ( "rho" , "Conversion<seq2seq4repair_space>rate." ) . setRequired ( ) ; private double alpha ; @ Override public void initAndValidate ( ) throws Exception { } @ Override public double proposal ( ) { <START_BUG> if ( ( acg . getNodeCount ( ) ) < 3 ) <END_BUG> return Double . NEGATIVE_INFINITY ; Node srcNode ; do { srcNode = acg . getNode ( Randomizer . nextInt ( ( ( acg . getNodeCount ( ) ) - 1 ) ) ) ; } while ( invalidSrcNode ( srcNode ) ) ; Node srcNodeP = srcNode . getParent ( ) ; Node srcNodeS = getSibling ( srcNode ) ; double t_srcNode = srcNode . getHeight ( ) ; double t_srcNodeP = srcNodeP . getHeight ( ) ; double t_srcNodeS = srcNodeS . getHeight ( ) ; Node destNode ; do { destNode = acg . getNode ( Randomizer . nextInt ( acg . getNodeCount ( ) ) ) ; } while ( invalidDestNode ( srcNode , destNode ) ) ; Node destNodeP = destNode . getParent ( ) ; double t_destNode = destNode . getHeight ( ) ; if ( destNode . isRoot ( ) ) { if ( ! ( includeRootInput . get ( ) ) ) return Double . NEGATIVE_INFINITY ; double logHGF = 0.0 ; double t_srcNodeG = srcNodeP . getParent ( ) . getHeight ( ) ; logHGF += Math . log ( ( 1.0 // ( t_srcNodeG - ( Math . max ( t_srcNode , t_srcNodeS ) ) ) ) ) ; double newTime = t_destNode + ( Randomizer . nextExponential ( ( 1.0 // ( ( alpha ) * t_destNode ) ) ) ) ; logHGF -= ( Math . log ( ( 1.0 // ( ( alpha ) * t_destNode ) ) ) ) - ( ( 1.0 // ( alpha ) ) * ( ( newTime // t_destNode ) - 1.0 ) ) ; logHGF -= expandConversions ( srcNode , destNode , newTime ) ; if ( acg . isInvalid ( ) ) throw new IllegalStateException ( "CFWB<seq2seq4repair_space>proposed<seq2seq4repair_space>invalid<seq2seq4repair_space>state." ) ; return logHGF ; } if ( srcNodeP . isRoot ( ) ) { if ( ! ( includeRootInput . get ( ) ) ) return Double . NEGATIVE_INFINITY ; double logHGF = 0.0 ; logHGF += ( Math . log ( ( 1.0 // ( ( alpha ) * t_srcNodeS ) ) ) ) - ( ( 1.0 // ( alpha ) ) * ( ( t_srcNodeP // t_srcNodeS ) - 1.0 ) ) ; double min_newTime = Math . max ( t_srcNode , t_destNode ) ; double t_destNodeP = destNodeP . getHeight ( ) ; double newTime = min_newTime + ( ( t_destNodeP - min_newTime ) * ( Randomizer . nextDouble ( ) ) ) ; logHGF -= Math . log ( ( 1.0 // ( t_destNodeP - min_newTime ) ) ) ; logHGF += collapseConversions ( srcNode , destNode , newTime ) ; if ( acg . isInvalid ( ) ) throw new IllegalStateException ( "CFWB<seq2seq4repair_space>proposed<seq2seq4repair_space>invalid<seq2seq4repair_space>state." ) ; return logHGF ; } double logHGF = 0.0 ; double t_srcNodeG = srcNodeP . getParent ( ) . getHeight ( ) ; logHGF += Math . log ( ( 1.0 // ( t_srcNodeG - ( Math . max ( t_srcNode , t_srcNodeS ) ) ) ) ) ; double min_newTime = Math . max ( t_destNode , t_srcNode ) ; double t_destNodeP = destNodeP . getHeight ( ) ; double newTime = min_newTime + ( ( t_destNodeP - min_newTime ) * ( Randomizer . nextDouble ( ) ) ) ; logHGF -= Math . log ( ( 1.0 // ( t_destNodeP - min_newTime ) ) ) ; if ( newTime < ( srcNodeP . getHeight ( ) ) ) logHGF += collapseConversions ( srcNode , destNode , newTime ) ; else logHGF -= expandConversions ( srcNode , destNode , newTime ) ; if ( acg . isInvalid ( ) ) throw new IllegalStateException ( "CFWB<seq2seq4repair_space>proposed<seq2seq4repair_space>invalid<seq2seq4repair_space>state." ) ; return logHGF ; } private boolean invalidSrcNode ( Node srcNode ) { } private boolean invalidDestNode ( Node srcNode , Node destNode ) { } private double collapseConversions ( Node srcNode , Node destNode , double destTime ) { } private double expandConversions ( Node srcNode , Node destNode , double destTime ) { } }

Fix:
if ( ( acg . getLeafNodeCount ( ) ) < 3 )