nus-yam/ex-repair huggingface dataset:
Program: 65757
Project: 65757
Buggy source:
public boolean equals(Object object){
  try {
    if (null == object) {
      return false;
    }
 else     if (this == object) {
      return true;
    }
    XPathFragment xPathFragment=(XPathFragment)object;
    if (null == predicate && null != xPathFragment.getPredicate()) {
      return false;
    }
    if (null != predicate && !predicate.equals(xPathFragment.getPredicate())) {
      return false;
    }
    return ((nameIsText && xPathFragment.nameIsText()) || (localName == xPathFragment.getLocalName()) || ((localName != null) && localName.equals(xPathFragment.getLocalName()))) && ((namespaceURI == xPathFragment.getNamespaceURI()) || ((namespaceURI != null) && namespaceURI.equals(xPathFragment.getNamespaceURI()))) && (this.indexValue == xPathFragment.getIndexValue())&& (nameIsText == xPathFragment.nameIsText());
  }
 catch (  ClassCastException e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean equals(Object object){
  try {
    if (null == object) {
      return false;
    }
 else     if (this == object) {
      return true;
    }
    XPathFragment xPathFragment=(XPathFragment)object;
    if (null == predicate && null != xPathFragment.getPredicate()) {
      return false;
    }
    if (null != predicate && !predicate.equals(xPathFragment.getPredicate())) {
      return false;
    }
    if (isNamespaceAware && xPathFragment.isNamespaceAware) {
      if (namespaceURI == null) {
        if (xPathFragment.getNamespaceURI() != null) {
          return false;
        }
      }
 else {
        if (xPathFragment.getNamespaceURI() == null) {
          return false;
        }
 else         if (namespaceURI != xPathFragment.getNamespaceURI() && !(namespaceURI.equals(xPathFragment.getNamespaceURI()))) {
          return false;
        }
      }
    }
    return ((nameIsText && xPathFragment.nameIsText()) || (getLocalName() == xPathFragment.getLocalName()) || ((getLocalName() != null) && getLocalName().equals(xPathFragment.getLocalName()))) && (this.indexValue == xPathFragment.getIndexValue()) && (nameIsText == xPathFragment.nameIsText());
  }
 catch (  ClassCastException e) {
    return false;
  }
}
Program: 65759
Project: 65759
Buggy source:
/** 
 * INTERNAL: Return the XMLDescriptor with the default root mapping matching the QName parameter.
 */
private XMLDescriptor getDescriptor(QName qName){
  return (XMLDescriptor)descriptorsByQName.get(qName);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the XMLDescriptor with the default root mapping matching the QName parameter.
 */
private XMLDescriptor getDescriptor(QName qName){
  XPathQName xpathQName=new XPathQName(qName.getNamespaceURI(),qName.getLocalPart(),true);
  return (XMLDescriptor)descriptorsByQName.get(xpathQName);
}
Program: 65761
Project: 65761
Buggy source:
private void addDescriptorByQName(QName qName,XMLDescriptor descriptor){
  descriptorsByQName.put(qName,descriptor);
}

Fixed version (ground truth):
private void addDescriptorByQName(XPathQName qName,XMLDescriptor descriptor){
  descriptorsByQName.put(qName,descriptor);
}
Program: 65763
Project: 65763
Buggy source:
public void setMediaType(MediaType mediaType){
  this.mediaType=mediaType;
}

Fixed version (ground truth):
/** 
 * Set the MediaType for this xmlMarshaller. See org.eclipse.persistence.oxm.MediaType for the media types supported by EclipseLink MOXy
 * @param mediaType
 */
public void setMediaType(MediaType mediaType){
  this.mediaType=mediaType;
}
Program: 65764
Project: 65764
Buggy source:
public Object getProperty(String key) throws PropertyException {
  if (key == null) {
    throw new IllegalArgumentException();
  }
  if (key.equals(JAXBContext.MEDIA_TYPE)) {
    if (mediaType == MediaType.APPLICATION_JSON) {
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
  throw new PropertyException("String_Node_Str");
}

Fixed version (ground truth):
public Object getProperty(String key) throws PropertyException {
  if (key == null) {
    throw new IllegalArgumentException();
  }
  if (key.equals(JAXBContext.MEDIA_TYPE)) {
    if (xmlUnmarshaller.getMediaType() == MediaType.APPLICATION_JSON) {
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
  throw new PropertyException("String_Node_Str");
}
Program: 65765
Project: 65765
Buggy source:
public void setProperty(String key,Object value) throws PropertyException {
  if (key == null) {
    throw new IllegalArgumentException();
  }
  if (key.equals(JAXBContext.MEDIA_TYPE)) {
    if ("String_Node_Str".equals(value)) {
      mediaType=MediaType.APPLICATION_JSON;
    }
 else     if ("String_Node_Str".equals(value)) {
      mediaType=MediaType.APPLICATION_XML;
    }
 else {
      throw new PropertyException(key,value);
    }
  }
 else {
    throw new PropertyException(key,value);
  }
}

Fixed version (ground truth):
public void setProperty(String key,Object value) throws PropertyException {
  if (key == null) {
    throw new IllegalArgumentException();
  }
  if (key.equals(JAXBContext.MEDIA_TYPE)) {
    if ("String_Node_Str".equals(value)) {
      xmlUnmarshaller.setMediaType(MediaType.APPLICATION_JSON);
    }
 else     if ("String_Node_Str".equals(value)) {
      xmlUnmarshaller.setMediaType(MediaType.APPLICATION_XML);
    }
 else {
      throw new PropertyException(key,value);
    }
  }
 else {
    throw new PropertyException(key,value);
  }
}
Program: 65767
Project: 65767
Buggy source:
public void testSimpleTypeWithSDO_Name(){
  String f="String_Node_Str";
  String xmlSchema=getSchema(f);
  List types=xsdHelper.define(xmlSchema);
  this.assertEquals(types.size(),1);
  Type type=(Type)types.get(0);
  this.assertEquals(type.getName(),"String_Node_Str");
  this.assertFalse(type.isAbstract());
  this.assertEquals(type.getBaseTypes().size(),1);
  Type baseType=(Type)type.getBaseTypes().get(0);
  this.assertEquals(baseType,SDOConstants.SDO_INT);
  this.assertTrue(type.isDataType());
  this.assertEquals(type.getURI(),"String_Node_Str");
}

Fixed version (ground truth):
public void testSimpleTypeWithSDO_Name(){
  String f="String_Node_Str";
  String xmlSchema=getSchema(f);
  List types=xsdHelper.define(xmlSchema);
  this.assertEquals(types.size(),1);
  Type type=(Type)types.get(0);
  this.assertEquals(type.getName(),"String_Node_Str");
  this.assertFalse(type.isAbstract());
  this.assertEquals(type.getBaseTypes().size(),1);
  Type baseType=(Type)type.getBaseTypes().get(0);
  this.assertEquals(baseType,SDOConstants.SDO_INT);
  assertEquals(((SDOType)baseType).getSubTypes().size(),0);
  this.assertTrue(type.isDataType());
  this.assertEquals(type.getURI(),"String_Node_Str");
}
Program: 65768
Project: 65768
Buggy source:
public void testSimpleTypeWithSDO_JAVA_ExtendedInstanceClass(){
  String f="String_Node_Str";
  String xmlSchema=getSchema(f);
  List types=xsdHelper.define(xmlSchema);
  this.assertEquals(types.size(),1);
  Type type=(Type)types.get(0);
  this.assertEquals("String_Node_Str",type.getName());
  this.assertFalse(type.isAbstract());
  this.assertEquals(type.getBaseTypes().size(),1);
  Type baseType=(Type)type.getBaseTypes().get(0);
  this.assertEquals(baseType,SDOConstants.SDO_INT);
  this.assertTrue(type.isDataType());
  this.assertEquals(type.getURI(),"String_Node_Str");
  this.assertEquals("String_Node_Str",((SDOType)type).getInstanceClassName());
}

Fixed version (ground truth):
public void testSimpleTypeWithSDO_JAVA_ExtendedInstanceClass(){
  String f="String_Node_Str";
  String xmlSchema=getSchema(f);
  List types=xsdHelper.define(xmlSchema);
  this.assertEquals(types.size(),1);
  Type type=(Type)types.get(0);
  this.assertEquals("String_Node_Str",type.getName());
  this.assertFalse(type.isAbstract());
  this.assertEquals(type.getBaseTypes().size(),1);
  Type baseType=(Type)type.getBaseTypes().get(0);
  this.assertEquals(baseType,SDOConstants.SDO_INT);
  assertEquals(((SDOType)baseType).getSubTypes().size(),0);
  this.assertTrue(type.isDataType());
  this.assertEquals(type.getURI(),"String_Node_Str");
  this.assertEquals("String_Node_Str",((SDOType)type).getInstanceClassName());
}
Program: 65769
Project: 65769
Buggy source:
public void testSimpleTypeWithAbstract(){
  String f="String_Node_Str";
  String xmlSchema=getSchema(f);
  List types=xsdHelper.define(xmlSchema);
  this.assertEquals(types.size(),1);
  Type type=(Type)types.get(0);
  this.assertEquals(type.getName(),"String_Node_Str");
  this.assertFalse(type.isAbstract());
  this.assertEquals(type.getBaseTypes().size(),1);
  Type baseType=(Type)type.getBaseTypes().get(0);
  this.assertEquals(baseType,SDOConstants.SDO_INT);
  this.assertTrue(type.isDataType());
  this.assertEquals(type.getURI(),"String_Node_Str");
}

Fixed version (ground truth):
public void testSimpleTypeWithAbstract(){
  String f="String_Node_Str";
  String xmlSchema=getSchema(f);
  List types=xsdHelper.define(xmlSchema);
  this.assertEquals(types.size(),1);
  Type type=(Type)types.get(0);
  this.assertEquals(type.getName(),"String_Node_Str");
  this.assertFalse(type.isAbstract());
  this.assertEquals(type.getBaseTypes().size(),1);
  Type baseType=(Type)type.getBaseTypes().get(0);
  this.assertEquals(baseType,SDOConstants.SDO_INT);
  assertEquals(((SDOType)baseType).getSubTypes().size(),0);
  this.assertTrue(type.isDataType());
  this.assertEquals(type.getURI(),"String_Node_Str");
}
Program: 65770
Project: 65770
Buggy source:
public void testSimpleTypeAnonymous(){
  String f="String_Node_Str";
  String xmlSchema=getSchema(f);
  List types=xsdHelper.define(xmlSchema);
  this.assertEquals(types.size(),1);
  Type type=(Type)types.get(0);
  this.assertEquals(type.getName(),"String_Node_Str");
  this.assertFalse(type.isAbstract());
  this.assertEquals(type.getBaseTypes().size(),1);
  Type baseType=(Type)type.getBaseTypes().get(0);
  this.assertEquals(baseType,SDOConstants.SDO_INT);
  this.assertTrue(type.isDataType());
  this.assertEquals(type.getURI(),"String_Node_Str");
}

Fixed version (ground truth):
public void testSimpleTypeAnonymous(){
  String f="String_Node_Str";
  String xmlSchema=getSchema(f);
  List types=xsdHelper.define(xmlSchema);
  this.assertEquals(types.size(),1);
  Type type=(Type)types.get(0);
  this.assertEquals(type.getName(),"String_Node_Str");
  this.assertFalse(type.isAbstract());
  this.assertEquals(type.getBaseTypes().size(),1);
  Type baseType=(Type)type.getBaseTypes().get(0);
  this.assertEquals(baseType,SDOConstants.SDO_INT);
  assertEquals(((SDOType)baseType).getSubTypes().size(),0);
  this.assertTrue(type.isDataType());
  this.assertEquals(type.getURI(),"String_Node_Str");
}
Program: 65771
Project: 65771
Buggy source:
/** 
 * INTERNAL:
 * @param type    a  type to become this Type's base Type.
 */
public void addBaseType(SDOType type){
  if (!this.getBaseTypes().contains(type)) {
    getBaseTypes().add(type);
    updateSubtypes(type);
    type.getSubTypes().add(this);
    if (type.isOpen() && this.isOpen()) {
      DatabaseMapping anyCollectionMapping=getXmlDescriptor().getMappingForAttributeName(ANY_MAPPING_ATTRIBUTE_NAME);
      getXmlDescriptor().getMappings().remove(anyCollectionMapping);
      DatabaseMapping anyAttrMapping=getXmlDescriptor().getMappingForAttributeName("String_Node_Str");
      getXmlDescriptor().getMappings().remove(anyAttrMapping);
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 * @param type    a  type to become this Type's base Type.
 */
public void addBaseType(SDOType type){
  if (!this.getBaseTypes().contains(type)) {
    getBaseTypes().add(type);
    updateSubtypes(type);
    if (!(type.isDataType() && (type.getQName().getNamespaceURI() == SDOConstants.SDO_URL || type.getQName().getNamespaceURI() == SDOConstants.SDOJAVA_URL))) {
      type.getSubTypes().add(this);
    }
    if (type.isOpen() && this.isOpen()) {
      DatabaseMapping anyCollectionMapping=getXmlDescriptor().getMappingForAttributeName(ANY_MAPPING_ATTRIBUTE_NAME);
      getXmlDescriptor().getMappings().remove(anyCollectionMapping);
      DatabaseMapping anyAttrMapping=getXmlDescriptor().getMappingForAttributeName("String_Node_Str");
      getXmlDescriptor().getMappings().remove(anyAttrMapping);
    }
  }
}
Program: 65772
Project: 65772
Buggy source:
public void testNewInstanceXSDExternalBindingError() throws Exception {
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  InputStream iStream=classLoader.getResourceAsStream(EXAMPLE_XSD);
  if (iStream == null) {
    fail("String_Node_Str" + EXAMPLE_XSD + "String_Node_Str");
  }
  InputStream xjbStream=classLoader.getResourceAsStream(EXTERNAL_BINDINGS);
  Map<String,Object> properties=new HashMap<String,Object>();
  properties.put(DynamicJAXBContextFactory.XML_SCHEMA_KEY,iStream);
  ArrayList<InputStream> xjbs=new ArrayList<InputStream>();
  xjbs.add(xjbStream);
  xjbs.add(xjbStream);
  properties.put(DynamicJAXBContextFactory.EXTERNAL_BINDINGS_KEY,xjbs);
  JAXBException caughtEx=null;
  try {
    DynamicJAXBContext jaxbContext=(DynamicJAXBContext)JAXBContext.newInstance("String_Node_Str",classLoader,properties);
  }
 catch (  JAXBException e) {
    if (e.getLinkedException() instanceof org.eclipse.persistence.exceptions.JAXBException) {
      caughtEx=e;
    }
 else {
      fail("String_Node_Str" + e);
    }
  }
catch (  Exception e) {
    fail("String_Node_Str" + e);
  }
  org.eclipse.persistence.exceptions.JAXBException jEx=(org.eclipse.persistence.exceptions.JAXBException)caughtEx.getLinkedException();
  assertEquals("String_Node_Str",org.eclipse.persistence.exceptions.JAXBException.XJB_NOT_SOURCE,jEx.getErrorCode());
}

Fixed version (ground truth):
public void testNewInstanceXSDExternalBindingError() throws Exception {
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  InputStream iStream=classLoader.getResourceAsStream(EXAMPLE_XSD);
  if (iStream == null) {
    fail("String_Node_Str" + EXAMPLE_XSD + "String_Node_Str");
  }
  InputStream xjbStream=classLoader.getResourceAsStream(EXTERNAL_BINDINGS);
  Map<String,Object> properties=new HashMap<String,Object>();
  properties.put(DynamicJAXBContextFactory.XML_SCHEMA_KEY,iStream);
  ArrayList<InputStream> xjbs=new ArrayList<InputStream>();
  xjbs.add(xjbStream);
  xjbs.add(xjbStream);
  properties.put(DynamicJAXBContextFactory.EXTERNAL_BINDINGS_KEY,xjbs);
  JAXBException caughtEx=null;
  try {
    DynamicJAXBContext jaxbContext=(DynamicJAXBContext)JAXBContext.newInstance("String_Node_Str",classLoader,properties);
  }
 catch (  JAXBException e) {
    caughtEx=e;
  }
catch (  Exception e) {
    fail("String_Node_Str" + e);
  }
  org.eclipse.persistence.exceptions.JAXBException jEx=null;
  Exception currentException=caughtEx;
  while (true) {
    if (currentException instanceof JAXBException) {
      Exception linkedEx=(Exception)((JAXBException)currentException).getLinkedException();
      if (linkedEx instanceof org.eclipse.persistence.exceptions.JAXBException) {
        jEx=(org.eclipse.persistence.exceptions.JAXBException)linkedEx;
        break;
      }
 else {
        currentException=linkedEx;
      }
    }
 else {
      break;
    }
  }
  if (jEx == null) {
    fail("String_Node_Str" + caughtEx);
  }
  assertEquals("String_Node_Str",org.eclipse.persistence.exceptions.JAXBException.XJB_NOT_SOURCE,jEx.getErrorCode());
}
Program: 65774
Project: 65774
Buggy source:
private void marshalSimpleValue(XPathFragment xmlRootFragment,MarshalRecord marshalRecord,Object originalValue,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlRootFragment != null) {
    QName qname=((XMLRoot)originalValue).getSchemaType();
    value=getValueToWrite(qname,value,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),marshalRecord);
    Namespace generatedNamespace=setupFragment((XMLRoot)originalValue,xmlRootFragment,marshalRecord);
    getXPathNode().startElement(marshalRecord,xmlRootFragment,object,session,namespaceResolver,null,null);
    if (generatedNamespace != null) {
      marshalRecord.attribute(XMLConstants.XMLNS_URL,generatedNamespace.getPrefix(),XMLConstants.XMLNS + XMLConstants.COLON + generatedNamespace.getPrefix(),generatedNamespace.getNamespaceURI());
    }
    updateNamespaces(qname,marshalRecord,null);
  }
  marshalRecord.characters((String)value);
  if (xmlRootFragment != null) {
    marshalRecord.endElement(xmlRootFragment,namespaceResolver);
  }
}

Fixed version (ground truth):
private void marshalSimpleValue(XPathFragment xmlRootFragment,MarshalRecord marshalRecord,Object originalValue,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlRootFragment != null) {
    QName qname=((XMLRoot)originalValue).getSchemaType();
    value=marshalRecord.getValueToWrite(qname,value,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager());
    Namespace generatedNamespace=setupFragment((XMLRoot)originalValue,xmlRootFragment,marshalRecord);
    getXPathNode().startElement(marshalRecord,xmlRootFragment,object,session,namespaceResolver,null,null);
    if (generatedNamespace != null) {
      marshalRecord.attribute(XMLConstants.XMLNS_URL,generatedNamespace.getPrefix(),XMLConstants.XMLNS + XMLConstants.COLON + generatedNamespace.getPrefix(),generatedNamespace.getNamespaceURI());
    }
    updateNamespaces(qname,marshalRecord,null);
  }
  marshalRecord.characters((String)value);
  if (xmlRootFragment != null) {
    marshalRecord.endElement(xmlRootFragment,namespaceResolver);
  }
}
Program: 65775
Project: 65775
Buggy source:
private void marshalSimpleValue(XPathFragment xmlRootFragment,MarshalRecord marshalRecord,Object originalValue,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlRootFragment != null) {
    QName qname=((XMLRoot)originalValue).getSchemaType();
    value=getValueToWrite(qname,value,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),marshalRecord);
    Namespace generatedNamespace=setupFragment(((XMLRoot)originalValue),xmlRootFragment,marshalRecord);
    getXPathNode().startElement(marshalRecord,xmlRootFragment,object,session,namespaceResolver,null,null);
    if (generatedNamespace != null) {
      marshalRecord.attribute(XMLConstants.XMLNS_URL,generatedNamespace.getPrefix(),XMLConstants.XMLNS + XMLConstants.COLON + generatedNamespace.getPrefix(),generatedNamespace.getNamespaceURI());
    }
    updateNamespaces(qname,marshalRecord,null);
  }
  if (value instanceof String) {
    marshalRecord.characters((String)value);
  }
 else {
    marshalRecord.node((org.w3c.dom.Node)value,marshalRecord.getNamespaceResolver());
  }
  if (xmlRootFragment != null) {
    marshalRecord.endElement(xmlRootFragment,namespaceResolver);
  }
}

Fixed version (ground truth):
private void marshalSimpleValue(XPathFragment xmlRootFragment,MarshalRecord marshalRecord,Object originalValue,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlRootFragment != null) {
    QName qname=((XMLRoot)originalValue).getSchemaType();
    value=marshalRecord.getValueToWrite(qname,value,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager());
    Namespace generatedNamespace=setupFragment(((XMLRoot)originalValue),xmlRootFragment,marshalRecord);
    getXPathNode().startElement(marshalRecord,xmlRootFragment,object,session,namespaceResolver,null,null);
    if (generatedNamespace != null) {
      marshalRecord.attribute(XMLConstants.XMLNS_URL,generatedNamespace.getPrefix(),XMLConstants.XMLNS + XMLConstants.COLON + generatedNamespace.getPrefix(),generatedNamespace.getNamespaceURI());
    }
    updateNamespaces(qname,marshalRecord,null);
  }
  if (value instanceof String) {
    marshalRecord.characters((String)value);
  }
 else {
    marshalRecord.node((org.w3c.dom.Node)value,marshalRecord.getNamespaceResolver());
  }
  if (xmlRootFragment != null) {
    marshalRecord.endElement(xmlRootFragment,namespaceResolver);
  }
}
Program: 65783
Project: 65783
Buggy source:
public void testCreateContextFromXSDNode() throws Exception {
  InputStream inputStream=ClassLoader.getSystemResourceAsStream(EXAMPLE_XSD);
  DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
  docFactory.setNamespaceAware(true);
  DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
  Document xsdDocument=docBuilder.parse(inputStream);
  Element xsdElement=xsdDocument.getDocumentElement();
  DynamicJAXBContext jaxbContext=DynamicJAXBContextFactory.createContextFromXSD(xsdElement,null,null,null);
  DynamicEntity emp=jaxbContext.newDynamicEntity(EMPLOYEE_CLASS_NAME);
  assertNotNull(emp);
  Exception caughtException=null;
  try {
    jaxbContext.refeshMetadata();
  }
 catch (  JAXBException e) {
    if (e.getLinkedException() instanceof UnsupportedOperationException) {
      caughtException=e;
    }
  }
  assertNotNull(caughtException);
}

Fixed version (ground truth):
public void testCreateContextFromXSDNode() throws Exception {
  InputStream inputStream=ClassLoader.getSystemResourceAsStream(EXAMPLE_XSD);
  DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
  docFactory.setNamespaceAware(true);
  DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
  Document xsdDocument=docBuilder.parse(inputStream);
  Element xsdElement=xsdDocument.getDocumentElement();
  DynamicJAXBContext jaxbContext=DynamicJAXBContextFactory.createContextFromXSD(xsdElement,null,null,null);
  DynamicEntity emp=jaxbContext.newDynamicEntity(EMPLOYEE_CLASS_NAME);
  assertNotNull(emp);
  Exception caughtException=null;
  try {
    jaxbContext.refreshMetadata();
  }
 catch (  JAXBException e) {
    if (e.getLinkedException() instanceof UnsupportedOperationException) {
      caughtException=e;
    }
  }
  assertNotNull(caughtException);
}
Program: 65784
Project: 65784
Buggy source:
public void testNonRefreshableMetadata() throws Exception {
  ClassLoader classLoader=this.getClass().getClassLoader();
  InputStream metadataStream=classLoader.getResourceAsStream(XML_METADATA);
  Map<String,Object> props=new HashMap<String,Object>(1);
  props.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataStream);
  JAXBContext jc=JAXBContextFactory.createContext(new Class[]{Root.class},props);
  try {
    JAXBHelper.getJAXBContext(jc).refeshMetadata();
  }
 catch (  JAXBException e) {
    assertEquals(JAXBException.COULD_NOT_UNMARSHAL_METADATA,e.getErrorCode());
    return;
  }
  fail();
}

Fixed version (ground truth):
public void testNonRefreshableMetadata() throws Exception {
  ClassLoader classLoader=this.getClass().getClassLoader();
  InputStream metadataStream=classLoader.getResourceAsStream(XML_METADATA);
  Map<String,Object> props=new HashMap<String,Object>(1);
  props.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataStream);
  JAXBContext jc=JAXBContextFactory.createContext(new Class[]{Root.class},props);
  try {
    JAXBHelper.getJAXBContext(jc).refreshMetadata();
  }
 catch (  JAXBException e) {
    assertEquals(JAXBException.COULD_NOT_UNMARSHAL_METADATA,e.getErrorCode());
    return;
  }
  fail();
}
Program: 65786
Project: 65786
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlCompositeCollectionMapping.isReadOnly()) {
    return false;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object collection=xmlCompositeCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    return false;
  }
  Object iterator=cp.iteratorFor(collection);
  if (cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return false;
  }
  Object objectValue;
  while (cp.hasNext(iterator)) {
    objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlCompositeCollectionMapping.isReadOnly()) {
    return false;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object collection=xmlCompositeCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    return false;
  }
  Object iterator=cp.iteratorFor(collection);
  if (cp.hasNext(iterator)) {
    marshalRecord.startCollection();
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
 else {
    return false;
  }
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance(),marshalRecord.includeRootElementForSubsequentItemsInCollection(xPathFragment));
  }
  marshalRecord.endCollection();
  return true;
}
Program: 65789
Project: 65789
Buggy source:
public boolean startElement(MarshalRecord marshalRecord,XPathFragment anXPathFragment,Object object,AbstractSession session,NamespaceResolver namespaceResolver,TreeObjectBuilder compositeObjectBuilder,Object compositeObject){
  if (null == anXPathFragment) {
    return false;
  }
  marshalRecord.openStartElement(anXPathFragment,namespaceResolver);
  boolean hasValue=false;
  marshalRecord.predicateAttribute(anXPathFragment,namespaceResolver);
  if (null != attributeChildren) {
    for (int x=0, size=attributeChildren.size(); x < size; x++) {
      XPathNode attributeNode=attributeChildren.get(x);
      hasValue=attributeNode.marshal(marshalRecord,object,session,namespaceResolver,null,ObjectMarshalContext.getInstance(),null) || hasValue;
    }
  }
  if (anyAttributeNode != null) {
    hasValue=anyAttributeNode.marshal(marshalRecord,object,session,namespaceResolver,null,ObjectMarshalContext.getInstance(),null) || hasValue;
  }
  if (null != compositeObjectBuilder) {
    hasValue=compositeObjectBuilder.marshalAttributes(marshalRecord,compositeObject,session) || hasValue;
  }
  marshalRecord.closeStartElement();
  return hasValue;
}

Fixed version (ground truth):
/** 
 * @since EclipseLink 2.4
 */
public boolean startElement(MarshalRecord marshalRecord,XPathFragment anXPathFragment,Object object,AbstractSession session,NamespaceResolver namespaceResolver,TreeObjectBuilder compositeObjectBuilder,Object compositeObject,boolean includeRoot){
  if (null == anXPathFragment) {
    return false;
  }
  if (includeRoot) {
    marshalRecord.openStartElement(anXPathFragment,namespaceResolver);
  }
  boolean hasValue=false;
  marshalRecord.predicateAttribute(anXPathFragment,namespaceResolver);
  if (null != attributeChildren) {
    for (int x=0, size=attributeChildren.size(); x < size; x++) {
      XPathNode attributeNode=attributeChildren.get(x);
      hasValue=attributeNode.marshal(marshalRecord,object,session,namespaceResolver,null,ObjectMarshalContext.getInstance(),null) || hasValue;
    }
  }
  if (anyAttributeNode != null) {
    hasValue=anyAttributeNode.marshal(marshalRecord,object,session,namespaceResolver,null,ObjectMarshalContext.getInstance(),null) || hasValue;
  }
  if (null != compositeObjectBuilder) {
    hasValue=compositeObjectBuilder.marshalAttributes(marshalRecord,compositeObject,session) || hasValue;
  }
  marshalRecord.closeStartElement();
  return hasValue;
}
Program: 65791
Project: 65791
Buggy source:
/** 
 * Creates and stores primary key expression.
 */
public void createPrimaryKeyExpression(AbstractSession session){
  Expression expression=null;
  Expression builder=new ExpressionBuilder();
  Expression subExp1;
  Expression subExp2;
  Expression subExpression;
  List primaryKeyFields=this.descriptor.getPrimaryKeyFields();
  for (int index=0; index < primaryKeyFields.size(); index++) {
    DatabaseField primaryKeyField=(DatabaseField)primaryKeyFields.get(index);
    subExp1=builder.getField(primaryKeyField);
    subExp2=builder.getParameter(primaryKeyField);
    subExpression=subExp1.equal(subExp2);
    if (expression == null) {
      expression=subExpression;
    }
 else {
      expression=expression.and(subExpression);
    }
  }
  setPrimaryKeyExpression(expression);
}

Fixed version (ground truth):
/** 
 * Creates and stores primary key expression.
 */
public void createPrimaryKeyExpression(AbstractSession session){
  Expression expression=null;
  Expression builder=new ExpressionBuilder();
  Expression subExp1;
  Expression subExp2;
  Expression subExpression;
  List primaryKeyFields=this.descriptor.getPrimaryKeyFields();
  if (null != primaryKeyFields) {
    for (int index=0; index < primaryKeyFields.size(); index++) {
      DatabaseField primaryKeyField=(DatabaseField)primaryKeyFields.get(index);
      subExp1=builder.getField(primaryKeyField);
      subExp2=builder.getParameter(primaryKeyField);
      subExpression=subExp1.equal(subExp2);
      if (expression == null) {
        expression=subExpression;
      }
 else {
        expression=expression.and(subExpression);
      }
    }
  }
  setPrimaryKeyExpression(expression);
}
Program: 65792
Project: 65792
Buggy source:
/** 
 * Return primary key classifications. These are used to ensure a consistent type for the pk values.
 */
public List<Class> getPrimaryKeyClassifications(){
  if (primaryKeyClassifications == null) {
    List primaryKeyFields=this.descriptor.getPrimaryKeyFields();
    List<Class> classifications=new ArrayList(primaryKeyFields.size());
    for (int index=0; index < primaryKeyFields.size(); index++) {
      if (getPrimaryKeyMappings().size() < (index + 1)) {
        classifications.add(null);
      }
 else {
        DatabaseMapping mapping=getPrimaryKeyMappings().get(index);
        DatabaseField field=(DatabaseField)primaryKeyFields.get(index);
        if (mapping != null) {
          classifications.add(Helper.getObjectClass(mapping.getFieldClassification(field)));
        }
 else {
          classifications.add(null);
        }
      }
    }
    primaryKeyClassifications=classifications;
  }
  return primaryKeyClassifications;
}

Fixed version (ground truth):
/** 
 * Return primary key classifications. These are used to ensure a consistent type for the pk values.
 */
public List<Class> getPrimaryKeyClassifications(){
  if (primaryKeyClassifications == null) {
    List primaryKeyFields=this.descriptor.getPrimaryKeyFields();
    if (null == primaryKeyFields) {
      return Collections.emptyList();
    }
    List<Class> classifications=new ArrayList(primaryKeyFields.size());
    for (int index=0; index < primaryKeyFields.size(); index++) {
      if (getPrimaryKeyMappings().size() < (index + 1)) {
        classifications.add(null);
      }
 else {
        DatabaseMapping mapping=getPrimaryKeyMappings().get(index);
        DatabaseField field=(DatabaseField)primaryKeyFields.get(index);
        if (mapping != null) {
          classifications.add(Helper.getObjectClass(mapping.getFieldClassification(field)));
        }
 else {
          classifications.add(null);
        }
      }
    }
    primaryKeyClassifications=classifications;
  }
  return primaryKeyClassifications;
}
Program: 65793
Project: 65793
Buggy source:
/** 
 * Extract primary key values from the specified row. null is returned if the row does not contain the key.
 */
public Object extractPrimaryKeyFromRow(AbstractRecord databaseRow,AbstractSession session){
  List<DatabaseField> primaryKeyFields=this.descriptor.getPrimaryKeyFields();
  List<Class> primaryKeyClassifications=getPrimaryKeyClassifications();
  int size=primaryKeyFields.size();
  Object[] primaryKeyValues=null;
  CacheKeyType cacheKeyType=this.descriptor.getCacheKeyType();
  if (cacheKeyType != CacheKeyType.ID_VALUE) {
    primaryKeyValues=new Object[size];
  }
  int numberOfNulls=0;
  for (int index=0; index < size; index++) {
    DatabaseField field=primaryKeyFields.get(index);
    Class classification=primaryKeyClassifications.get(index);
    Object value=databaseRow.get(field);
    if (value != null) {
      if (value.getClass() != classification) {
        value=session.getPlatform(this.descriptor.getJavaClass()).convertObject(value,classification);
      }
      if (cacheKeyType == CacheKeyType.ID_VALUE) {
        return value;
      }
      primaryKeyValues[index]=value;
    }
 else {
      if (this.mayHaveNullInPrimaryKey) {
        numberOfNulls++;
        if (numberOfNulls < size) {
          primaryKeyValues[index]=null;
        }
 else {
          return null;
        }
      }
 else {
        return null;
      }
    }
  }
  return new CacheId(primaryKeyValues);
}

Fixed version (ground truth):
/** 
 * Extract primary key values from the specified row. null is returned if the row does not contain the key.
 */
public Object extractPrimaryKeyFromRow(AbstractRecord databaseRow,AbstractSession session){
  List<DatabaseField> primaryKeyFields=this.descriptor.getPrimaryKeyFields();
  if (null == primaryKeyFields) {
    return null;
  }
  List<Class> primaryKeyClassifications=getPrimaryKeyClassifications();
  int size=primaryKeyFields.size();
  Object[] primaryKeyValues=null;
  CacheKeyType cacheKeyType=this.descriptor.getCacheKeyType();
  if (cacheKeyType != CacheKeyType.ID_VALUE) {
    primaryKeyValues=new Object[size];
  }
  int numberOfNulls=0;
  for (int index=0; index < size; index++) {
    DatabaseField field=primaryKeyFields.get(index);
    Class classification=primaryKeyClassifications.get(index);
    Object value=databaseRow.get(field);
    if (value != null) {
      if (value.getClass() != classification) {
        value=session.getPlatform(this.descriptor.getJavaClass()).convertObject(value,classification);
      }
      if (cacheKeyType == CacheKeyType.ID_VALUE) {
        return value;
      }
      primaryKeyValues[index]=value;
    }
 else {
      if (this.mayHaveNullInPrimaryKey) {
        numberOfNulls++;
        if (numberOfNulls < size) {
          primaryKeyValues[index]=null;
        }
 else {
          return null;
        }
      }
 else {
        return null;
      }
    }
  }
  return new CacheId(primaryKeyValues);
}
Program: 65794
Project: 65794
Buggy source:
public ObjectBuilder(ClassDescriptor descriptor){
  this.mappingsByField=new HashMap(20);
  this.readOnlyMappingsByField=new HashMap(10);
  this.mappingsByAttribute=new HashMap(20);
  this.fieldsMap=new HashMap(20);
  this.primaryKeyMappings=new ArrayList(5);
  this.nonPrimaryKeyMappings=new ArrayList(10);
  this.cloningMappings=new ArrayList(10);
  this.eagerMappings=new ArrayList(5);
  this.relationshipMappings=new ArrayList(5);
  this.descriptor=descriptor;
}

Fixed version (ground truth):
public ObjectBuilder(ClassDescriptor descriptor){
  this.descriptor=descriptor;
  initialize(descriptor);
}
Program: 65797
Project: 65797
Buggy source:
@Test @ToBeInvestigated public void testPrimitiveBoolean(){
  validateField("String_Node_Str",Boolean.class);
}

Fixed version (ground truth):
@Test @Bugzilla(bugid=348874) public void testPrimitiveBoolean(){
  validateField("String_Node_Str",Boolean.class);
}
Program: 65798
Project: 65798
Buggy source:
@Test @ToBeInvestigated public void testWrapperBoolean(){
  validateField("String_Node_Str",Boolean.class);
}

Fixed version (ground truth):
@Test @Bugzilla(bugid=348874) public void testWrapperBoolean(){
  validateField("String_Node_Str",Boolean.class);
}
Program: 65799
Project: 65799
Buggy source:
public DBWSModelProject(){
  setName("String_Node_Str");
  ns=new NamespaceResolver();
  ns.put("String_Node_Str",W3C_XML_SCHEMA_INSTANCE_NS_URI);
  ns.put("String_Node_Str",W3C_XML_SCHEMA_NS_URI);
  addDescriptor(buildServiceDescriptor());
  addDescriptor(buildAttachmentDescriptor());
  addDescriptor(buildResultDescriptor());
  addDescriptor(buildCollectionResultDescriptor());
  addDescriptor(buildParameterDescriptor());
  addDescriptor(buildSimpleXMLFormatDescriptor());
  addDescriptor(buildNamedQueryDescriptor());
  addDescriptor(buildSqlQueryDescriptor());
  addDescriptor(buildJpqlQueryDescriptor());
  addDescriptor(buildStoredProcedureQueryDescriptor());
  addDescriptor(buildProcedureArgumentDescriptor());
  addDescriptor(buildProcedureOutputArgumentDescriptor());
  addDescriptor(buildStoredFunctionQueryDescriptor());
  addDescriptor(buildQueryDescriptor());
  addDescriptor(buildInsertDescriptor());
  addDescriptor(buildDeleteDescriptor());
  addDescriptor(buildUpdateDescriptor());
  for (Iterator descriptors=getDescriptors().values().iterator(); descriptors.hasNext(); ) {
    XMLDescriptor descriptor=(XMLDescriptor)descriptors.next();
    descriptor.setNamespaceResolver(ns);
  }
}

Fixed version (ground truth):
public DBWSModelProject(){
  setName("String_Node_Str");
  ns=new NamespaceResolver();
  ns.put("String_Node_Str",W3C_XML_SCHEMA_INSTANCE_NS_URI);
  ns.put("String_Node_Str",W3C_XML_SCHEMA_NS_URI);
  addDescriptor(buildServiceDescriptor());
  addDescriptor(buildAttachmentDescriptor());
  addDescriptor(buildResultDescriptor());
  addDescriptor(buildCollectionResultDescriptor());
  addDescriptor(buildParameterDescriptor());
  addDescriptor(buildSimpleXMLFormatDescriptor());
  addDescriptor(buildNamedQueryDescriptor());
  addDescriptor(buildSqlQueryDescriptor());
  addDescriptor(buildJpqlQueryDescriptor());
  addDescriptor(buildStoredProcedureQueryDescriptor());
  addDescriptor(buildProcedureArgumentDescriptor());
  addDescriptor(buildProcedureOutputArgumentDescriptor());
  addDescriptor(buildStoredFunctionQueryDescriptor());
  addDescriptor(buildQueryDescriptor());
  addDescriptor(buildInsertDescriptor());
  addDescriptor(buildDeleteDescriptor());
  addDescriptor(buildUpdateDescriptor());
  addDescriptor(buildBatchQueryDescriptor());
  for (Iterator descriptors=getDescriptors().values().iterator(); descriptors.hasNext(); ) {
    XMLDescriptor descriptor=(XMLDescriptor)descriptors.next();
    descriptor.setNamespaceResolver(ns);
  }
}
Program: 65802
Project: 65802
Buggy source:
public void testExceptionCase(){
  try {
    String invalidURLFile="String_Node_Str";
    InputStream is=getSchemaInputStream(invalidURLFile);
    List types=xsdHelper.define(is,getSchemaLocation());
  }
 catch (  org.eclipse.persistence.exceptions.SDOException ex) {
  }
}

Fixed version (ground truth):
public void testExceptionCase(){
  try {
    String invalidURLFile="String_Node_Str";
    InputStream is=getSchemaInputStream(invalidURLFile);
    List types=xsdHelper.define(is,getSchemaLocation());
  }
 catch (  Exception ex) {
  }
}
Program: 65803
Project: 65803
Buggy source:
/** 
 * Given the source schema and namespace and schemaLocation values from an import or include return the referenced Schema
 * @param sourceXSD The Source object of the source schema
 * @param namespace The namespace portion of the import/include
 * @param schemaLocation The schemaLocation portion of the import/include
 * @return Source for the referenced Schema or null if processing the referenced schema should be skipped
 */
public Source resolveSchema(Source sourceXSD,String namespace,String schemaLocation);

Fixed version (ground truth):
/** 
 * Given the source schema and namespace and schemaLocation values from an import or include return the referenced Schema
 * @param sourceXSD The Source object of the source schema
 * @param namespace The namespace portion of the import/include
 * @param schemaLocation The schemaLocation portion of the import/include
 * @return Source for the referenced Schema or null if processing the referenced schema should be skipped.  If this methodthrows an exception, processing will stop.
 */
public Source resolveSchema(Source sourceXSD,String namespace,String schemaLocation);
Program: 65804
Project: 65804
Buggy source:
/** 
 * INTERNAL: Make this Type an opened Type to allow open content by assigning true value or a Type not to accept any additional properties by assigning false value,  {@link isOpen()}.
 * @param bOpen  boolean value implying if this Type is open
 */
public void setOpen(boolean bOpen){
  if (isDataType() && bOpen) {
    throw SDOException.typeCannotBeOpenAndDataType(getURI(),getName());
  }
  if (open != bOpen) {
    open=bOpen;
    if (open) {
      if (isSubType()) {
        Type baseType=(Type)getBaseTypes().get(0);
        if (!baseType.isOpen()) {
          addOpenMappings();
        }
      }
 else {
        addOpenMappings();
      }
      for (int i=0; i < getSubTypes().size(); i++) {
        SDOType nextSubType=(SDOType)getSubTypes().get(i);
        nextSubType.setOpen(bOpen);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Make this Type an opened Type to allow open content by assigning true value or a Type not to accept any additional properties by assigning false value,  {@link isOpen()}.
 * @param bOpen  boolean value implying if this Type is open
 */
public void setOpen(boolean bOpen){
  if (isDataType() && bOpen) {
    throw SDOException.typeCannotBeOpenAndDataType(getURI(),getName());
  }
  if (open != bOpen) {
    open=bOpen;
    if (open) {
      if (isSubType()) {
        Type baseType=(Type)getBaseTypes().get(0);
        if (!baseType.isOpen()) {
          addOpenMappings();
        }
      }
 else {
        addOpenMappings();
      }
      if (isBaseType()) {
        for (int i=0; i < getSubTypes().size(); i++) {
          SDOType nextSubType=(SDOType)getSubTypes().get(i);
          nextSubType.setOpen(bOpen);
        }
      }
    }
  }
}
Program: 65805
Project: 65805
Buggy source:
public List getInstanceProperties(){
  return new ArrayList(getPropertyValues().keySet());
}

Fixed version (ground truth):
public List getInstanceProperties(){
  if (null == propertyValues) {
    return Collections.EMPTY_LIST;
  }
  return new ArrayList(getPropertyValues().keySet());
}
Program: 65806
Project: 65806
Buggy source:
private void updateIndices(int insertPosition,Property property){
  int declaredSize=getDeclaredProperties().size();
  SDOProperty nextProp=null;
  for (int i=0; i < declaredSize; i++) {
    nextProp=(SDOProperty)getDeclaredProperties().get(i);
    nextProp.setIndexInType(nextProp.getIndexInType() + 1);
  }
  getProperties().add(insertPosition,property);
  int subTypesSize=getSubTypes().size();
  SDOType nextSubType=null;
  for (int i=0; i < subTypesSize; i++) {
    nextSubType=(SDOType)getSubTypes().get(i);
    nextSubType.updateIndices(insertPosition,property);
  }
}

Fixed version (ground truth):
private void updateIndices(int insertPosition,Property property){
  int declaredSize=getDeclaredProperties().size();
  SDOProperty nextProp=null;
  for (int i=0; i < declaredSize; i++) {
    nextProp=(SDOProperty)getDeclaredProperties().get(i);
    nextProp.setIndexInType(nextProp.getIndexInType() + 1);
  }
  getProperties().add(insertPosition,property);
  if (isBaseType()) {
    int subTypesSize=getSubTypes().size();
    SDOType nextSubType=null;
    for (int i=0; i < subTypesSize; i++) {
      nextSubType=(SDOType)getSubTypes().get(i);
      nextSubType.updateIndices(insertPosition,property);
    }
  }
}
Program: 65807
Project: 65807
Buggy source:
private void updateSubtypes(Type baseType){
  getProperties().addAll(0,baseType.getProperties());
  for (int i=0; i < getSubTypes().size(); i++) {
    SDOType nextSubType=(SDOType)getSubTypes().get(i);
    nextSubType.updateSubtypes(baseType);
  }
}

Fixed version (ground truth):
private void updateSubtypes(Type baseType){
  getProperties().addAll(0,baseType.getProperties());
  if (isBaseType()) {
    for (int i=0; i < getSubTypes().size(); i++) {
      SDOType nextSubType=(SDOType)getSubTypes().get(i);
      nextSubType.updateSubtypes(baseType);
    }
  }
}
Program: 65808
Project: 65808
Buggy source:
/** 
 * INTERNAL:
 * @param property
 */
public void addDeclaredProperty(SDOProperty property,int index){
  if (!getDeclaredPropertiesMap().containsKey(property.getName())) {
    int currentSize=getDeclaredProperties().size();
    int allSize=getProperties().size();
    int insertPlace=allSize - currentSize + index;
    for (int i=0; i < getSubTypes().size(); i++) {
      SDOType nextSubType=(SDOType)getSubTypes().get(i);
      nextSubType.updateIndices(insertPlace,property);
    }
    getDeclaredProperties().add(index,property);
    getProperties().add(insertPlace,property);
    property.setContainingType(this);
    getDeclaredPropertiesMap().put(property.getName(),property);
    if (property.hasAliasNames()) {
      for (int j=0; j < property.getAliasNames().size(); j++) {
        getDeclaredPropertiesMap().put(property.getAliasNames().get(j),property);
      }
    }
    if ((property.getType() != null) && (property.getType().isChangeSummaryType())) {
      changeSummaryProperty=property;
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 * @param property
 */
public void addDeclaredProperty(SDOProperty property,int index){
  if (!getDeclaredPropertiesMap().containsKey(property.getName())) {
    int currentSize=getDeclaredProperties().size();
    int allSize=getProperties().size();
    int insertPlace=allSize - currentSize + index;
    if (isBaseType()) {
      for (int i=0; i < getSubTypes().size(); i++) {
        SDOType nextSubType=(SDOType)getSubTypes().get(i);
        nextSubType.updateIndices(insertPlace,property);
      }
    }
    getDeclaredProperties().add(index,property);
    getProperties().add(insertPlace,property);
    property.setContainingType(this);
    getDeclaredPropertiesMap().put(property.getName(),property);
    if (property.hasAliasNames()) {
      for (int j=0; j < property.getAliasNames().size(); j++) {
        getDeclaredPropertiesMap().put(property.getAliasNames().get(j),property);
      }
    }
    if ((property.getType() != null) && (property.getType().isChangeSummaryType())) {
      changeSummaryProperty=property;
    }
  }
}
Program: 65811
Project: 65811
Buggy source:
public Object get(Property property){
  return getPropertyValues().get(property);
}

Fixed version (ground truth):
public Object get(Property property){
  if (null == propertyValues) {
    return null;
  }
  return propertyValues.get(property);
}