Program: 17894
Project: 17894
Buggy source:
public ServiceDocumentImpl readServiceDokument(final XMLStreamReader reader) throws EntityProviderException {
  AtomInfoImpl atomInfo=new AtomInfoImpl();
  ServiceDocumentImpl serviceDocument=new ServiceDocumentImpl();
  List<Workspace> workspaces=new ArrayList<Workspace>();
  List<ExtensionElement> extElements=new ArrayList<ExtensionElement>();
  CommonAttributesImpl attributes=new CommonAttributesImpl();
  try {
    while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_APP_2007.equals(reader.getNamespaceURI()) && FormatXml.APP_SERVICE.equals(reader.getLocalName()))) {
      reader.next();
      if (reader.isStartElement()) {
        currentHandledStartTagName=reader.getLocalName();
        if (FormatXml.APP_SERVICE.equals(currentHandledStartTagName)) {
          attributes=parseCommonAttribute(reader);
        }
 else         if (FormatXml.APP_WORKSPACE.equals(currentHandledStartTagName)) {
          workspaces.add(parseWorkspace(reader));
        }
 else {
          ExtensionElementImpl extElement=parseExtensionElement(reader);
          if (extElement != null) {
            extElements.add(extElement);
          }
        }
      }
    }
    if (workspaces.isEmpty()) {
      throw new EntityProviderException(EntityProviderException.COMMON.addContent("String_Node_Str"));
    }
    reader.close();
    atomInfo.setWorkspaces(workspaces).setCommonAttributes(attributes).setExtesionElements(extElements);
    serviceDocument.setAtomInfo(atomInfo);
    serviceDocument.setEntitySetsInfo(atomInfo.getEntitySetsInfo());
    return serviceDocument;
  }
 catch (  XMLStreamException e) {
    throw new EntityProviderException(EntityProviderException.COMMON.addContent("String_Node_Str"));
  }
}

Fixed version (ground truth):
public ServiceDocumentImpl readServiceDokument(final XMLStreamReader reader) throws EntityProviderException {
  AtomInfoImpl atomInfo=new AtomInfoImpl();
  ServiceDocumentImpl serviceDocument=new ServiceDocumentImpl();
  List<Workspace> workspaces=new ArrayList<Workspace>();
  List<ExtensionElement> extElements=new ArrayList<ExtensionElement>();
  CommonAttributesImpl attributes=new CommonAttributesImpl();
  try {
    while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_APP_2007.equals(reader.getNamespaceURI()) && FormatXml.APP_SERVICE.equals(reader.getLocalName()))) {
      reader.next();
      if (reader.isStartElement()) {
        currentHandledStartTagName=reader.getLocalName();
        if (FormatXml.APP_SERVICE.equals(currentHandledStartTagName)) {
          attributes=parseCommonAttribute(reader);
        }
 else         if (FormatXml.APP_WORKSPACE.equals(currentHandledStartTagName)) {
          workspaces.add(parseWorkspace(reader));
        }
 else {
          ExtensionElementImpl extElement=parseExtensionElement(reader);
          if (extElement != null) {
            extElements.add(extElement);
          }
        }
      }
    }
    if (workspaces.isEmpty()) {
      throw new EntityProviderException(EntityProviderException.COMMON.addContent("String_Node_Str"));
    }
    reader.close();
    atomInfo.setWorkspaces(workspaces).setCommonAttributes(attributes).setExtesionElements(extElements);
    serviceDocument.setAtomInfo(atomInfo);
    serviceDocument.setEntitySetsInfo(atomInfo.getEntitySetsInfo());
    return serviceDocument;
  }
 catch (  XMLStreamException e) {
    throw new EntityProviderException(EntityProviderException.COMMON.addContent("String_Node_Str"),e);
  }
}