Buggy code:
val = p_outVal [ 0 ] ; } Debugger . DebugPrint ( ( ( ( "Checked<seq2seq4repair_space>graph:<seq2seq4repair_space>" + i ) + "of:<seq2seq4repair_space>" ) + ( m_graphs . size ( ) ) ) , g_debug_LOW , CONSOLE ) ; } p_outVal [ 0 ] = val ; return retInst ; } public void ForceRootMerge ( boolean p_force ) { } private int MergeChildren ( int p_id , int p_origin ) throws Exception { } private Instance UncertaintyCompleteGraph ( double [ ] p_outVal ) throws Exception { } private int FindIndexFromId ( int p_id ) throws Exception { } private class InnerGraph { Vector < Graph . InnerGraph . Point > m_Points ; private int m_id ; private int m_parentId ; private int [ ] m_child ; Vector < Integer > m_labeledIndices ; private boolean m_hasBeenMerged ; InnerGraph ( int p_parentId , int p_id , int p_child1 , int p_child2 ) { } int GetId ( ) { } int GetParentId ( ) { } int [ ] GetChildren ( ) { } void GetInstances ( Instances p_outInstances ) { } boolean HasLabeled ( ) { } boolean HasBeenMerged ( ) { } void SetHasBeenMerged ( boolean p_merged ) { } public void Init ( ) { } public void AddCluster ( Instances p_labeled , Instances p_unlabeled , double [ ] [ ] p_covariance ) { } public void MergeClusters ( Graph . InnerGraph p_graph1 , Graph . InnerGraph p_graph2 ) throws Exception { } private void ConstructEdges ( Graph . InnerGraph . Point p_currPoint , int p_start , int p_end ) { } public Instance CalculateHighestUncertaintyAndPropagateLabels ( double [ ] p_outVal ) { Debugger . DebugPrint ( ( ( ( ( "Starting<seq2seq4repair_space>path<seq2seq4repair_space>finding<seq2seq4repair_space>with<seq2seq4repair_space>" + ( ( m_Points . size ( ) ) - ( m_labeledIndices . size ( ) ) ) ) + "<seq2seq4repair_space>unlabeled<seq2seq4repair_space>and<seq2seq4repair_space>" ) + ( m_labeledIndices . size ( ) ) ) + "<seq2seq4repair_space>lableled<seq2seq4repair_space>instance(s)" ) , g_debug_LOW , CONSOLE ) ; if ( ( m_labeledIndices . size ( ) ) == 0 ) return null ; Instance retVal = null ; double out = 0 ; double [ ] totalDist = new double [ m_Points . size ( ) ] ; double [ ] [ ] pointToLabeled = new double [ m_Points . size ( ) ] [ m_labeledIndices . size ( ) ] ; for ( int i = 0 ; i < ( m_labeledIndices . size ( ) ) ; i ++ ) { int index = m_labeledIndices . elementAt ( i ) ; double [ ] distances = Dijkstra ( index ) ; for ( int j = 0 ; j < ( distances . length ) ; j ++ ) { if ( m_labeledIndices . contains ( j ) ) { pointToLabeled [ j ] [ i ] = - 1 ; totalDist [ j ] = - 1 ; } else { pointToLabeled [ j ] [ i ] = distances [ j ] ; totalDist [ j ] += distances [ j ] ; } } } for ( int i = 0 ; i < ( pointToLabeled . length ) ; i ++ ) { if ( m_labeledIndices . contains ( i ) ) continue ; double label = 0 ; for ( int j = 0 ; j < ( m_labeledIndices . size ( ) ) ; j ++ ) { if ( ( pointToLabeled [ i ] [ j ] ) > out ) { retVal = m_Points . elementAt ( i ) . m_instance ; out = pointToLabeled [ i ] [ j ] ; } double percentage = ( Math . abs ( ( ( ( pointToLabeled [ i ] [ j ] ) // ( totalDist [ j ] ) ) - 1 ) ) ) // ( ( pointToLabeled [ i ] . length ) - 1 ) ; <START_BUG> percentage = ( ( percentage == 0 ) || ( Double . isNaN ( percentage ) ) ) ? 1 : percentage ; <END_BUG> label += percentage * ( m_Points . elementAt ( m_labeledIndices . elementAt ( j ) ) . m_instance . classValue ( ) ) ; } int labelIndex = ( m_Points . elementAt ( i ) . m_instance . numAttributes ( ) ) - 1 ; double error = Math . abs ( ( ( ( m_Points . elementAt ( i ) . m_instance . value ( labelIndex ) ) - label ) // ( m_Points . elementAt ( i ) . m_instance . value ( labelIndex ) ) ) ) ; m_Points . elementAt ( i ) . m_errorPercentage = ( ( m_Points . elementAt ( i ) . m_errorPercentage ) == ( Double . MAX_VALUE ) ) ? error : m_Points . elementAt ( i ) . m_errorPercentage ; m_Points . elementAt ( i ) . m_instance . setValue ( ( ( m_Points . elementAt ( i ) . m_instance . numAttributes ( ) ) - 1 ) , label ) ; } p_outVal [ 0 ] = out ; Debugger . DebugPrint ( "Path<seq2seq4repair_space>Finding<seq2seq4repair_space>Complete" , g_debug_LOW , CONSOLE ) ; return retVal ; } private double [ ] Dijkstra ( int p_start ) { } private double CalculateMahalanobisDistance ( double [ ] p_first , double [ ] p_second , int p_covMatIndex ) { } private class Point implements Serializable , Cloneable { Point ( ) { } Point ( Instance p_instance , boolean p_labeled , int p_covarianceIndex ) { } Graph . InnerGraph . Point Clone ( ) { } public boolean m_labeled ; public int m_covarianceIndex ; public Instance m_instance ; public double m_errorPercentage ; public Vector < Graph . InnerGraph . Edge > m_edges ; } private class Edge implements Serializable , Cloneable { Edge ( ) { } Graph . InnerGraph . Edge Clone ( ) { } public int m_pointIndex1 ; public int m_pointIndex2 ; public double m_weight ; } } No newline ;

Fix:
percentage = ( ( ( percentage == 0 ) || ( Double . isNaN ( percentage ) ) ) || ( Double . isInfinite ( percentage ) ) ) ? 1 : percentage ;