Program: 11507
Project: 11507
Buggy source:
private static ProductData.UTC getEndTime(final BinaryRecord sceneRec,final MetadataElement origProductMetadata,final String tagInSummary,final ProductData.UTC startTime){
  ProductData.UTC time=getUTCScanStartTime(sceneRec,null);
  if (time.equalElems(AbstractMetadata.NO_METADATA_UTC)) {
    try {
      ProductData.UTC summaryTime=null;
      final MetadataElement summaryElem=origProductMetadata.getElement("String_Node_Str");
      if (summaryElem != null) {
        for (        MetadataAttribute sum : summaryElem.getAttributes()) {
          if (sum.getName().contains(tagInSummary)) {
            summaryTime=AbstractMetadata.parseUTC(summaryElem.getAttributeString(sum.getName().trim()),dateFormat2);
          }
        }
      }
      ProductData.UTC workReportTime=null;
      final MetadataElement workReportElem=origProductMetadata.getElement("String_Node_Str");
      if (workReportElem != null) {
        String valueStr=workReportElem.getAttributeString("String_Node_Str");
        if (valueStr != null && valueStr.length() > 0) {
          workReportTime=AbstractMetadata.parseUTC(valueStr,dateFormat2);
        }
        if (workReportTime == null) {
          valueStr=workReportElem.getAttributeString("String_Node_Str");
          if (valueStr != null && valueStr.length() > 0) {
            workReportTime=AbstractMetadata.parseUTC(valueStr,dateFormat2);
          }
        }
        if (workReportTime == null) {
          for (          MetadataAttribute workRep : workReportElem.getAttributes()) {
            if (workRep.getName().contains("String_Node_Str")) {
              final ProductData.UTC centreTime=AbstractMetadata.parseUTC(workReportElem.getAttributeString(workRep.getName().trim()),dateFormat2);
              final double diff=centreTime.getMJD() - startTime.getMJD();
              workReportTime=new ProductData.UTC(startTime.getMJD() + (diff * 2.0));
            }
          }
        }
      }
      ProductData.UTC imgRecTime=null;
      final MetadataElement imageDescriptorElem=origProductMetadata.getElement("String_Node_Str");
      if (imageDescriptorElem != null) {
        final int numRecords=imageDescriptorElem.getAttributeInt("String_Node_Str",0);
        final MetadataElement imageRecordElem=imageDescriptorElem.getElement("String_Node_Str");
        if (imageRecordElem != null) {
          final int year=imageRecordElem.getAttributeInt("String_Node_Str",0);
          final int days=imageRecordElem.getAttributeInt("String_Node_Str",0);
          double milliseconds=imageRecordElem.getAttributeInt("String_Node_Str",0);
          final double prf=imageRecordElem.getAttributeDouble("String_Node_Str",0);
          final int days_since_2000=(year - 2000) * 365 + days + 1;
          milliseconds+=(double)(numRecords - 1) * Constants.oneMillion / prf;
          final int seconds=(int)(milliseconds / 1000);
          final double microseconds=(milliseconds - seconds * 1000.0) * 1000.0;
          imgRecTime=new ProductData.UTC(days_since_2000,seconds,(int)microseconds);
        }
      }
      if (summaryTime != null)       return summaryTime;
 else       if (workReportTime != null)       return workReportTime;
 else       if (imgRecTime != null)       return imgRecTime;
      final String centreTimeStr=sceneRec.getAttributeString("String_Node_Str");
      final ProductData.UTC centreTime=AbstractMetadata.parseUTC(centreTimeStr.trim(),dateFormat1);
      final double diff=centreTime.getMJD() - startTime.getMJD();
      return new ProductData.UTC(startTime.getMJD() + (diff * 2.0));
    }
 catch (    Exception e) {
      time=AbstractMetadata.NO_METADATA_UTC;
    }
  }
  return time;
}

Fixed version (ground truth):
private static ProductData.UTC getEndTime(final BinaryRecord sceneRec,final MetadataElement origProductMetadata,final String tagInSummary,final ProductData.UTC startTime){
  ProductData.UTC time=getUTCScanStartTime(sceneRec,null);
  if (time.equalElems(AbstractMetadata.NO_METADATA_UTC)) {
    try {
      ProductData.UTC summaryTime=null;
      final MetadataElement summaryElem=origProductMetadata.getElement("String_Node_Str");
      if (summaryElem != null) {
        for (        MetadataAttribute sum : summaryElem.getAttributes()) {
          if (sum.getName().contains(tagInSummary)) {
            summaryTime=AbstractMetadata.parseUTC(summaryElem.getAttributeString(sum.getName().trim()),dateFormat2);
          }
        }
      }
      ProductData.UTC workReportTime=null;
      final MetadataElement workReportElem=origProductMetadata.getElement("String_Node_Str");
      if (workReportElem != null) {
        String valueStr=workReportElem.getAttributeString("String_Node_Str");
        if (valueStr != null && valueStr.length() > 0) {
          workReportTime=AbstractMetadata.parseUTC(valueStr,dateFormat2);
        }
        if (workReportTime == null) {
          valueStr=workReportElem.getAttributeString("String_Node_Str");
          if (valueStr != null && valueStr.length() > 0) {
            workReportTime=AbstractMetadata.parseUTC(valueStr,dateFormat2);
          }
        }
        if (workReportTime == null) {
          for (          MetadataAttribute workRep : workReportElem.getAttributes()) {
            if (workRep.getName().contains("String_Node_Str")) {
              final ProductData.UTC centreTime=AbstractMetadata.parseUTC(workReportElem.getAttributeString(workRep.getName().trim()),dateFormat2);
              final double diff=centreTime.getMJD() - startTime.getMJD();
              workReportTime=new ProductData.UTC(startTime.getMJD() + (diff * 2.0));
            }
          }
        }
      }
      ProductData.UTC imgRecTime=null;
      final MetadataElement imageDescriptorElem=origProductMetadata.getElement("String_Node_Str");
      if (imageDescriptorElem != null) {
        final int numRecords=imageDescriptorElem.getAttributeInt("String_Node_Str",0);
        final MetadataElement imageRecordElem=imageDescriptorElem.getElement("String_Node_Str");
        if (imageRecordElem != null) {
          final int year=imageRecordElem.getAttributeInt("String_Node_Str",0);
          final int days=imageRecordElem.getAttributeInt("String_Node_Str",0);
          int milliseconds=imageRecordElem.getAttributeInt("String_Node_Str",0);
          final double prf=imageRecordElem.getAttributeDouble("String_Node_Str",0);
          milliseconds+=(int)((numRecords - 1) * Constants.oneMillion / prf);
          StringBuffer sb=new StringBuffer(String.valueOf(year));
          String dayStr=String.valueOf(days);
          for (int i=dayStr.length(); i < 3; i++) {
            sb.append('0');
          }
          sb.append(dayStr);
          String millisecondStr=String.valueOf(milliseconds);
          for (int i=millisecondStr.length(); i < 8; i++) {
            sb.append('0');
          }
          sb.append(millisecondStr);
          imgRecTime=ProductData.UTC.parse(sb.toString(),dateFormat3);
        }
      }
      if (summaryTime != null)       return summaryTime;
 else       if (workReportTime != null)       return workReportTime;
 else       if (imgRecTime != null)       return imgRecTime;
      final String centreTimeStr=sceneRec.getAttributeString("String_Node_Str");
      final ProductData.UTC centreTime=AbstractMetadata.parseUTC(centreTimeStr.trim(),dateFormat1);
      final double diff=centreTime.getMJD() - startTime.getMJD();
      return new ProductData.UTC(startTime.getMJD() + (diff * 2.0));
    }
 catch (    Exception e) {
      time=AbstractMetadata.NO_METADATA_UTC;
    }
  }
  return time;
}