Program: 4732
Project: 4732
Buggy source:
/** 
 * Test the equals method.
 */
public void testAlternateLocationEquals(){
  for (int i=0; i < equalLocs.length; i++) {
    try {
      AlternateLocation curLoc=AlternateLocation.createAlternateLocation(equalLocs[i]);
      for (int j=0; j < equalLocs.length; j++) {
        AlternateLocation newLoc=AlternateLocation.createAlternateLocation(equalLocs[j]);
        assertEquals("String_Node_Str",curLoc,newLoc);
      }
    }
 catch (    IOException e) {
      assertTrue("String_Node_Str" + e,false);
    }
  }
  TreeMap timeStampedAltLocs0=new TreeMap();
  TreeMap testMap=new TreeMap();
  for (int i=0; i < HugeTestUtils.VALID_TIMESTAMPED_LOCS.length; i++) {
    try {
      AlternateLocation al0=AlternateLocation.createAlternateLocation(HugeTestUtils.VALID_TIMESTAMPED_LOCS[i]);
      AlternateLocation al1=AlternateLocation.createAlternateLocation(HugeTestUtils.VALID_TIMESTAMPED_LOCS[i]);
      assertTrue("String_Node_Str",al0.isTimestamped());
      assertTrue("String_Node_Str",al1.isTimestamped());
      timeStampedAltLocs0.put(al0,al0);
      testMap.put(al1,al1);
    }
 catch (    IOException e) {
      assertTrue("String_Node_Str" + e,false);
    }
  }
  assertEquals("String_Node_Str",timeStampedAltLocs0,testMap);
  TreeMap timeStampedAltLocs1=new TreeMap(timeStampedAltLocs0);
  Iterator iter0=timeStampedAltLocs0.values().iterator();
  Iterator iter1=timeStampedAltLocs1.values().iterator();
  while (iter0.hasNext()) {
    AlternateLocation al0=(AlternateLocation)iter0.next();
    AlternateLocation al1=(AlternateLocation)iter1.next();
    assertEquals("String_Node_Str",al0,al1);
  }
  Iterator iter20=timeStampedAltLocs0.keySet().iterator();
  Iterator iter21=timeStampedAltLocs1.keySet().iterator();
  while (iter20.hasNext()) {
    AlternateLocation al0=(AlternateLocation)iter20.next();
    AlternateLocation al1=(AlternateLocation)iter21.next();
    assertEquals("String_Node_Str",al0,al1);
  }
  Iterator iter30=timeStampedAltLocs0.entrySet().iterator();
  Iterator iter31=timeStampedAltLocs1.entrySet().iterator();
  while (iter20.hasNext()) {
    Map.Entry al0=(Map.Entry)iter30.next();
    Map.Entry al1=(Map.Entry)iter31.next();
    assertEquals("String_Node_Str",al0,al1);
  }
  assertEquals("String_Node_Str",timeStampedAltLocs1.size(),timeStampedAltLocs0.size());
  Iterator i=timeStampedAltLocs0.entrySet().iterator();
  while (i.hasNext()) {
    Map.Entry e=(Map.Entry)i.next();
    Object key=e.getKey();
    Object value=e.getValue();
    if (value == null) {
      if (!(timeStampedAltLocs1.get(key) == null && timeStampedAltLocs1.containsKey(key)))       assertTrue("String_Node_Str",false);
    }
 else {
      if (!value.equals(timeStampedAltLocs1.get(key)))       assertTrue("String_Node_Str",false);
    }
  }
}

Fixed version (ground truth):
/** 
 * Test the equals method.
 */
public void testAlternateLocationEquals(){
  for (int i=0; i < equalLocs.length; i++) {
    try {
      AlternateLocation curLoc=AlternateLocation.createAlternateLocation(equalLocs[i]);
      for (int j=0; j < equalLocs.length; j++) {
        AlternateLocation newLoc=AlternateLocation.createAlternateLocation(equalLocs[j]);
        assertEquals("String_Node_Str",curLoc,newLoc);
      }
    }
 catch (    IOException e) {
      assertTrue("String_Node_Str" + e,false);
    }
  }
  TreeMap timeStampedAltLocs0=new TreeMap();
  TreeMap testMap=new TreeMap();
  for (int i=0; i < HugeTestUtils.VALID_TIMESTAMPED_LOCS.length; i++) {
    try {
      AlternateLocation al0=AlternateLocation.createAlternateLocation(HugeTestUtils.VALID_TIMESTAMPED_LOCS[i]);
      AlternateLocation al1=AlternateLocation.createAlternateLocation(HugeTestUtils.VALID_TIMESTAMPED_LOCS[i]);
      assertTrue("String_Node_Str",al0.isTimestamped());
      assertTrue("String_Node_Str",al1.isTimestamped());
      timeStampedAltLocs0.put(al0,al0);
      testMap.put(al1,al1);
    }
 catch (    IOException e) {
      assertTrue("String_Node_Str" + e,false);
    }
  }
  TreeMap timeStampedAltLocs1=new TreeMap(timeStampedAltLocs0);
  Iterator iter0=timeStampedAltLocs0.values().iterator();
  Iterator iter1=timeStampedAltLocs1.values().iterator();
  while (iter0.hasNext()) {
    AlternateLocation al0=(AlternateLocation)iter0.next();
    AlternateLocation al1=(AlternateLocation)iter1.next();
    assertEquals("String_Node_Str",al0,al1);
  }
  Iterator iter20=timeStampedAltLocs0.keySet().iterator();
  Iterator iter21=timeStampedAltLocs1.keySet().iterator();
  while (iter20.hasNext()) {
    AlternateLocation al0=(AlternateLocation)iter20.next();
    AlternateLocation al1=(AlternateLocation)iter21.next();
    assertEquals("String_Node_Str",al0,al1);
  }
  Iterator iter30=timeStampedAltLocs0.entrySet().iterator();
  Iterator iter31=timeStampedAltLocs1.entrySet().iterator();
  while (iter20.hasNext()) {
    Map.Entry al0=(Map.Entry)iter30.next();
    Map.Entry al1=(Map.Entry)iter31.next();
    assertEquals("String_Node_Str",al0,al1);
  }
  assertEquals("String_Node_Str",timeStampedAltLocs1.size(),timeStampedAltLocs0.size());
  Iterator i=timeStampedAltLocs0.entrySet().iterator();
  while (i.hasNext()) {
    Map.Entry e=(Map.Entry)i.next();
    Object key=e.getKey();
    Object value=e.getValue();
    if (value == null) {
      if (!(timeStampedAltLocs1.get(key) == null && timeStampedAltLocs1.containsKey(key)))       assertTrue("String_Node_Str",false);
    }
 else {
      if (!value.equals(timeStampedAltLocs1.get(key)))       assertTrue("String_Node_Str",false);
    }
  }
}