Buggy code:
public class Similarity { public enum SimType { COSINE , PEARSON_CORRELATION , EUCLIDEAN , SPEARMAN_RANK_CORRELATION , JACCARD_INDEX , LIN , KL_DIVERGENCE , AVERAGE_COMMON_FEATURE_RANK ; } private Similarity ( ) { } @ Deprecated public static Method getMethod ( Similarity . SimType similarityType ) { } public static SimilarityFunction getSimilarityFunction ( Similarity . SimType similarityType ) { } public static double getSimilarity ( Similarity . SimType similarityType , double [ ] a , double [ ] b ) { } public static < T extends Vector > double getSimilarity ( Similarity . SimType similarityType , T a , T b ) { } private static void check ( double [ ] a , double [ ] b ) { } private static void check ( int [ ] a , int [ ] b ) { } private static void check ( Vector a , Vector b ) { } public static double cosineSimilarity ( double [ ] a , double [ ] b ) { } public static double cosineSimilarity ( int [ ] a , int [ ] b ) { } @ SuppressWarnings ( "unchecked" ) public static double cosineSimilarity ( DoubleVector a , DoubleVector b ) { } @ SuppressWarnings ( "unchecked" ) public static double cosineSimilarity ( IntegerVector a , IntegerVector b ) { } public static double cosineSimilarity ( Vector a , Vector b ) { } public static double correlation ( double [ ] arr1 , double [ ] arr2 ) { } public static double correlation ( int [ ] arr1 , int [ ] arr2 ) { } public static double correlation ( DoubleVector arr1 , DoubleVector arr2 ) { } public static double correlation ( IntegerVector arr1 , DoubleVector arr2 ) { } public static double correlation ( Vector a , Vector b ) { } public static double euclideanDistance ( double [ ] a , double [ ] b ) { } public static double euclideanDistance ( int [ ] a , int [ ] b ) { } public static double euclideanDistance ( DoubleVector a , DoubleVector b ) { } public static double euclideanDistance ( IntegerVector a , IntegerVector b ) { } public static double euclideanDistance ( Vector a , Vector b ) { } public static double euclideanSimilarity ( int [ ] a , int [ ] b ) { } public static double euclideanSimilarity ( double [ ] a , double [ ] b ) { } public static double euclideanSimilarity ( Vector a , Vector b ) { } public static double jaccardIndex ( double [ ] a , double [ ] b ) { } public static double jaccardIndex ( int [ ] a , int [ ] b ) { } public static double jaccardIndex ( Vector a , Vector b ) { } private static void addAttributesToSet ( Vector a , BitSet intersection , BitSet union ) { if ( a instanceof SparseVector ) { SparseVector sv = ( ( SparseVector ) ( a ) ) ; for ( int i : sv . getNonZeroIndices ( ) ) { intersection . set ( i ) ; union . set ( i ) ; } } else { for ( int i = 0 ; i < ( a . length ( ) ) ; ++ i ) { <START_BUG> if ( ( a . get ( i ) ) > 0.0 ) { <END_BUG> intersection . set ( i ) ; union . set ( i ) ; } } } } public static double spearmanRankCorrelationCoefficient ( double [ ] a , double [ ] b ) { } public static double spearmanRankCorrelationCoefficient ( int [ ] a , int [ ] b ) { } public static double spearmanRankCorrelationCoefficient ( DoubleVector a , DoubleVector b ) { } public static double spearmanRankCorrelationCoefficient ( IntegerVector a , IntegerVector b ) { } public static double spearmanRankCorrelationCoefficient ( Vector a , Vector b ) { } public static double averageCommonFeatureRank ( double [ ] a , double [ ] b ) { } public static double averageCommonFeatureRank ( Vector a , Vector b ) { } public static double averageCommonFeatureRank ( int [ ] a , int [ ] b ) { } public static double linSimilarity ( DoubleVector a , DoubleVector b ) { } public static double linSimilarity ( IntegerVector a , IntegerVector b ) { } public static double linSimilarity ( Vector a , Vector b ) { } public static double linSimilarity ( double [ ] a , double [ ] b ) { } public static double linSimilarity ( int [ ] a , int [ ] b ) { } public static double klDivergence ( DoubleVector a , DoubleVector b ) { } public static double klDivergence ( IntegerVector a , IntegerVector b ) { } public static double klDivergence ( Vector a , Vector b ) { } public static double klDivergence ( double [ ] a , double [ ] b ) { } public static double klDivergence ( int [ ] a , int [ ] b ) { } }

Fix:
if ( ( a . getValue ( i ) . doubleValue ( ) ) > 0.0 ) {