nus-yam/ex-repair huggingface dataset:
Program: 18032
Project: 18032
Buggy source:
/** 
 * Duplicated occurrence of <code>d:Name</code> tag must result in an exception.
 * @throws Exception
 */
@Test public void validationOfDoublePropertyDifferentTagHierachy() throws Exception {
  String room="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(room);
  XmlEntityConsumer xec=new XmlEntityConsumer();
  ODataEntry result=xec.readEntry(entitySet,reqContent,false);
  assertNotNull(result);
}

Fixed version (ground truth):
/** 
 * Double occurrence of <code>Name</code> tag within ignored/unknown property AND different namespace is allowed.
 * @throws Exception
 */
@Test public void validationOfDoublePropertyDifferentTagHierachy() throws Exception {
  String room="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(room);
  XmlEntityConsumer xec=new XmlEntityConsumer();
  ODataEntry result=xec.readEntry(entitySet,reqContent,false);
  assertNotNull(result);
}
Program: 18034
Project: 18034
Buggy source:
@Override public boolean isAll(){
  return (isAll == null) || isAll;
}

Fixed version (ground truth):
@Override public boolean isAll(){
  return isAll.getBoolean();
}
Program: 18035
Project: 18035
Buggy source:
public void addProperty(final EdmProperty property){
  if (isAll == null) {
    isAll=false;
  }
  if (!isAll && !properties.contains(property)) {
    properties.add(property);
  }
}

Fixed version (ground truth):
public void addProperty(final EdmProperty property){
  if (isAll == AllKinds.IMPLICITLYTRUE) {
    isAll=AllKinds.FALSE;
  }
  if (isAll != AllKinds.EXPLICITLYTRUE && !properties.contains(property)) {
    properties.add(property);
  }
}
Program: 18036
Project: 18036
Buggy source:
public ExpandSelectTreeNode addChild(final EdmNavigationProperty navigationProperty,final ExpandSelectTreeNode childNode){
  if (isAll == null) {
    isAll=false;
  }
  if (links.containsKey(navigationProperty)) {
    ExpandSelectTreeNodeImpl existingNode=(ExpandSelectTreeNodeImpl)links.get(navigationProperty);
    if (existingNode != childNode && childNode != null) {
      if (existingNode.isAll() || childNode.isAll()) {
        existingNode.setAllExplicitly();
        for (        Map.Entry<EdmNavigationProperty,ExpandSelectTreeNode> entry : childNode.getLinks().entrySet()) {
          if (entry.getValue() != null) {
            existingNode.addChild(entry.getKey(),entry.getValue());
          }
        }
      }
 else {
        for (        EdmProperty property : childNode.getProperties()) {
          existingNode.addProperty(property);
        }
        for (        Map.Entry<EdmNavigationProperty,ExpandSelectTreeNode> entry : childNode.getLinks().entrySet()) {
          existingNode.addChild(entry.getKey(),entry.getValue());
        }
      }
    }
    return existingNode;
  }
  if (isAll && childNode == null) {
    return null;
  }
  links.put(navigationProperty,childNode);
  return childNode;
}

Fixed version (ground truth):
public ExpandSelectTreeNode addChild(final EdmNavigationProperty navigationProperty,final ExpandSelectTreeNode childNode){
  if (isAll == AllKinds.IMPLICITLYTRUE) {
    isAll=AllKinds.FALSE;
  }
  if (links.containsKey(navigationProperty)) {
    ExpandSelectTreeNodeImpl existingNode=(ExpandSelectTreeNodeImpl)links.get(navigationProperty);
    ExpandSelectTreeNodeImpl childNodeInternal=(ExpandSelectTreeNodeImpl)childNode;
    if (existingNode != childNode && childNode != null) {
      if (existingNode.isAllInternal() == AllKinds.EXPLICITLYTRUE || childNodeInternal.isAllInternal() == AllKinds.EXPLICITLYTRUE) {
        existingNode.setAllExplicitly();
        for (        Map.Entry<EdmNavigationProperty,ExpandSelectTreeNode> entry : childNode.getLinks().entrySet()) {
          if (entry.getValue() != null) {
            existingNode.addChild(entry.getKey(),entry.getValue());
          }
        }
      }
 else {
        for (        EdmProperty property : childNode.getProperties()) {
          existingNode.addProperty(property);
        }
        for (        Map.Entry<EdmNavigationProperty,ExpandSelectTreeNode> entry : childNode.getLinks().entrySet()) {
          existingNode.addChild(entry.getKey(),entry.getValue());
        }
      }
    }
    return existingNode;
  }
  if (isAll != AllKinds.FALSE && childNode == null) {
    return null;
  }
  links.put(navigationProperty,childNode);
  return childNode;
}
Program: 18037
Project: 18037
Buggy source:
public void setAllExplicitly(){
  isAll=true;
  properties.clear();
  Iterator<EdmNavigationProperty> iterator=links.keySet().iterator();
  while (iterator.hasNext()) {
    EdmNavigationProperty navProp=iterator.next();
    if (links.get(navProp) == null) {
      iterator.remove();
    }
  }
}

Fixed version (ground truth):
public void setAllExplicitly(){
  isAll=AllKinds.EXPLICITLYTRUE;
  properties.clear();
  Iterator<EdmNavigationProperty> iterator=links.keySet().iterator();
  while (iterator.hasNext()) {
    EdmNavigationProperty navProp=iterator.next();
    if (links.get(navProp) == null) {
      iterator.remove();
    }
  }
}
Program: 18038
Project: 18038
Buggy source:
private ContentType doContentNegotiationForFormat(final UriInfoImpl uriInfo) throws ODataException {
  ContentType formatContentType=mapFormat(uriInfo);
  formatContentType=ensureCharsetIsSet(formatContentType);
  final Class<? extends ODataProcessor> processorFeature=dispatcher.mapUriTypeToProcessorFeature(uriInfo);
  final List<ContentType> supportedContentTypes=getSupportedContentTypes(processorFeature);
  for (  final ContentType contentType : supportedContentTypes) {
    if (contentType.equals(formatContentType)) {
      return formatContentType;
    }
  }
  throw new ODataNotAcceptableException(ODataNotAcceptableException.NOT_SUPPORTED_CONTENT_TYPE.addContent(uriInfo.getFormat()));
}

Fixed version (ground truth):
private ContentType doContentNegotiationForFormat(final UriInfoImpl uriInfo) throws ODataException {
  validateFormatQuery(uriInfo);
  ContentType formatContentType=mapFormat(uriInfo);
  formatContentType=ensureCharsetIsSet(formatContentType);
  final Class<? extends ODataProcessor> processorFeature=dispatcher.mapUriTypeToProcessorFeature(uriInfo);
  final List<ContentType> supportedContentTypes=getSupportedContentTypes(processorFeature);
  for (  final ContentType contentType : supportedContentTypes) {
    if (contentType.equals(formatContentType)) {
      return formatContentType;
    }
  }
  throw new ODataNotAcceptableException(ODataNotAcceptableException.NOT_SUPPORTED_CONTENT_TYPE.addContent(uriInfo.getFormat()));
}
Program: 18039
Project: 18039
Buggy source:
private String createLineForJiraTable(Set<TestResult> results){
  final StringBuilder b=new StringBuilder(SEPARATOR);
  append(b,buildUriForJira(results));
  boolean acceptHeaderUnwritten=true;
  for (  final TestResult result : results) {
    if (acceptHeaderUnwritten) {
      append(b,result.getRequestHeader(HttpHeaders.ACCEPT));
      acceptHeaderUnwritten=false;
    }
    append(b,result.getResponseHeader(HttpHeaders.CONTENT_TYPE));
    append(b,result.getSomeValue("String_Node_Str"));
  }
  b.append("String_Node_Str");
  return b.toString();
}

Fixed version (ground truth):
private String createLineForJiraTable(Set<TestResult> results){
  final StringBuilder b=new StringBuilder(SEPARATOR);
  append(b,buildUriForJira(results));
  boolean acceptHeaderUnwritten=true;
  for (  final TestResult result : results) {
    if (acceptHeaderUnwritten) {
      append(b,result.getRequestHeader(HttpHeaders.ACCEPT));
      acceptHeaderUnwritten=false;
    }
    append(b,result.getResponseHeader(HttpHeaders.CONTENT_TYPE));
    append(b,result.getSomeValue(RESPONSE_STATUS_CODE));
  }
  b.append("String_Node_Str");
  return b.toString();
}
Program: 18040
Project: 18040
Buggy source:
public String getRequestHeader(String name){
  return reqHeaders.get(name);
}

Fixed version (ground truth):
public String getRequestHeader(String name){
  return reqHeaders.get(normalizeHeaderName(name));
}
Program: 18041
Project: 18041
Buggy source:
public void addResponseHeader(String name,String value){
  resHeaders.put(name,value);
}

Fixed version (ground truth):
public void addResponseHeader(String name,String value){
  resHeaders.put(normalizeHeaderName(name),value);
}
Program: 18042
Project: 18042
Buggy source:
public void addRequestHeader(String name,String value){
  reqHeaders.put(name,value);
}

Fixed version (ground truth):
public void addRequestHeader(String name,String value){
  reqHeaders.put(normalizeHeaderName(name),value);
}
Program: 18043
Project: 18043
Buggy source:
public String getResponseHeader(String name){
  return resHeaders.get(name);
}

Fixed version (ground truth):
public String getResponseHeader(String name){
  return resHeaders.get(normalizeHeaderName(name));
}
Program: 18044
Project: 18044
Buggy source:
/** 
 * @see ServiceDocumentProcessor
 */
@Override public ODataResponse readServiceDocument(GetServiceDocumentUriInfo uriInfo,String contentType) throws ODataException {
  final Edm entityDataModel=getContext().getService().getEntityDataModel();
  final String serviceRoot=getContext().getPathInfo().getServiceRoot().toASCIIString();
  final ODataResponse response=EntityProvider.writeServiceDocument(contentType,entityDataModel,serviceRoot);
  final ODataResponseBuilder odataResponseBuilder=ODataResponse.fromResponse(response).header(ODataHttpHeaders.DATASERVICEVERSION,ODataServiceVersion.V10);
  if (!(contentType.equals(response.getContentHeader()) || (contentType.contains("String_Node_Str") && response.getContentHeader().contains("String_Node_Str")))) {
    odataResponseBuilder.contentHeader(contentType);
  }
  return odataResponseBuilder.build();
}

Fixed version (ground truth):
/** 
 * @see ServiceDocumentProcessor
 */
@Override public ODataResponse readServiceDocument(GetServiceDocumentUriInfo uriInfo,String contentType) throws ODataException {
  final Edm entityDataModel=getContext().getService().getEntityDataModel();
  final String serviceRoot=getContext().getPathInfo().getServiceRoot().toASCIIString();
  final ODataResponse response=EntityProvider.writeServiceDocument(contentType,entityDataModel,serviceRoot);
  final ODataResponseBuilder odataResponseBuilder=ODataResponse.fromResponse(response).header(ODataHttpHeaders.DATASERVICEVERSION,ODataServiceVersion.V10);
  if (isContentTypeUpdateNecessary(contentType,response)) {
    odataResponseBuilder.contentHeader(contentType);
  }
  return odataResponseBuilder.build();
}
Program: 18046
Project: 18046
Buggy source:
private ContentType mapFormat(final UriInfoImpl uriInfo){
  String format=uriInfo.getFormat();
  if ("String_Node_Str".equals(format)) {
    return ContentType.APPLICATION_XML;
  }
 else   if ("String_Node_Str".equals(format)) {
    return ContentType.APPLICATION_ATOM_XML;
  }
 else   if ("String_Node_Str".equals(format)) {
    return ContentType.APPLICATION_JSON;
  }
  return ContentType.create(format);
}

Fixed version (ground truth):
private ContentType mapFormat(final UriInfoImpl uriInfo){
  String format=uriInfo.getFormat();
  if ("String_Node_Str".equals(format)) {
    return ContentType.APPLICATION_XML;
  }
 else   if ("String_Node_Str".equals(format)) {
    if (uriInfo.getUriType() == UriType.URI0) {
      return ContentType.APPLICATION_ATOM_SVC;
    }
    return ContentType.APPLICATION_ATOM_XML;
  }
 else   if ("String_Node_Str".equals(format)) {
    return ContentType.APPLICATION_JSON;
  }
  return ContentType.create(format);
}
Program: 18047
Project: 18047
Buggy source:
@Override ODataSingleProcessor createProcessor() throws ODataException {
  final String contentType=HttpContentType.APPLICATION_ATOM_XML_UTF8;
  final ODataResponse responseAtomXml=ODataResponse.status(HttpStatusCodes.OK).contentHeader(contentType).entity("String_Node_Str").build();
  when(((ServiceDocumentProcessor)processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),eq(contentType))).thenReturn(responseAtomXml);
  final ODataResponse value=ODataResponse.status(HttpStatusCodes.OK).contentHeader("String_Node_Str").build();
  when(((ServiceDocumentProcessor)processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),eq("String_Node_Str"))).thenReturn(value);
  when(((CustomContentType)processor).getCustomContentTypes(ServiceDocumentProcessor.class)).thenReturn(Arrays.asList("String_Node_Str"));
  return processor;
}

Fixed version (ground truth):
@Override ODataSingleProcessor createProcessor() throws ODataException {
  final String contentType="String_Node_Str";
  final ODataResponse responseAtomXml=ODataResponse.status(HttpStatusCodes.OK).contentHeader(contentType).entity("String_Node_Str").build();
  when(((ServiceDocumentProcessor)processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),eq(contentType))).thenReturn(responseAtomXml);
  final ODataResponse value=ODataResponse.status(HttpStatusCodes.OK).contentHeader("String_Node_Str").build();
  when(((ServiceDocumentProcessor)processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),eq("String_Node_Str"))).thenReturn(value);
  when(((CustomContentType)processor).getCustomContentTypes(ServiceDocumentProcessor.class)).thenReturn(Arrays.asList("String_Node_Str"));
  return processor;
}
Program: 18048
Project: 18048
Buggy source:
@Test public void testAtomFormatForServiceDocument() throws Exception {
  final HttpResponse response=executeGetRequest("String_Node_Str");
  final String responseEntity=StringHelper.httpEntityToString(response.getEntity());
  assertEquals("String_Node_Str",responseEntity);
  assertEquals(HttpStatusCodes.OK.getStatusCode(),response.getStatusLine().getStatusCode());
  final Header header=response.getFirstHeader(HttpHeaders.CONTENT_TYPE);
  assertEquals(HttpContentType.APPLICATION_ATOM_XML_UTF8,header.getValue());
}

Fixed version (ground truth):
@Test public void testAtomFormatForServiceDocument() throws Exception {
  final HttpResponse response=executeGetRequest("String_Node_Str");
  final String responseEntity=StringHelper.httpEntityToString(response.getEntity());
  assertEquals("String_Node_Str",responseEntity);
  assertEquals(HttpStatusCodes.OK.getStatusCode(),response.getStatusLine().getStatusCode());
  final Header header=response.getFirstHeader(HttpHeaders.CONTENT_TYPE);
  assertEquals("String_Node_Str",header.getValue());
}
Program: 18049
Project: 18049
Buggy source:
@Test public void serviceDocumentAcceptHeaderAtom() throws Exception {
  HttpResponse response=callUri("String_Node_Str",HttpHeaders.ACCEPT,HttpContentType.APPLICATION_ATOM_XML);
  checkMediaType(response,HttpContentType.APPLICATION_ATOM_SVC_UTF8);
  validateXmlServiceDocument(getBody(response));
}

Fixed version (ground truth):
@Test public void serviceDocumentAcceptHeaderAtom() throws Exception {
  final HttpResponse response=callUri("String_Node_Str",HttpHeaders.ACCEPT,HttpContentType.APPLICATION_ATOM_XML,HttpStatusCodes.NOT_ACCEPTABLE);
  assertXmlErrorResponse(response);
}
Program: 18050
Project: 18050
Buggy source:
@Test public void serviceDocumentAcceptHeaderUtf8Atom() throws Exception {
  HttpResponse response=callUri("String_Node_Str",HttpHeaders.ACCEPT,HttpContentType.APPLICATION_ATOM_XML_UTF8);
  checkMediaType(response,HttpContentType.APPLICATION_ATOM_SVC_UTF8);
  validateXmlServiceDocument(getBody(response));
}

Fixed version (ground truth):
@Test public void serviceDocumentAcceptHeaderUtf8Atom() throws Exception {
  final HttpResponse response=callUri("String_Node_Str",HttpHeaders.ACCEPT,HttpContentType.APPLICATION_ATOM_XML_UTF8,HttpStatusCodes.NOT_ACCEPTABLE);
  assertXmlErrorResponse(response);
}
Program: 18051
Project: 18051
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args) throws Exception {
  final List<String> paths=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  final String header=HttpHeaders.ACCEPT;
  final List<String> headerValues=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  final List<TestPath> testPaths=TestPath.createTestPaths(paths,header,headerValues);
  final CallerResultHandler handler=new CallerResultHandler();
  final String localBaseUrl="String_Node_Str";
  final CallerConfig localConfig=new CallerConfig(localBaseUrl,handler,testPaths);
  AcceptHeaderCaller.create(localConfig).call();
  final String result=handler.getResult();
  System.out.println(result);
}

Fixed version (ground truth):
/** 
 * @param args
 */
public static void main(String[] args) throws Exception {
  final List<String> paths=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  final String header=HttpHeaders.ACCEPT;
  final List<String> headerValues=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  final List<TestPath> testPaths=TestPath.createTestPaths(paths,header,headerValues);
  final CallerResultHandler handler=new CallerResultHandler();
  final String localBaseUrl="String_Node_Str";
  final CallerConfig localConfig=new CallerConfig(localBaseUrl,handler,testPaths);
  AcceptHeaderCaller.create(localConfig).call();
  final String result=handler.getResult();
  System.out.println(result);
}
Program: 18052
Project: 18052
Buggy source:
@Test public void testGetConsistentEdmComplexTypes(){
  assertEquals(objComplexType.getConsistentEdmComplexTypes().size(),1);
}

Fixed version (ground truth):
@Test public void testGetConsistentEdmComplexTypes(){
  assertTrue(objComplexType.getConsistentEdmComplexTypes().size() > 0);
}
Program: 18053
Project: 18053
Buggy source:
@Test public void testGetConsistentEdmComplexTypes(){
  assertEquals(objComplexType.getConsistentEdmComplexTypes().size(),1);
}

Fixed version (ground truth):
@Test public void testGetConsistentEdmComplexTypes(){
  assertTrue(objComplexType.getConsistentEdmComplexTypes().size() > 0);
}
Program: 18054
Project: 18054
Buggy source:
/** 
 * @see ServiceDocumentProcessor
 */
@Override public ODataResponse readServiceDocument(GetServiceDocumentUriInfo uriInfo,String contentType) throws ODataException {
  final Edm entityDataModel=getContext().getService().getEntityDataModel();
  final String serviceRoot=getContext().getPathInfo().getServiceRoot().toASCIIString();
  final ODataResponse response=EntityProvider.writeServiceDocument(contentType,entityDataModel,serviceRoot);
  final ODataResponseBuilder odataResponseBuilder=ODataResponse.fromResponse(response).header(ODataHttpHeaders.DATASERVICEVERSION,Edm.DATA_SERVICE_VERSION_10);
  if (!(contentType.equals(response.getContentHeader()) || (contentType.contains("String_Node_Str") && response.getContentHeader().contains("String_Node_Str")))) {
    odataResponseBuilder.contentHeader(contentType);
  }
  return odataResponseBuilder.build();
}

Fixed version (ground truth):
/** 
 * @see ServiceDocumentProcessor
 */
@Override public ODataResponse readServiceDocument(GetServiceDocumentUriInfo uriInfo,String contentType) throws ODataException {
  final Edm entityDataModel=getContext().getService().getEntityDataModel();
  final String serviceRoot=getContext().getPathInfo().getServiceRoot().toASCIIString();
  final ODataResponse response=EntityProvider.writeServiceDocument(contentType,entityDataModel,serviceRoot);
  final ODataResponseBuilder odataResponseBuilder=ODataResponse.fromResponse(response).header(ODataHttpHeaders.DATASERVICEVERSION,ODataServiceVersion.V10);
  if (!(contentType.equals(response.getContentHeader()) || (contentType.contains("String_Node_Str") && response.getContentHeader().contains("String_Node_Str")))) {
    odataResponseBuilder.contentHeader(contentType);
  }
  return odataResponseBuilder.build();
}
Program: 18055
Project: 18055
Buggy source:
@Override public InputStream getMetadata() throws ODataException {
  if (schemas == null) {
    schemas=edmProvider.getSchemas();
  }
  OutputStreamWriter writer=null;
  CircleStreamBuffer csb=new CircleStreamBuffer();
  try {
    DataServices metadata=new DataServices().setSchemas(schemas).setDataServiceVersion(getDataServiceVersion());
    writer=new OutputStreamWriter(csb.getOutputStream(),"String_Node_Str");
    EdmMetadata.writeMetadata(metadata,writer);
    return csb.getInputStream();
  }
 catch (  UnsupportedEncodingException e) {
    throw new EntityProviderException(EntityProviderException.COMMON,e);
  }
 finally {
    if (writer != null) {
      try {
        writer.close();
      }
 catch (      IOException e) {
        LOG.error(e.getLocalizedMessage(),e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public InputStream getMetadata() throws ODataException {
  if (schemas == null) {
    schemas=edmProvider.getSchemas();
  }
  OutputStreamWriter writer=null;
  CircleStreamBuffer csb=new CircleStreamBuffer();
  try {
    DataServices metadata=new DataServices().setSchemas(schemas).setDataServiceVersion(getDataServiceVersion());
    writer=new OutputStreamWriter(csb.getOutputStream(),"String_Node_Str");
    XmlMetadataProducer.writeMetadata(metadata,writer,null);
    return csb.getInputStream();
  }
 catch (  UnsupportedEncodingException e) {
    throw new EntityProviderException(EntityProviderException.COMMON,e);
  }
 finally {
    if (writer != null) {
      try {
        writer.close();
      }
 catch (      IOException e) {
        LOG.error(e.getLocalizedMessage(),e);
      }
    }
  }
}
Program: 18057
Project: 18057
Buggy source:
private static void writeAnnotationAttributes(Collection<AnnotationAttribute> annotationAttributes,XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
  if (annotationAttributes != null) {
    for (    AnnotationAttribute annotationAttribute : annotationAttributes) {
      xmlStreamWriter.writeAttribute(annotationAttribute.getPrefix(),annotationAttribute.getNamespace(),annotationAttribute.getName(),annotationAttribute.getText());
      xmlStreamWriter.writeNamespace(annotationAttribute.getPrefix(),annotationAttribute.getNamespace());
    }
  }
}

Fixed version (ground truth):
private static void writeAnnotationAttributes(Collection<AnnotationAttribute> annotationAttributes,XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
  if (annotationAttributes != null) {
    ArrayList<String> setNamespaces=new ArrayList<String>();
    for (    AnnotationAttribute annotationAttribute : annotationAttributes) {
      xmlStreamWriter.writeAttribute(annotationAttribute.getPrefix(),annotationAttribute.getNamespace(),annotationAttribute.getName(),annotationAttribute.getText());
      if (!setNamespaces.contains(annotationAttribute.getNamespace())) {
        xmlStreamWriter.writeNamespace(annotationAttribute.getPrefix(),annotationAttribute.getNamespace());
        setNamespaces.add(annotationAttribute.getNamespace());
      }
    }
  }
}
Program: 18058
Project: 18058
Buggy source:
private static void writeAnnotationElements(Collection<AnnotationElement> annotationElements,XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
  if (annotationElements != null) {
    for (    AnnotationElement annotationElement : annotationElements) {
      xmlStreamWriter.writeStartElement(annotationElement.getPrefix(),annotationElement.getName(),annotationElement.getNamespace());
      xmlStreamWriter.writeNamespace(annotationElement.getPrefix(),annotationElement.getNamespace());
      xmlStreamWriter.writeCharacters(annotationElement.getXmlData());
      xmlStreamWriter.writeEndElement();
    }
  }
}

Fixed version (ground truth):
private static void writeAnnotationElements(Collection<AnnotationElement> annotationElements,XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
  if (annotationElements != null) {
    ArrayList<String> setNamespaces=new ArrayList<String>();
    for (    AnnotationElement annotationElement : annotationElements) {
      xmlStreamWriter.writeStartElement(annotationElement.getPrefix(),annotationElement.getName(),annotationElement.getNamespace());
      if (!setNamespaces.contains(annotationElement.getNamespace())) {
        xmlStreamWriter.writeNamespace(annotationElement.getPrefix(),annotationElement.getNamespace());
        setNamespaces.add(annotationElement.getNamespace());
      }
      xmlStreamWriter.writeCharacters(annotationElement.getXmlData());
      xmlStreamWriter.writeEndElement();
    }
  }
}
Program: 18059
Project: 18059
Buggy source:
@Test public void testSchemaStructure() throws Exception {
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
}

Fixed version (ground truth):
@Test public void testSchemaStructure() throws Exception {
  System.out.println(metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
}
Program: 18060
Project: 18060
Buggy source:
@BeforeClass public static void setup() throws Exception {
  EdmImplProv edmImplProv=new EdmImplProv(new EdmProviderMock());
  EdmServiceMetadata serviceMetadata=edmImplProv.getServiceMetadata();
  metadata=StringHelper.inputStreamToString(serviceMetadata.getMetadata());
  Map<String,String> prefixMap=new HashMap<String,String>();
  prefixMap.put(null,"String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  NamespaceContext ctx=new SimpleNamespaceContext(prefixMap);
  XMLUnit.setXpathNamespaceContext(ctx);
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  EdmImplProv edmImplProv=new EdmImplProv(new EdmTestProvider());
  EdmServiceMetadata serviceMetadata=edmImplProv.getServiceMetadata();
  metadata=StringHelper.inputStreamToString(serviceMetadata.getMetadata());
  Map<String,String> prefixMap=new HashMap<String,String>();
  prefixMap.put(null,"String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  NamespaceContext ctx=new SimpleNamespaceContext(prefixMap);
  XMLUnit.setXpathNamespaceContext(ctx);
}
Program: 18061
Project: 18061
Buggy source:
private static void writeAnnotationAttributes(Collection<AnnotationAttribute> annotationAttributes,XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
  if (annotationAttributes != null) {
    for (    AnnotationAttribute annotationAttribute : annotationAttributes) {
      xmlStreamWriter.writeAttribute(annotationAttribute.getPrefix(),annotationAttribute.getNamespace(),annotationAttribute.getName(),annotationAttribute.getText());
      xmlStreamWriter.writeNamespace(annotationAttribute.getPrefix(),annotationAttribute.getNamespace());
    }
  }
}

Fixed version (ground truth):
private static void writeAnnotationAttributes(Collection<AnnotationAttribute> annotationAttributes,XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
  if (annotationAttributes != null) {
    ArrayList<String> setNamespaces=new ArrayList<String>();
    for (    AnnotationAttribute annotationAttribute : annotationAttributes) {
      xmlStreamWriter.writeAttribute(annotationAttribute.getPrefix(),annotationAttribute.getNamespace(),annotationAttribute.getName(),annotationAttribute.getText());
      if (!setNamespaces.contains(annotationAttribute.getNamespace())) {
        xmlStreamWriter.writeNamespace(annotationAttribute.getPrefix(),annotationAttribute.getNamespace());
        setNamespaces.add(annotationAttribute.getNamespace());
      }
    }
  }
}
Program: 18062
Project: 18062
Buggy source:
private static void writeAnnotationElements(Collection<AnnotationElement> annotationElements,XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
  if (annotationElements != null) {
    for (    AnnotationElement annotationElement : annotationElements) {
      xmlStreamWriter.writeStartElement(annotationElement.getPrefix(),annotationElement.getName(),annotationElement.getNamespace());
      xmlStreamWriter.writeNamespace(annotationElement.getPrefix(),annotationElement.getNamespace());
      xmlStreamWriter.writeCharacters(annotationElement.getXmlData());
      xmlStreamWriter.writeEndElement();
    }
  }
}

Fixed version (ground truth):
private static void writeAnnotationElements(Collection<AnnotationElement> annotationElements,XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
  if (annotationElements != null) {
    ArrayList<String> setNamespaces=new ArrayList<String>();
    for (    AnnotationElement annotationElement : annotationElements) {
      xmlStreamWriter.writeStartElement(annotationElement.getPrefix(),annotationElement.getName(),annotationElement.getNamespace());
      if (!setNamespaces.contains(annotationElement.getNamespace())) {
        xmlStreamWriter.writeNamespace(annotationElement.getPrefix(),annotationElement.getNamespace());
        setNamespaces.add(annotationElement.getNamespace());
      }
      xmlStreamWriter.writeCharacters(annotationElement.getXmlData());
      xmlStreamWriter.writeEndElement();
    }
  }
}
Program: 18063
Project: 18063
Buggy source:
@Test public void testSchemaStructure() throws Exception {
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
}

Fixed version (ground truth):
@Test public void testSchemaStructure() throws Exception {
  System.out.println(metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
  assertXpathExists("String_Node_Str",metadata);
}
Program: 18064
Project: 18064
Buggy source:
@BeforeClass public static void setup() throws Exception {
  EdmImplProv edmImplProv=new EdmImplProv(new EdmProviderMock());
  EdmServiceMetadata serviceMetadata=edmImplProv.getServiceMetadata();
  metadata=StringHelper.inputStreamToString(serviceMetadata.getMetadata());
  Map<String,String> prefixMap=new HashMap<String,String>();
  prefixMap.put(null,"String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  NamespaceContext ctx=new SimpleNamespaceContext(prefixMap);
  XMLUnit.setXpathNamespaceContext(ctx);
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  EdmImplProv edmImplProv=new EdmImplProv(new EdmTestProvider());
  EdmServiceMetadata serviceMetadata=edmImplProv.getServiceMetadata();
  metadata=StringHelper.inputStreamToString(serviceMetadata.getMetadata());
  Map<String,String> prefixMap=new HashMap<String,String>();
  prefixMap.put(null,"String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  prefixMap.put("String_Node_Str","String_Node_Str");
  NamespaceContext ctx=new SimpleNamespaceContext(prefixMap);
  XMLUnit.setXpathNamespaceContext(ctx);
}
Program: 18066
Project: 18066
Buggy source:
@Test public void testExpandEdmComplexType(){
  ComplexType complexType=new ComplexType();
  List<Property> properties=new ArrayList<Property>();
  properties.add(new SimpleProperty().setName("String_Node_Str"));
  properties.add(new SimpleProperty().setName("String_Node_Str"));
  complexType.setProperties(properties);
  List<Property> expandedList=null;
  try {
    objComplexType.expandEdmComplexType(complexType,expandedList);
  }
 catch (  ClassCastException e) {
    assertTrue(false);
  }
  assertTrue(true);
}

Fixed version (ground truth):
@Test public void testExpandEdmComplexType(){
  ComplexType complexType=new ComplexType();
  List<Property> properties=new ArrayList<Property>();
  properties.add(new SimpleProperty().setName("String_Node_Str"));
  properties.add(new SimpleProperty().setName("String_Node_Str"));
  complexType.setProperties(properties);
  List<Property> expandedList=null;
  try {
    objComplexType.expandEdmComplexType(complexType,expandedList,"String_Node_Str");
  }
 catch (  ClassCastException e) {
    assertTrue(false);
  }
  assertTrue(true);
}
Program: 18067
Project: 18067
Buggy source:
private void setValuesToSet(){
  attributeSet.add((Attribute<? super String,String>)new JPAEdmAttribute(java.lang.String.class,"String_Node_Str"));
  attributeSet.add((Attribute<? super String,String>)new JPAEdmAttribute(java.lang.String.class,"String_Node_Str"));
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void setValuesToSet(){
  attributeSet.add((Attribute<? super String,String>)new JPAEdmAttribute(java.lang.String.class,"String_Node_Str"));
  attributeSet.add((Attribute<? super String,String>)new JPAEdmAttribute(java.lang.String.class,"String_Node_Str"));
}
Program: 18068
Project: 18068
Buggy source:
@Override public void expandEdmComplexType(ComplexType arg0,List<Property> arg1){
}

Fixed version (ground truth):
@Override public void expandEdmComplexType(ComplexType complexType,List<Property> expandedPropertyList,String embeddablePropertyName){
}
Program: 18069
Project: 18069
Buggy source:
@Override public void expandEdmComplexType(ComplexType arg0,List<Property> arg1){
}

Fixed version (ground truth):
@Override public void expandEdmComplexType(ComplexType complexType,List<Property> expandedPropertyList,String embeddablePropertyName){
}
Program: 18070
Project: 18070
Buggy source:
@Override public Class<ComplexTypeA> getJavaType(){
  return (Class<ComplexTypeA>)JPAEdmMockData.ComplexType.ComplexTypeA.class;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Class<ComplexTypeA> getJavaType(){
  return (Class<ComplexTypeA>)JPAEdmMockData.ComplexType.ComplexTypeA.class;
}
Program: 18071
Project: 18071
Buggy source:
@Override public void addJPAEdmRefConstraintView(JPAEdmReferentialContraintView arg0){
}

Fixed version (ground truth):
@Override public void addJPAEdmRefConstraintView(JPAEdmReferentialConstraintView arg0){
}
Program: 18072
Project: 18072
Buggy source:
@Override public void addJPAEdmRefConstraintView(JPAEdmReferentialContraintView arg0){
}

Fixed version (ground truth):
@Override public void addJPAEdmRefConstraintView(JPAEdmReferentialConstraintView arg0){
}
Program: 18073
Project: 18073
Buggy source:
private EdmSimpleType getEdmSimpleTypeMockedObj(String value) throws EdmException {
  EdmSimpleType edmSimpleType=EasyMock.createMock(EdmSimpleType.class);
  EasyMock.expect(edmSimpleType.getName()).andReturn(value);
  EasyMock.expect(edmSimpleType.getKind()).andReturn(EdmTypeKind.SIMPLE).times(10);
  EasyMock.expect(edmSimpleType.valueOfString(value,EdmLiteralKind.URI,getEdmFacetsMockedObj())).andReturn(value).times(10);
  EasyMock.expect(edmSimpleType.valueOfString(value,EdmLiteralKind.URI,null)).andReturn(value).times(10);
  EasyMock.expect(edmSimpleType.valueToString(value,EdmLiteralKind.DEFAULT,getEdmFacetsMockedObj())).andReturn(value).times(10);
  EasyMock.expect(edmSimpleType.valueToString(value,EdmLiteralKind.DEFAULT,null)).andReturn(value).times(10);
  EasyMock.replay(edmSimpleType);
  return edmSimpleType;
}

Fixed version (ground truth):
private EdmSimpleType getEdmSimpleTypeMockedObj(String value) throws EdmException {
  EdmSimpleType edmSimpleType=EasyMock.createMock(EdmSimpleType.class);
  EasyMock.expect(edmSimpleType.getName()).andReturn(value);
  EasyMock.expect(edmSimpleType.getKind()).andReturn(EdmTypeKind.SIMPLE).times(10);
  EasyMock.expect(edmSimpleType.valueOfString(value,EdmLiteralKind.URI,getEdmFacetsMockedObj(),null)).andReturn(value).times(10);
  EasyMock.expect(edmSimpleType.valueOfString(value,EdmLiteralKind.URI,null,null)).andReturn(value).times(10);
  EasyMock.expect(edmSimpleType.valueToString(value,EdmLiteralKind.DEFAULT,getEdmFacetsMockedObj())).andReturn(value).times(10);
  EasyMock.expect(edmSimpleType.valueToString(value,EdmLiteralKind.DEFAULT,null)).andReturn(value).times(10);
  EasyMock.replay(edmSimpleType);
  return edmSimpleType;
}
Program: 18074
Project: 18074
Buggy source:
/** 
 * This method evaluated the where expression for read of an entity based on the keys specified in the query.
 * @param keyPredicates
 * @return the evaluated where expression
 */
public static String parseKeyPredicates(List<KeyPredicate> keyPredicates,String tableAlias) throws ODataJPARuntimeException {
  String literal=null;
  String propertyName=null;
  EdmSimpleType edmSimpleType=null;
  StringBuilder keyFilters=new StringBuilder();
  int i=0;
  for (  KeyPredicate keyPredicate : keyPredicates) {
    if (i > 0) {
      keyFilters.append(SPACE + JPQLStatement.Operator.AND + SPACE);
    }
    i++;
    literal=keyPredicate.getLiteral();
    try {
      propertyName=keyPredicate.getProperty().getName();
      edmSimpleType=(EdmSimpleType)keyPredicate.getProperty().getType();
    }
 catch (    EdmException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RUNTIME_EXCEPTION.addContent(e.getMessage()),e);
    }
    literal=evaluateComparingExpression(literal,edmSimpleType);
    keyFilters.append(tableAlias + DOT + propertyName+ SPACE+ JPQLStatement.Operator.EQ+ SPACE+ literal);
  }
  return keyFilters.toString();
}

Fixed version (ground truth):
/** 
 * This method evaluated the where expression for read of an entity based on the keys specified in the query.
 * @param keyPredicates
 * @return the evaluated where expression
 */
public static String parseKeyPredicates(List<KeyPredicate> keyPredicates,String tableAlias) throws ODataJPARuntimeException {
  String literal=null;
  String propertyName=null;
  EdmSimpleType edmSimpleType=null;
  StringBuilder keyFilters=new StringBuilder();
  int i=0;
  for (  KeyPredicate keyPredicate : keyPredicates) {
    if (i > 0) {
      keyFilters.append(JPQLStatement.DELIMITER.SPACE + JPQLStatement.Operator.AND + JPQLStatement.DELIMITER.SPACE);
    }
    i++;
    literal=keyPredicate.getLiteral();
    try {
      propertyName=keyPredicate.getProperty().getMapping().getInternalName();
      edmSimpleType=(EdmSimpleType)keyPredicate.getProperty().getType();
    }
 catch (    EdmException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RUNTIME_EXCEPTION.addContent(e.getMessage()),e);
    }
    literal=evaluateComparingExpression(literal,edmSimpleType);
    keyFilters.append(tableAlias + JPQLStatement.DELIMITER.PERIOD + propertyName+ JPQLStatement.DELIMITER.SPACE+ JPQLStatement.Operator.EQ+ JPQLStatement.DELIMITER.SPACE+ literal);
  }
  return keyFilters.toString();
}
Program: 18075
Project: 18075
Buggy source:
public static HashMap<String,String> parseKeyPredicatesToJPAOrderByExpression(List<KeyPredicate> keyPredicates,String tableAlias) throws ODataJPARuntimeException {
  HashMap<String,String> orderByMap=new HashMap<String,String>();
  String propertyName=null;
  for (  KeyPredicate keyPredicate : keyPredicates) {
    try {
      propertyName=keyPredicate.getProperty().getName();
    }
 catch (    EdmException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RUNTIME_EXCEPTION.addContent(e.getMessage()),e);
    }
    orderByMap.put(tableAlias + DOT + propertyName,EMPTY);
  }
  return orderByMap;
}

Fixed version (ground truth):
public static HashMap<String,String> parseKeyPredicatesToJPAOrderByExpression(List<KeyPredicate> keyPredicates,String tableAlias) throws ODataJPARuntimeException {
  HashMap<String,String> orderByMap=new HashMap<String,String>();
  String propertyName=null;
  for (  KeyPredicate keyPredicate : keyPredicates) {
    try {
      propertyName=keyPredicate.getProperty().getMapping().getInternalName();
    }
 catch (    EdmException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RUNTIME_EXCEPTION.addContent(e.getMessage()),e);
    }
    orderByMap.put(tableAlias + JPQLStatement.DELIMITER.PERIOD + propertyName,EMPTY);
  }
  return orderByMap;
}
Program: 18077
Project: 18077
Buggy source:
/** 
 * This method parses the order by condition in the query.
 * @param orderByExpression
 * @return
 * @throws ODataJPARuntimeException
 */
public static HashMap<String,String> parseToJPAOrderByExpression(OrderByExpression orderByExpression,String tableAlias) throws ODataJPARuntimeException {
  HashMap<String,String> orderByMap=new HashMap<String,String>();
  if (orderByExpression != null && orderByExpression.getOrders() != null) {
    List<OrderExpression> orderBys=orderByExpression.getOrders();
    String orderByField=null;
    String orderByDirection=null;
    for (    OrderExpression orderBy : orderBys) {
      try {
        orderByField=orderBy.getExpression().getEdmType().getName();
        orderByDirection=(orderBy.getSortOrder() == SortOrder.asc) ? EMPTY : "String_Node_Str";
        orderByMap.put(tableAlias + DOT + orderByField,orderByDirection);
      }
 catch (      EdmException e) {
        throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RUNTIME_EXCEPTION.addContent(e.getMessage()),e);
      }
    }
  }
  return orderByMap;
}

Fixed version (ground truth):
/** 
 * This method parses the order by condition in the query.
 * @param orderByExpression
 * @return
 * @throws ODataJPARuntimeException
 */
public static HashMap<String,String> parseToJPAOrderByExpression(OrderByExpression orderByExpression,String tableAlias) throws ODataJPARuntimeException {
  HashMap<String,String> orderByMap=new HashMap<String,String>();
  if (orderByExpression != null && orderByExpression.getOrders() != null) {
    List<OrderExpression> orderBys=orderByExpression.getOrders();
    String orderByField=null;
    String orderByDirection=null;
    for (    OrderExpression orderBy : orderBys) {
      try {
        orderByField=((EdmProperty)((PropertyExpression)orderBy.getExpression()).getEdmProperty()).getMapping().getInternalName();
        orderByDirection=(orderBy.getSortOrder() == SortOrder.asc) ? EMPTY : "String_Node_Str";
        orderByMap.put(tableAlias + JPQLStatement.DELIMITER.PERIOD + orderByField,orderByDirection);
      }
 catch (      EdmException e) {
        throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RUNTIME_EXCEPTION.addContent(e.getMessage()),e);
      }
    }
  }
  return orderByMap;
}
Program: 18078
Project: 18078
Buggy source:
protected ArrayList<String> generateSelectFields() throws EdmException {
  List<SelectItem> selectItemList=entitySetView.getSelect();
  if (selectItemList != null) {
    ArrayList<String> selectedFields=new ArrayList<String>(selectItemList.size());
    for (    SelectItem item : selectItemList) {
      selectedFields.add(item.getProperty().getName());
    }
    return selectedFields;
  }
  return null;
}

Fixed version (ground truth):
protected ArrayList<String> generateSelectFields() throws EdmException {
  List<SelectItem> selectItemList=entitySetView.getSelect();
  if (selectItemList != null) {
    ArrayList<String> selectedFields=new ArrayList<String>(selectItemList.size());
    for (    SelectItem item : selectItemList) {
      selectedFields.add(((EdmProperty)item.getProperty()).getMapping().getInternalName());
    }
    return selectedFields;
  }
  return null;
}
Program: 18079
Project: 18079
Buggy source:
protected ArrayList<String> generateSelectFields() throws EdmException {
  List<SelectItem> selectItemList=entityView.getSelect();
  if (selectItemList != null) {
    ArrayList<String> selectedFields=new ArrayList<String>(selectItemList.size());
    for (    SelectItem item : selectItemList) {
      selectedFields.add(item.getProperty().getName());
    }
    return selectedFields;
  }
  return null;
}

Fixed version (ground truth):
protected ArrayList<String> generateSelectFields() throws EdmException {
  List<SelectItem> selectItemList=entityView.getSelect();
  if (selectItemList != null) {
    ArrayList<String> selectedFields=new ArrayList<String>(selectItemList.size());
    for (    SelectItem item : selectItemList) {
      selectedFields.add(((EdmProperty)item.getProperty()).getMapping().getInternalName());
    }
    return selectedFields;
  }
  return null;
}
Program: 18081
Project: 18081
Buggy source:
public static void build(JPAEdmAssociationSetView view){
  AssociationSet associationSet=view.getEdmAssociationSet();
  String name=view.getEdmAssociation().getName();
  associationSet.setName(name + ASSOCIATIONSET_SUFFIX);
}

Fixed version (ground truth):
public static void build(JPAEdmAssociationView associationView,JPAEdmPropertyView propertyView,JPAEdmNavigationProperty jpaEdmNavigationProperty){
  NavigationProperty navProp=jpaEdmNavigationProperty.getEdmNavigationProperty();
  String namespace=buildNamespace(associationView.getpUnitName());
  navProp.setRelationship(new FullQualifiedName(namespace,associationView.getEdmAssociation().getName()));
  FullQualifiedName associationEndTypeOne=associationView.getEdmAssociation().getEnd1().getType();
  if (propertyView.getJPAAttribute().getJavaType().getSimpleName().equals(associationEndTypeOne.getName())) {
    navProp.setFromRole(associationView.getEdmAssociation().getEnd2().getRole());
    navProp.setToRole(associationView.getEdmAssociation().getEnd1().getRole());
  }
 else {
    navProp.setToRole(associationView.getEdmAssociation().getEnd2().getRole());
    navProp.setFromRole(associationView.getEdmAssociation().getEnd1().getRole());
  }
  navProp.setName(propertyView.getJPAAttribute().getJavaType().getSimpleName().concat(NAVIGATION_NAME));
}
Program: 18082
Project: 18082
Buggy source:
@Override public Association searchAssociation(JPAEdmAssociationEndView view){
  for (  Association association : consistentAssociatonList)   if (view.compare(association.getEnd1(),association.getEnd2()))   return association;
  return null;
}

Fixed version (ground truth):
@Override public Association searchAssociation(JPAEdmAssociationEndView view){
  for (  Association association : consistentAssociatonList) {
    if (view.compare(association.getEnd1(),association.getEnd2())) {
      currentAssociation=association;
      return association;
    }
  }
  return null;
}