Buggy code:
public class RawDataFileImpl implements RawDataFile , RawDataFileWriter { private final Logger logger = Logger . getLogger ( this . getClass ( ) . getName ( ) ) ; private String dataFileName ; private final Hashtable < Integer , Range < Double > > dataMZRange ; private final Hashtable < Integer , Range < Double > > dataRTRange ; private final Hashtable < Integer , Double > dataMaxBasePeakIntensity ; private final Hashtable < Integer , Double > dataMaxTIC ; private final Hashtable < Integer , int [ ] > scanNumbersCache ; private ByteBuffer buffer = ByteBuffer . allocate ( 20000 ) ; private final TreeMap < Integer , Long > dataPointsOffsets ; private final TreeMap < Integer , Integer > dataPointsLengths ; private ArrayList < RemoteJob > jobs_info = null ; private File dataPointsFileName ; private RandomAccessFile dataPointsFile ; private final Hashtable < Integer , StorableScan > scans ; public RawDataFileImpl ( String dataFileName ) throws IOException { } public static File createNewDataPointsFile ( ) throws IOException { } public RandomAccessFile getDataPointsFile ( ) { } public synchronized void openDataPointsFile ( File dataPointsFileName ) throws IOException { } public int getNumOfScans ( ) { } @ Nonnull public Scan getScan ( int scanNumber ) { } @ Nonnull public int [ ] getScanNumbers ( int msLevel ) { } @ Nonnull public int [ ] getScanNumbers ( int msLevel , @ Nonnull Range < Double > rtRange ) { } @ Nonnull public int [ ] getScanNumbers ( ) { } @ Nonnull public int [ ] getMSLevels ( ) { } public double getDataMaxBasePeakIntensity ( int msLevel ) { } public double getDataMaxTotalIonCurrent ( int msLevel ) { } public synchronized int storeDataPoints ( DataPoint [ ] dataPoints ) throws IOException { } public synchronized DataPoint [ ] readDataPoints ( int ID ) throws IOException { } public synchronized void removeStoredDataPoints ( int ID ) throws IOException { } public synchronized void addScan ( Scan newScan ) throws IOException { } public synchronized void addJob ( String name , RawDataFile raw , String targetName , PeakInvestigatorSaaS vtmx ) { } public synchronized void removeJob ( String name ) { } public ArrayList < RemoteJob > getJobs ( ) { } public RemoteJob getJob ( String compoundName ) { for ( RemoteJob job : jobs_info ) { <START_BUG> if ( ( job . getCompoundName ( ) ) == compoundName ) { <END_BUG> return job ; } } return null ; } public synchronized RawDataFile finishWriting ( ) throws IOException { } @ Nonnull public Range < Double > getDataMZRange ( ) { } @ Nonnull public Range < Double > getDataMZRange ( int msLevel ) { } @ Nonnull public Range < Double > getDataRTRange ( ) { } @ Nonnull public Range < Double > getDataRTRange ( int msLevel ) { } public void setRTRange ( int msLevel , Range < Double > rtRange ) { } public void setMZRange ( int msLevel , Range < Double > mzRange ) { } public int getNumOfScans ( int msLevel ) { } public synchronized TreeMap < Integer , Long > getDataPointsOffsets ( ) { } public synchronized TreeMap < Integer , Integer > getDataPointsLengths ( ) { } public synchronized void close ( ) { } @ Nonnull public String getName ( ) { } public void setName ( @ Nonnull String name ) { } public String toString ( ) { } }

Fix:
if ( job . getCompoundName ( ) . equals ( compoundName ) ) {