Program: 11429
Project: 11429
Buggy source:
private void updateGeolocationGrid(){
  final MetadataElement targetOrigProdRoot=AbstractMetadata.getOriginalProductMetadata(targetProduct);
  MetadataElement[] elements=getElementsToUpdate(targetOrigProdRoot,"String_Node_Str");
  for (  MetadataElement e : elements) {
    final String imageNum=extractImageNumber(e.getName());
    MetadataElement targetGeolocationGrid=e.getElement("String_Node_Str").getElement("String_Node_Str");
    MetadataElement targetGeolocationGridPointList=targetGeolocationGrid.getElement("String_Node_Str");
    int count=Integer.parseInt(targetGeolocationGridPointList.getAttributeString("String_Node_Str"));
    int numberOfLines=0;
    for (int i=1; i < sliceProducts.length; i++) {
      MetadataElement sliceImageAnnotation=getAnnotationElement(sliceProducts[i],imageNum,"String_Node_Str");
      MetadataElement sliceImageInformation=sliceImageAnnotation.getElement("String_Node_Str");
      numberOfLines+=Integer.parseInt(sliceImageInformation.getAttributeString("String_Node_Str"));
      MetadataElement sliceGeolocationGrid=getAnnotationElement(sliceProducts[i],imageNum,"String_Node_Str");
      MetadataElement sliceGeolocationGridPointList=sliceGeolocationGrid.getElement("String_Node_Str");
      final int sliceCount=Integer.parseInt(sliceGeolocationGridPointList.getAttributeString("String_Node_Str"));
      if (sliceCount < 1) {
        continue;
      }
      MetadataElement[] sliceGeolocationGridPoints=sliceGeolocationGridPointList.getElements();
      for (      MetadataElement p : sliceGeolocationGridPoints) {
        MetadataElement newP=p.createDeepClone();
        final long sliceLine=Long.parseLong(p.getAttributeString("String_Node_Str"));
        newP.setAttributeString("String_Node_Str",Long.toString(sliceLine + numberOfLines));
        targetGeolocationGridPointList.addElementAt(newP,count++);
      }
    }
    targetGeolocationGridPointList.setAttributeString("String_Node_Str",Integer.toString(count));
  }
}

Fixed version (ground truth):
private void updateGeolocationGrid(){
  final MetadataElement targetOrigProdRoot=AbstractMetadata.getOriginalProductMetadata(targetProduct);
  MetadataElement[] elements=getElementsToUpdate(targetOrigProdRoot,"String_Node_Str");
  for (  MetadataElement e : elements) {
    final String imageNum=extractImageNumber(e.getName());
    MetadataElement targetGeolocationGrid=e.getElement("String_Node_Str").getElement("String_Node_Str");
    MetadataElement targetGeolocationGridPointList=targetGeolocationGrid.getElement("String_Node_Str");
    int count=Integer.parseInt(targetGeolocationGridPointList.getAttributeString("String_Node_Str"));
    MetadataElement sliceImageAnnotation=getAnnotationElement(sliceProducts[0],imageNum,"String_Node_Str");
    MetadataElement sliceImageInformation=sliceImageAnnotation.getElement("String_Node_Str");
    int numberOfLines=Integer.parseInt(sliceImageInformation.getAttributeString("String_Node_Str"));
    for (int i=1; i < sliceProducts.length; i++) {
      MetadataElement sliceGeolocationGrid=getAnnotationElement(sliceProducts[i],imageNum,"String_Node_Str");
      MetadataElement sliceGeolocationGridPointList=sliceGeolocationGrid.getElement("String_Node_Str");
      final int sliceCount=Integer.parseInt(sliceGeolocationGridPointList.getAttributeString("String_Node_Str"));
      if (sliceCount < 1) {
        continue;
      }
      MetadataElement[] sliceGeolocationGridPoints=sliceGeolocationGridPointList.getElements();
      for (      MetadataElement p : sliceGeolocationGridPoints) {
        MetadataElement newP=p.createDeepClone();
        final long sliceLine=Long.parseLong(p.getAttributeString("String_Node_Str"));
        newP.setAttributeString("String_Node_Str",Long.toString(sliceLine + numberOfLines));
        targetGeolocationGridPointList.addElementAt(newP,count++);
      }
      sliceImageAnnotation=getAnnotationElement(sliceProducts[i],imageNum,"String_Node_Str");
      sliceImageInformation=sliceImageAnnotation.getElement("String_Node_Str");
      numberOfLines+=Integer.parseInt(sliceImageInformation.getAttributeString("String_Node_Str"));
    }
    targetGeolocationGridPointList.setAttributeString("String_Node_Str",Integer.toString(count));
  }
}