Buggy code:
public boolean readSpectrumFromMSP ( BufferedReader bf ) { } public boolean readSpectrumFromSplib ( BufferedReader bf ) { } public boolean readSpectrumFromMS2 ( BufferedReader bf ) { } public void readSpectrumFromMGF ( String fileName ) { } public boolean readSpectrumFromMGF ( BufferedReader bf ) { } public int compareTo ( Spectrum s ) { } public Spectrum toNormVector ( double binWidth , double minMass , double maxMass ) { } public Spectrum toNormVector ( ) { } public Spectrum toVector ( double binWidth , double minMass , double maxMass ) { } public void normalize ( ) { } public void normalizeTIC ( ) { } public void toRelIntensity ( ) { } public String getPeptide ( ) { } public void setPeptide ( String peptide ) { } public List < Peak > getPeaks ( ) { } public double getMaxIntensity ( ) { } public boolean checkOutLiner ( ) { } public double magnitude ( ) { } public double sumOfPeaks ( ) { } public double sumMagnitude ( ) { } public void scaleSpectrum ( double factor ) { } public void scaleMass ( double factor ) { } public void shiftSpectrum ( double shift ) { } public void shiftSpectrumPPM ( double shiftPPM ) { } public void sqrtSpectrum ( ) { } public double cosineSim ( Spectrum s1 ) { } public double cosine ( Spectrum s1 ) { } public double cosineSim2 ( Spectrum s1 ) { } public double cosineSim1 ( Spectrum s1 ) { } public double shiftCosineSim ( Spectrum s1 ) { } public double shareSim ( Spectrum s1 ) { } public double shareSim ( Spectrum s1 , int mode ) { } public double projectedCosine ( Spectrum s1 ) { } public double cosine ( Spectrum s1 , double tolerance ) { } public double cosineApprox ( Spectrum s1 , double tolerance ) { } public double projectedCosine ( Spectrum s1 , double tolerance ) { } public double projectedCosine ( Spectrum s1 , double tolerance , int mode ) { } public double projectedCosineWithSkip ( Spectrum s1 , double tolerance , int maxGap ) { } public double projectedCosine2 ( Spectrum s1 , double tolerance ) { } public double sharePeaks ( Spectrum s1 , double tolerance ) { } public double sharePeaks ( Spectrum s1 , double tolerance , boolean detail ) { } public double [ ] projectedShare ( Spectrum s1 , double tolerance , double minZ ) { } public void computeConsensus ( Spectrum s1 , double tolerance ) { } public double projectedPeakIntensity ( Spectrum s1 , double tolerance ) { } public double projectedCosine1 ( Spectrum s1 ) { } public double alpha ( Spectrum a , Spectrum b ) { } public double maxScore ( Spectrum a , Spectrum b , double alpha ) { } public double shiftMaxScore ( Spectrum a , Spectrum b , double alpha ) { } public double inverseMaxScore ( Spectrum a , Spectrum b , double alpha ) { } public void upscale ( Spectrum s1 , Spectrum s2 , double alpha ) { } public double dot ( Spectrum s1 ) { } public void removeSharePeaks ( Spectrum s ) { } public Spectrum removeSharePeaks ( Spectrum s , double tolerance ) { } public Spectrum project ( Spectrum s , double tolerance ) { } public double [ ] projectArray ( Spectrum s , double tolerance ) { int i = 0 ; int j = 0 ; Spectrum projected = this ; Peak dummy = new Peak ( 0 , 0 ) ; Peak match = dummy ; double [ ] projection = new double [ s . getPeak ( ) . size ( ) ] ; while ( ( i < ( projected . peaks . size ( ) ) ) && ( j < ( s . peaks . size ( ) ) ) ) { Peak m1 = projected . getPeaks ( ) . get ( i ) ; Peak m2 = s . getPeaks ( ) . get ( j ) ; <START_BUG> if ( SWATHUtils . checkMass ( m1 . getMass ( ) , m2 . getMass ( ) , 50 , PPM ) ) { <END_BUG> match = ( ( m1 . getIntensity ( ) ) > ( match . getIntensity ( ) ) ) ? m1 : match ; projection [ j ] += m1 . getIntensity ( ) ; i ++ ; } else if ( ( m1 . getMass ( ) ) < ( m2 . getMass ( ) ) ) { i ++ ; } else if ( ( m1 . getMass ( ) ) >= ( m2 . getMass ( ) ) ) { match = dummy ; j ++ ; } } return projection ; } public void removePrecursors ( double tolerance ) { } public double residual ( Spectrum s ) { } public void subtractSharePeaks ( Spectrum s ) { } public void subtractProjPeaks ( Spectrum s , double tolerance ) { } public void filterPeaks ( int n ) { } public void filterPeaksByMass ( double minMass , double maxMass ) { } public void removePeaksInMass ( double minMass , double maxMass ) { } public void filterPeaksByZScore ( double minZ , double lowFract ) { } public void filterPeaksByRankScore ( int minR ) { } public void computePeaksZScore ( double lowFract ) { } public void computeAnnotatedZScore ( Spectrum s , double tolerance ) { } public void filterPeaksByIntensity ( double minInt ) { } public void filterFlatPeaks ( double minFraction ) { } public int explainedIntensity ( double percent ) { } public int explainedIntensity2 ( double percent ) { } public int intensePeakCount ( double threshold ) { } public void windowFilterPeaks ( int n , double deltaM ) { } public void windowFilterPeaks2 ( int n , double deltaM ) { } public void windowFilterPeaks2 ( double signalRatio , double deltaM ) { }

Fix:
if ( Mass . checkMass ( m1 . getMass ( ) , m2 . getMass ( ) , tolerance , DIFF_PPM ) ) {