nus-yam/ex-repair huggingface dataset:
Program: 66906
Project: 66906
Buggy source:
/** 
 * INTERNAL: Return the canonical name. This will apply the prefix and suffix  qualifiers given to the canonical name. If the given prefix is null, the the default "" is applied. If the given suffix is null, then the default  "_" will be applied.
 */
protected static String getCanonicalName(String name,Map<String,String> properties){
  String prefix=properties.get(CANONICAL_MODEL_PREFIX);
  if (prefix == null) {
    prefix=CANONICAL_MODEL_PREFIX_DEFAULT;
  }
  String suffix=properties.get(CANONICAL_MODEL_SUFFIX);
  if (suffix == null) {
    suffix=CANONICAL_MODEL_SUFFIX_DEFAULT;
  }
  return prefix + name + suffix;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the canonical name. This will apply the prefix and suffix  qualifiers given to the canonical name. If the given prefix is null, the the default "" is applied. If the given suffix is null, then the default  "_" will be applied.
 */
protected static String getCanonicalName(String name,Map<String,String> properties){
  String prefix=properties.get(CANONICAL_MODEL_PREFIX);
  String suffix=properties.get(CANONICAL_MODEL_SUFFIX);
  if (suffix == null) {
    if (prefix == null) {
      suffix=CANONICAL_MODEL_SUFFIX_DEFAULT;
    }
 else {
      suffix="String_Node_Str";
    }
  }
  if (prefix == null) {
    prefix=CANONICAL_MODEL_PREFIX_DEFAULT;
  }
  return prefix + name + suffix;
}
Program: 66907
Project: 66907
Buggy source:
/** 
 * INTERNAL:
 */
protected boolean loadedFromEclipseLinkXML(){
  if (loadedFromXML()) {
    return getLocation().toString().contains(MetadataHelper.ECLIPSELINK_ORM_FILE);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
protected boolean loadedFromEclipseLinkXML(){
  if (loadedFromXML()) {
    return m_entityMappings.isEclipseLinkORMFile();
  }
  return false;
}
Program: 66909
Project: 66909
Buggy source:
/** 
 * Tests setting the metadata Source in the Map to null. Negative test.
 */
public void testInvalidMapParameterTypeNullValue(){
  Map<String,Source> metadataSourceMap=new HashMap<String,Source>();
  metadataSourceMap.put(CONTEXT_PATH,null);
  Map<String,Map<String,Source>> properties=new HashMap<String,Map<String,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  JAXBContext jaxbContext;
  try {
    jaxbContext=(JAXBContext)JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests setting the metadata Source in the Map to null. Negative test.
 */
public void testInvalidMapParameterTypeNullValue(){
  Map<String,Source> metadataSourceMap=new HashMap<String,Source>();
  metadataSourceMap.put(CONTEXT_PATH,null);
  Map<String,Map<String,Source>> properties=new HashMap<String,Map<String,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  try {
    JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}
Program: 66910
Project: 66910
Buggy source:
/** 
 * Tests invalid eclipselink-oxm.xml exception handling. Negative test.
 */
public void testInvalidMetadataFile(){
  String metadataFile=PATH + "String_Node_Str";
  InputStream iStream=loader.getResourceAsStream(metadataFile);
  if (iStream == null) {
    fail("String_Node_Str" + metadataFile + "String_Node_Str");
  }
  HashMap<String,Source> metadataSourceMap=new HashMap<String,Source>();
  metadataSourceMap.put(CONTEXT_PATH,new StreamSource(iStream));
  Map<String,Map<String,Source>> properties=new HashMap<String,Map<String,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  JAXBContext jaxbContext;
  try {
    jaxbContext=(JAXBContext)JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests invalid eclipselink-oxm.xml exception handling. Negative test.
 */
public void testInvalidMetadataFile(){
  String metadataFile=PATH + "String_Node_Str";
  InputStream iStream=loader.getResourceAsStream(metadataFile);
  if (iStream == null) {
    fail("String_Node_Str" + metadataFile + "String_Node_Str");
  }
  HashMap<String,Source> metadataSourceMap=new HashMap<String,Source>();
  metadataSourceMap.put(CONTEXT_PATH,new StreamSource(iStream));
  Map<String,Map<String,Source>> properties=new HashMap<String,Map<String,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  try {
    JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}
Program: 66911
Project: 66911
Buggy source:
/** 
 * Tests an invalid parameter type by setting a Key of type Class as opposed to String. Negative test.
 */
public void testInvalidMapParameterTypeBadKey(){
  Map<Class,Source> metadataSourceMap=new HashMap<Class,Source>();
  metadataSourceMap.put(JAXBContextFactory.class,new StreamSource());
  Map<String,Map<Class,Source>> properties=new HashMap<String,Map<Class,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  JAXBContext jaxbContext;
  try {
    jaxbContext=(JAXBContext)JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests an invalid parameter type by setting a Key of type Class as opposed to String. Negative test.
 */
public void testInvalidMapParameterTypeBadKey(){
  Map<Class,Source> metadataSourceMap=new HashMap<Class,Source>();
  metadataSourceMap.put(JAXBContextFactory.class,new StreamSource());
  Map<String,Map<Class,Source>> properties=new HashMap<String,Map<Class,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  try {
    JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}
Program: 66912
Project: 66912
Buggy source:
/** 
 * Tests associating something other than Map<String, Source> with the key 'eclipselink-oxm-xml' in the properties map. Negative test.
 */
public void testInvalidParameterTypeBadOxmXmlValue(){
  Map<String,List<Integer>> properties=new HashMap<String,List<Integer>>();
  ArrayList<Integer> ints=new ArrayList<Integer>();
  ints.add(new Integer(666));
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,ints);
  JAXBContext jaxbContext;
  try {
    jaxbContext=(JAXBContext)JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests associating something other than Map<String, Source> with the key 'eclipselink-oxm-xml' in the properties map. Negative test.
 */
public void testInvalidParameterTypeBadOxmXmlValue(){
  Map<String,List<Integer>> properties=new HashMap<String,List<Integer>>();
  ArrayList<Integer> ints=new ArrayList<Integer>();
  ints.add(new Integer(666));
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,ints);
  try {
    JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}
Program: 66913
Project: 66913
Buggy source:
/** 
 * Tests declaration of a non-existent class via eclipselink-oxm.xml Negative test.
 */
public void testInvalidClassName(){
  String metadataFile=PATH + "String_Node_Str";
  InputStream iStream=loader.getResourceAsStream(metadataFile);
  if (iStream == null) {
    fail("String_Node_Str" + metadataFile + "String_Node_Str");
  }
  HashMap<String,Source> metadataSourceMap=new HashMap<String,Source>();
  metadataSourceMap.put(CONTEXT_PATH,new StreamSource(iStream));
  Map<String,Map<String,Source>> properties=new HashMap<String,Map<String,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  JAXBContext jaxbContext;
  try {
    jaxbContext=(JAXBContext)JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests declaration of a non-existent class via eclipselink-oxm.xml Negative test.
 */
public void testInvalidClassName(){
  String metadataFile=PATH + "String_Node_Str";
  InputStream iStream=loader.getResourceAsStream(metadataFile);
  if (iStream == null) {
    fail("String_Node_Str" + metadataFile + "String_Node_Str");
  }
  HashMap<String,Source> metadataSourceMap=new HashMap<String,Source>();
  metadataSourceMap.put(CONTEXT_PATH,new StreamSource(iStream));
  Map<String,Map<String,Source>> properties=new HashMap<String,Map<String,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  try {
    JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}
Program: 66914
Project: 66914
Buggy source:
/** 
 * Tests an invalid parameter type by setting a null Key. Negative test.
 */
public void testInvalidMapParameterTypeNullKey(){
  Map<Class,Source> metadataSourceMap=new HashMap<Class,Source>();
  metadataSourceMap.put(null,new StreamSource());
  Map<String,Map<Class,Source>> properties=new HashMap<String,Map<Class,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  JAXBContext jaxbContext;
  try {
    jaxbContext=(JAXBContext)JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests an invalid parameter type by setting a null Key. Negative test.
 */
public void testInvalidMapParameterTypeNullKey(){
  Map<Class,Source> metadataSourceMap=new HashMap<Class,Source>();
  metadataSourceMap.put(null,new StreamSource());
  Map<String,Map<Class,Source>> properties=new HashMap<String,Map<Class,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  try {
    JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}
Program: 66915
Project: 66915
Buggy source:
/** 
 * Tests an invalid parameter type by setting Map<String, Class> instead  of Map<String, Source>. Negative test.
 */
public void testInvalidParameterTypeBadValue(){
  Map<String,Class> metadataSourceMap=new HashMap<String,Class>();
  metadataSourceMap.put(CONTEXT_PATH,this.getClass());
  Map<String,Map<String,Class>> properties=new HashMap<String,Map<String,Class>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  JAXBContext jaxbContext;
  try {
    jaxbContext=(JAXBContext)JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests an invalid parameter type by setting Map<String, Class> instead  of Map<String, Source>. Negative test.
 */
public void testInvalidParameterTypeBadValue(){
  Map<String,Class> metadataSourceMap=new HashMap<String,Class>();
  metadataSourceMap.put(CONTEXT_PATH,this.getClass());
  Map<String,Map<String,Class>> properties=new HashMap<String,Map<String,Class>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  try {
    JAXBContextFactory.createContext(CONTEXT_PATH,loader,properties);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}
Program: 66916
Project: 66916
Buggy source:
/** 
 * Tests a non-customizer class set via Java annotation. Negative test.
 */
public void testNonCustomizerClass(){
  Class<?>[] classes={Employee.class};
  JAXBContext jaxbContext;
  try {
    jaxbContext=(JAXBContext)JAXBContextFactory.createContext(classes,null);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests a non-customizer class set via Java annotation. Negative test.
 */
public void testNonCustomizerClass(){
  Class<?>[] classes={Employee.class};
  try {
    JAXBContextFactory.createContext(classes,null);
  }
 catch (  JAXBException e) {
    return;
  }
catch (  Exception x) {
  }
  fail("String_Node_Str");
}
Program: 66917
Project: 66917
Buggy source:
/** 
 * Test processing an eclipselink-oxm.xml file with no JavaTypes.
 */
public void testBindingsFileWithNoTypes(){
  String contextPath="String_Node_Str";
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  String metadataFile=PATH + "String_Node_Str";
  InputStream iStream=classLoader.getResourceAsStream(metadataFile);
  if (iStream == null) {
    fail("String_Node_Str" + metadataFile + "String_Node_Str");
  }
  HashMap<String,Source> metadataSourceMap=new HashMap<String,Source>();
  metadataSourceMap.put("String_Node_Str",new StreamSource(iStream));
  Map<String,Map<String,Source>> properties=new HashMap<String,Map<String,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  JAXBContext jaxbContext;
  try {
    jaxbContext=(JAXBContext)JAXBContextFactory.createContext(new Class[]{},properties);
    jaxbContext.generateSchema(outputResolver);
  }
 catch (  JAXBException e) {
    e.printStackTrace();
    fail(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Test processing an eclipselink-oxm.xml file with no JavaTypes.
 */
public void testBindingsFileWithNoTypes(){
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  String metadataFile=PATH + "String_Node_Str";
  InputStream iStream=classLoader.getResourceAsStream(metadataFile);
  if (iStream == null) {
    fail("String_Node_Str" + metadataFile + "String_Node_Str");
  }
  HashMap<String,Source> metadataSourceMap=new HashMap<String,Source>();
  metadataSourceMap.put("String_Node_Str",new StreamSource(iStream));
  Map<String,Map<String,Source>> properties=new HashMap<String,Map<String,Source>>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
  JAXBContext jaxbContext;
  try {
    jaxbContext=(JAXBContext)JAXBContextFactory.createContext(new Class[]{},properties);
    jaxbContext.generateSchema(outputResolver);
  }
 catch (  JAXBException e) {
    e.printStackTrace();
    fail(e.getMessage());
  }
}
Program: 66918
Project: 66918
Buggy source:
/** 
 * Tests the @XmlAccessorType set in package-info.java.  No overrides will  be performed. Positive test.
 */
public void testPkgXmlAccessorOrderNoOverride(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessortype.packagelevel.nooverride.Employee.class},1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,EMPTY_NAMESPACE,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}

Fixed version (ground truth):
/** 
 * Tests the @XmlAccessorType set in package-info.java.  No overrides will  be performed. Positive test.
 */
public void testPkgXmlAccessorOrderNoOverride(){
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessortype.packagelevel.nooverride.Employee.class},1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,EMPTY_NAMESPACE,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}
Program: 66919
Project: 66919
Buggy source:
/** 
 * Tests the @XmlAccessorType set in package-info.java.  No overrides will  be performed. Negative test.
 */
public void testPkgXmlAccessorOrderNoOverrideFail(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessortype.packagelevel.nooverride.Employee.class},1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,null,outputResolver);
  assertTrue("String_Node_Str",result != null);
}

Fixed version (ground truth):
/** 
 * Tests the @XmlAccessorType set in package-info.java.  No overrides will  be performed. Negative test.
 */
public void testPkgXmlAccessorOrderNoOverrideFail(){
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessortype.packagelevel.nooverride.Employee.class},1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,null,outputResolver);
  assertTrue("String_Node_Str",result != null);
}
Program: 66920
Project: 66920
Buggy source:
protected void verifyAfterLoad(XMLDocument doc){
  super.verifyAfterLoad(doc);
  Object value=doc.getRootObject().get(ID_NAME);
  boolean isSet=doc.getRootObject().isSet(ID_NAME);
  assertEquals(0,value);
  assertNotNull(value);
  assertFalse(isSet);
  value=doc.getRootObject().get(FIRSTNAME_NAME);
  isSet=doc.getRootObject().isSet(FIRSTNAME_NAME);
  assertNull(value);
  assertFalse(isSet);
}

Fixed version (ground truth):
protected void verifyAfterLoad(XMLDocument doc){
  super.verifyAfterLoad(doc);
  Object value=doc.getRootObject().get(ID_NAME);
  boolean isSet=doc.getRootObject().isSet(ID_NAME);
  assertEquals(null,value);
  assertNull(value);
  assertFalse(isSet);
  value=doc.getRootObject().get(FIRSTNAME_NAME);
  isSet=doc.getRootObject().isSet(FIRSTNAME_NAME);
  assertNull(value);
  assertFalse(isSet);
}
Program: 66921
Project: 66921
Buggy source:
/** 
 * INTERNAL:
 */
public void setNullable(boolean nullable){
  this.nullable=nullable;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void setNullable(boolean nullable){
  this.nullable=nullable;
  if (nullable && getType() != null) {
    updateType();
  }
}
Program: 66922
Project: 66922
Buggy source:
/** 
 * INTERNAL: Assign a Type to this Property.
 * @param type   the type of this property.
 */
public void setType(Type type){
  this.type=(SDOType)type;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Assign a Type to this Property.
 * @param type   the type of this property.
 */
public void setType(Type type){
  this.type=(SDOType)type;
  if (isNullable()) {
    updateType();
  }
}
Program: 66924
Project: 66924
Buggy source:
/** 
 * INTERNAL: Create an instance of the composite primary key class for the key object.
 */
public Object createPrimaryKeyInstance(Object key,AbstractSession session){
  KeyElementAccessor[] pkElementArray=this.getKeyClassFields(getPKClass());
  ObjectBuilder builder=getDescriptor().getObjectBuilder();
  if (pkElementArray.length == 1 && pkElementArray[0] instanceof KeyIsElementAccessor) {
    DatabaseMapping mapping=builder.getMappingForAttributeName(pkElementArray[0].getAttributeName());
    return mapping.getRealAttributeValueFromObject(key,session);
  }
  Object keyInstance=getPKClassInstance();
  for (int index=0; index < pkElementArray.length; index++) {
    KeyElementAccessor accessor=pkElementArray[index];
    DatabaseMapping mapping=builder.getMappingForAttributeName(accessor.getAttributeName());
    while (mapping.isAggregateObjectMapping()) {
      mapping=mapping.getReferenceDescriptor().getObjectBuilder().getMappingForAttributeName(pkElementArray[index].getAttributeName());
      if (mapping == null) {
        mapping=builder.getMappingForField(accessor.getDatabaseField());
      }
    }
    Object fieldValue=mapping.getRealAttributeValueFromObject(key,session);
    accessor.setValue(keyInstance,fieldValue);
  }
  return keyInstance;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Create an instance of the composite primary key class for the key object.
 */
public Object createPrimaryKeyInstance(Object key,AbstractSession session){
  KeyElementAccessor[] pkElementArray=this.getKeyClassFields(getPKClass());
  ObjectBuilder builder=getDescriptor().getObjectBuilder();
  if (pkElementArray.length == 1 && pkElementArray[0] instanceof KeyIsElementAccessor) {
    DatabaseMapping mapping=builder.getMappingForAttributeName(pkElementArray[0].getAttributeName());
    return mapping.getRealAttributeValueFromObject(key,session);
  }
  Object keyInstance=getPKClassInstance();
  for (int index=0; index < pkElementArray.length; index++) {
    Object keyObj=key;
    KeyElementAccessor accessor=pkElementArray[index];
    DatabaseField field=accessor.getDatabaseField();
    DatabaseMapping mapping=builder.getMappingForField(field);
    while (mapping.isAggregateObjectMapping()) {
      keyObj=mapping.getRealAttributeValueFromObject(keyObj,session);
      mapping=mapping.getReferenceDescriptor().getObjectBuilder().getMappingForField(accessor.getDatabaseField());
    }
    Object fieldValue=mapping.getRealAttributeValueFromObject(keyObj,session);
    accessor.setValue(keyInstance,fieldValue);
  }
  return keyInstance;
}
Program: 66926
Project: 66926
Buggy source:
/** 
 * INTERNAL: returns true if users have designated one or more mappings as IDs.  Used for CMP3Policy  primary key class processing. 
 */
public boolean hasDerivedId(){
  return this.hasDerivedId;
}

Fixed version (ground truth):
/** 
 * INTERNAL: returns true if users have designated one or more mappings as IDs. Used  for CMP3Policy primary key class processing. 
 */
public boolean hasDerivedId(){
  return !derivesIdMappings.isEmpty();
}
Program: 66927
Project: 66927
Buggy source:
/** 
 * PUBLIC: Return a new descriptor.
 */
public ClassDescriptor(){
  this.tables=NonSynchronizedVector.newInstance(3);
  this.mappings=NonSynchronizedVector.newInstance();
  this.primaryKeyFields=new ArrayList(2);
  this.fields=NonSynchronizedVector.newInstance();
  this.allFields=NonSynchronizedVector.newInstance();
  this.constraintDependencies=NonSynchronizedVector.newInstance(2);
  this.multipleTableForeignKeys=new HashMap(5);
  this.queryKeys=new HashMap(5);
  this.initializationStage=UNINITIALIZED;
  this.interfaceInitializationStage=UNINITIALIZED;
  this.shouldAlwaysRefreshCache=false;
  this.shouldOnlyRefreshCacheIfNewerVersion=false;
  this.shouldDisableCacheHits=false;
  this.identityMapSize=-1;
  this.remoteIdentityMapSize=-1;
  this.remoteIdentityMapClass=null;
  this.descriptorType=NORMAL;
  this.shouldAlwaysRefreshCacheOnRemote=false;
  this.shouldDisableCacheHitsOnRemote=false;
  this.shouldOrderMappings=true;
  this.shouldBeReadOnly=false;
  this.shouldAlwaysConformResultsInUnitOfWork=false;
  this.shouldAcquireCascadedLocks=false;
  this.hasSimplePrimaryKey=false;
  this.hasDerivedId=false;
  this.objectBuilder=new ObjectBuilder(this);
  this.cascadeLockingPolicies=NonSynchronizedVector.newInstance();
}

Fixed version (ground truth):
/** 
 * PUBLIC: Return a new descriptor.
 */
public ClassDescriptor(){
  this.tables=NonSynchronizedVector.newInstance(3);
  this.mappings=NonSynchronizedVector.newInstance();
  this.primaryKeyFields=new ArrayList(2);
  this.fields=NonSynchronizedVector.newInstance();
  this.allFields=NonSynchronizedVector.newInstance();
  this.constraintDependencies=NonSynchronizedVector.newInstance(2);
  this.multipleTableForeignKeys=new HashMap(5);
  this.queryKeys=new HashMap(5);
  this.initializationStage=UNINITIALIZED;
  this.interfaceInitializationStage=UNINITIALIZED;
  this.shouldAlwaysRefreshCache=false;
  this.shouldOnlyRefreshCacheIfNewerVersion=false;
  this.shouldDisableCacheHits=false;
  this.identityMapSize=-1;
  this.remoteIdentityMapSize=-1;
  this.remoteIdentityMapClass=null;
  this.descriptorType=NORMAL;
  this.shouldAlwaysRefreshCacheOnRemote=false;
  this.shouldDisableCacheHitsOnRemote=false;
  this.shouldOrderMappings=true;
  this.shouldBeReadOnly=false;
  this.shouldAlwaysConformResultsInUnitOfWork=false;
  this.shouldAcquireCascadedLocks=false;
  this.hasSimplePrimaryKey=false;
  this.derivesIdMappings=new HashMap(5);
  this.objectBuilder=new ObjectBuilder(this);
  this.cascadeLockingPolicies=NonSynchronizedVector.newInstance();
}
Program: 66929
Project: 66929
Buggy source:
/** 
 * INTERNAL: Register the new object with the unit of work. This will register the new object without cloning. Checks based on existence will be completed and the create will be cascaded based on the object's mappings cascade requirements.  This is specific to EJB 3.0 support.
 * @see #registerObject(Object)
 */
public void registerNewObjectForPersist(Object newObject,Map visitedObjects){
  if (newObject == null) {
    return;
  }
  if (visitedObjects.containsKey(newObject)) {
    return;
  }
  visitedObjects.put(newObject,newObject);
  ClassDescriptor descriptor=getDescriptor(newObject);
  if ((descriptor == null) || descriptor.isDescriptorTypeAggregate()) {
    throw new IllegalArgumentException(ExceptionLocalization.buildMessage("String_Node_Str",new Object[]{newObject}));
  }
  startOperationProfile(SessionProfiler.Register);
  try {
    Object registeredObject=checkIfAlreadyRegistered(newObject,descriptor);
    if (registeredObject == null) {
      registerNotRegisteredNewObjectForPersist(newObject,descriptor);
    }
 else     if (this.isObjectDeleted(newObject)) {
      this.undeleteObject(newObject);
    }
    descriptor.getObjectBuilder().cascadeRegisterNewForCreate(newObject,this,visitedObjects);
  }
  finally {
    endOperationProfile(SessionProfiler.Register);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Register the new object with the unit of work. This will register the new object without cloning. Checks based on existence will be completed and the create will be cascaded based on the object's mappings cascade requirements.  This is specific to EJB 3.0 support.
 * @see #registerObject(Object)
 */
public void registerNewObjectForPersist(Object newObject,Map visitedObjects){
  if (newObject == null) {
    return;
  }
  if (visitedObjects.containsKey(newObject)) {
    return;
  }
  visitedObjects.put(newObject,newObject);
  ClassDescriptor descriptor=getDescriptor(newObject);
  if ((descriptor == null) || descriptor.isDescriptorTypeAggregate()) {
    throw new IllegalArgumentException(ExceptionLocalization.buildMessage("String_Node_Str",new Object[]{newObject}));
  }
  startOperationProfile(SessionProfiler.Register);
  try {
    Object registeredObject=checkIfAlreadyRegistered(newObject,descriptor);
    if (registeredObject == null) {
      registerNotRegisteredNewObjectForPersist(newObject,descriptor);
    }
 else     if (this.isObjectDeleted(newObject)) {
      this.undeleteObject(newObject);
    }
    descriptor.getObjectBuilder().cascadeRegisterNewForCreate(newObject,this,visitedObjects);
    updateDerivedIds(newObject,descriptor);
  }
  finally {
    endOperationProfile(SessionProfiler.Register);
  }
}
Program: 66930
Project: 66930
Buggy source:
/** 
 * Create the node path specified by <code>xpathString</code> under <code>element</code> and initialize the leaf node with <code>value</code>. This method also supports creating attributes and integer-indexed elements using the appropriate XPath syntax ('<code>@</code>' and '<code>[ ]</code>' respectively).
 * @param xmlField XMLField containing xpath expression representing the node path to create
 * @param element Root element under which to create path
 * @param value Initial value for the leaf node (should not be a list)
 * @return The last <code>XMLNode</code> in the path
 * @exception org.eclipse.persistence.oxm.exceptions.XMLMarshalException Thrown if passed an invalid XPath string
 */
public Node create(XMLField xmlField,Node element,Object value,XMLField lastUpdated,DocumentPreservationPolicy docPresPolicy,AbstractSession session) throws XMLMarshalException {
  if (null == value) {
    return null;
  }
  if (docPresPolicy == null) {
    docPresPolicy=this.noDocPresPolicy;
  }
  XPathFragment fragment=xmlField.getXPathFragment();
  if (fragment.getNextFragment() == null) {
    if (fragment.nameIsText()) {
      Object textValue=getValueToWrite(value,xmlField,session);
      if (textValue instanceof String) {
        if (xmlField.isTypedTextField()) {
          XMLNodeList createdElements=new XMLNodeList();
          createdElements.add(element);
          addTypeAttributes(createdElements,xmlField,value,resolveNamespacePrefixForURI(XMLConstants.SCHEMA_INSTANCE_URL,getNamespaceResolverForField(xmlField)));
        }
        return addText(xmlField,element,(String)textValue);
      }
      return null;
    }
  }
  NodeList created=createCollection(xmlField,element,value,lastUpdated,docPresPolicy,session);
  if ((created == null) || (created.getLength() == 0)) {
    return null;
  }
  return created.item(0);
}

Fixed version (ground truth):
public void create(List<XMLField> xmlFields,Node contextNode,List<XMLEntry> values,XMLField lastUpdatedField,DocumentPreservationPolicy docPresPolicy,AbstractSession session){
  List itemsToWrite=new ArrayList();
  for (int i=0, size=values.size(); i < size; i++) {
    XMLEntry nextEntry=values.get(i);
    itemsToWrite.add(nextEntry.getValue());
    if (i == (values.size() - 1) || values.get(i + 1).getXMLField() != nextEntry.getXMLField()) {
      create(nextEntry.getXMLField(),contextNode,itemsToWrite,lastUpdatedField,docPresPolicy,session);
      itemsToWrite=new ArrayList();
      lastUpdatedField=nextEntry.getXMLField();
    }
  }
}
Program: 66932
Project: 66932
Buggy source:
private void buildFragments(String xpathString){
  StringTokenizer st=new StringTokenizer(xpathString,"String_Node_Str");
  String next;
  int i=0;
  XPathFragment currentXPathFragment=null;
  XPathFragment nextXPathFragment=null;
  if (xpathString.charAt(0) == '/') {
    next=st.nextToken();
    next='/' + next;
    currentXPathFragment=new XPathFragment(next);
    setXPathFragment(currentXPathFragment);
    i++;
  }
  while (st.hasMoreTokens()) {
    next=st.nextToken().intern();
    if (null != next) {
      if (next.equals(XMLConstants.TEXT)) {
        nextXPathFragment=new XPathFragment(XMLConstants.TEXT);
      }
 else {
        nextXPathFragment=new XPathFragment(next);
      }
      if (0 == i) {
        setXPathFragment(nextXPathFragment);
      }
 else {
        currentXPathFragment.setNextFragment(nextXPathFragment);
        if (nextXPathFragment.isAttribute() || nextXPathFragment.nameIsText()) {
          currentXPathFragment.setHasText(true);
        }
      }
      currentXPathFragment=nextXPathFragment;
      i++;
    }
    setLastXPathFragment(currentXPathFragment);
  }
}

Fixed version (ground truth):
private void buildFragments(String xpathString){
  StringTokenizer st=new StringTokenizer(xpathString,"String_Node_Str");
  String next;
  int i=0;
  XPathFragment currentXPathFragment=null;
  XPathFragment nextXPathFragment=null;
  if (xpathString.charAt(0) == '/') {
    next=st.nextToken();
    next='/' + next;
    currentXPathFragment=new XPathFragment(next);
    setXPathFragment(currentXPathFragment);
    currentXPathFragment.setXMLField(this);
    i++;
  }
  while (st.hasMoreTokens()) {
    next=st.nextToken().intern();
    if (null != next) {
      if (next.equals(XMLConstants.TEXT)) {
        nextXPathFragment=new XPathFragment(XMLConstants.TEXT);
      }
 else {
        nextXPathFragment=new XPathFragment(next);
      }
      if (0 == i) {
        setXPathFragment(nextXPathFragment);
      }
 else {
        currentXPathFragment.setNextFragment(nextXPathFragment);
        if (nextXPathFragment.isAttribute() || nextXPathFragment.nameIsText()) {
          currentXPathFragment.setHasText(true);
        }
      }
      nextXPathFragment.setXMLField(this);
      currentXPathFragment=nextXPathFragment;
      i++;
    }
    setLastXPathFragment(currentXPathFragment);
  }
}
Program: 66935
Project: 66935
Buggy source:
public void copyTo(ExpressionOperator operator){
  operator.selector=selector;
  operator.isPrefix=isPrefix;
  operator.isRepeating=isRepeating;
  operator.nodeClass=nodeClass;
  operator.type=type;
  operator.databaseStrings=databaseStrings == null ? null : Arrays.copyOf(databaseStrings,databaseStrings.length);
  operator.argumentIndices=argumentIndices == null ? null : Arrays.copyOf(argumentIndices,argumentIndices.length);
  operator.javaStrings=javaStrings == null ? null : Arrays.copyOf(javaStrings,javaStrings.length);
}

Fixed version (ground truth):
public void copyTo(ExpressionOperator operator){
  operator.selector=selector;
  operator.isPrefix=isPrefix;
  operator.isRepeating=isRepeating;
  operator.nodeClass=nodeClass;
  operator.type=type;
  operator.databaseStrings=databaseStrings == null ? null : Helper.copyStringArray(databaseStrings);
  operator.argumentIndices=argumentIndices == null ? null : Helper.copyIntArray(argumentIndices);
  operator.javaStrings=javaStrings == null ? null : Helper.copyStringArray(javaStrings);
}
Program: 66936
Project: 66936
Buggy source:
public void copyTo(ExpressionOperator operator){
  super.copyTo(operator);
  if (operator instanceof ListExpressionOperator) {
    ((ListExpressionOperator)operator).startStrings=Arrays.copyOf(startStrings,startStrings.length);
    ((ListExpressionOperator)operator).separators=Arrays.copyOf(separators,separators.length);
    ((ListExpressionOperator)operator).terminationStrings=Arrays.copyOf(terminationStrings,terminationStrings.length);
  }
}

Fixed version (ground truth):
public void copyTo(ExpressionOperator operator){
  super.copyTo(operator);
  if (operator instanceof ListExpressionOperator) {
    ((ListExpressionOperator)operator).startStrings=Helper.copyStringArray(startStrings);
    ((ListExpressionOperator)operator).separators=Helper.copyStringArray(separators);
    ((ListExpressionOperator)operator).terminationStrings=Helper.copyStringArray(terminationStrings);
  }
}
Program: 66937
Project: 66937
Buggy source:
@OneToMany(targetEntity=Becks.class,mappedBy="String_Node_Str",cascade=ALL) @MapKeyClass(BecksTag.class) @MapKeyJoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str") public Map getBecksBeersToConsume(){
  return becksBeersToConsume;
}

Fixed version (ground truth):
@OneToMany(targetEntity=Becks.class,mappedBy="String_Node_Str",cascade=ALL,orphanRemoval=true) @MapKeyClass(BecksTag.class) @MapKeyJoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str") public Map getBecksBeersToConsume(){
  return becksBeersToConsume;
}
Program: 66938
Project: 66938
Buggy source:
public void testFindWithProperties(){
  if (!isJPA10()) {
    Employee employee=new Employee();
    employee.setFirstName("String_Node_Str");
    HashMap<String,Object> queryhints=new HashMap<String,Object>();
    EntityManager em=createEntityManager();
    try {
      beginTransaction(em);
      em.persist(employee);
      commitTransaction(em);
      beginTransaction(em);
      int empId=employee.getId();
      Employee e1=em.find(Employee.class,empId);
      e1.setFirstName("String_Node_Str");
      queryhints.put(QueryHints.REFRESH,"String_Node_Str");
      Employee e2=em.find(Employee.class,empId,queryhints);
      assertFalse(e2.getFirstName().equals("String_Node_Str"));
      commitTransaction(em);
    }
 catch (    IllegalArgumentException iae) {
      return;
    }
catch (    Exception e) {
      fail("String_Node_Str" + e.getClass());
    }
 finally {
      closeEntityManager(em);
    }
  }
}

Fixed version (ground truth):
public void testFindWithProperties(){
  if (!isJPA10()) {
    Employee employee=new Employee();
    employee.setFirstName("String_Node_Str");
    HashMap<String,Object> queryhints=new HashMap<String,Object>();
    EntityManager em=createEntityManager();
    try {
      beginTransaction(em);
      em.persist(employee);
      commitTransaction(em);
      beginTransaction(em);
      int empId=employee.getId();
      Employee e1=em.find(Employee.class,empId);
      e1.setFirstName("String_Node_Str");
      queryhints.put(QueryHints.REFRESH,"String_Node_Str");
      Employee e2=(Employee)em.find(Employee.class,empId,queryhints);
      assertFalse(e2.getFirstName().equals("String_Node_Str"));
      commitTransaction(em);
    }
 catch (    IllegalArgumentException iae) {
      return;
    }
catch (    Exception e) {
      fail("String_Node_Str" + e.getClass());
    }
 finally {
      closeEntityManager(em);
    }
  }
}
Program: 66939
Project: 66939
Buggy source:
public void testIsLoadedWithReference(){
  EntityManagerFactory emf=getEntityManagerFactory();
  EntityManager em=emf.createEntityManager();
  beginTransaction(em);
  try {
    Employee emp=new Employee();
    emp.setFirstName("String_Node_Str");
    emp.setLastName("String_Node_Str");
    Address addr=new Address();
    addr.setCity("String_Node_Str");
    emp.setAddress(addr);
    PhoneNumber pn=new PhoneNumber();
    pn.setNumber("String_Node_Str");
    pn.setType("String_Node_Str");
    emp.addPhoneNumber(pn);
    pn.setOwner(emp);
    Employee manager=new Employee();
    manager.addManagedEmployee(emp);
    emp.setManager(manager);
    em.persist(emp);
    em.flush();
    Integer id=emp.getId();
    em.clear();
    clearCache();
    emp=em.find(Employee.class,emp.getId());
    emp.getAddress().getCity();
    emp.getPhoneNumbers().size();
    ProviderUtil util=(new PersistenceProvider()).getProviderUtil();
    assertTrue("String_Node_Str",util.isLoadedWithReference(emp,"String_Node_Str").equals(LoadState.LOADED));
    assertTrue("String_Node_Str",util.isLoadedWithReference(emp,"String_Node_Str").equals(LoadState.LOADED));
    assertTrue("String_Node_Str",util.isLoadedWithReference(emp,"String_Node_Str").equals(LoadState.NOT_LOADED));
    assertTrue("String_Node_Str",util.isLoadedWithReference(emp,"String_Node_Str").equals(LoadState.NOT_LOADED));
  }
  finally {
    rollbackTransaction(em);
  }
}

Fixed version (ground truth):
public void testIsLoadedWithReference(){
  EntityManagerFactory emf=getEntityManagerFactory();
  EntityManager em=emf.createEntityManager();
  beginTransaction(em);
  try {
    Employee emp=new Employee();
    emp.setFirstName("String_Node_Str");
    emp.setLastName("String_Node_Str");
    Address addr=new Address();
    addr.setCity("String_Node_Str");
    emp.setAddress(addr);
    PhoneNumber pn=new PhoneNumber();
    pn.setNumber("String_Node_Str");
    pn.setType("String_Node_Str");
    emp.addPhoneNumber(pn);
    pn.setOwner(emp);
    Employee manager=new Employee();
    manager.addManagedEmployee(emp);
    emp.setManager(manager);
    em.persist(emp);
    em.flush();
    Integer id=emp.getId();
    em.clear();
    clearCache();
    emp=em.find(Employee.class,emp.getId());
    emp.getAddress().getCity();
    emp.getPhoneNumbers().size();
    ProviderUtil util=(new PersistenceProvider()).getProviderUtil();
    assertTrue("String_Node_Str",util.isLoadedWithReference(emp,"String_Node_Str").equals(LoadState.LOADED));
    assertTrue("String_Node_Str",util.isLoadedWithReference(emp,"String_Node_Str").equals(LoadState.LOADED));
    if (emp instanceof PersistenceWeaved) {
      assertTrue("String_Node_Str",util.isLoadedWithReference(emp,"String_Node_Str").equals(LoadState.NOT_LOADED));
    }
 else {
      assertTrue("String_Node_Str",util.isLoadedWithReference(emp,"String_Node_Str").equals(LoadState.LOADED));
    }
    assertTrue("String_Node_Str",util.isLoadedWithReference(emp,"String_Node_Str").equals(LoadState.NOT_LOADED));
  }
  finally {
    rollbackTransaction(em);
  }
}
Program: 66942
Project: 66942
Buggy source:
public void testIsLoadedAttribute(){
  if (!isJPA10()) {
    EntityManagerFactory emf=getEntityManagerFactory();
    EntityManager em=emf.createEntityManager();
    beginTransaction(em);
    try {
      Employee emp=new Employee();
      emp.setFirstName("String_Node_Str");
      emp.setLastName("String_Node_Str");
      Address addr=new Address();
      addr.setCity("String_Node_Str");
      emp.setAddress(addr);
      PhoneNumber pn=new PhoneNumber();
      pn.setNumber("String_Node_Str");
      pn.setType("String_Node_Str");
      emp.addPhoneNumber(pn);
      pn.setOwner(emp);
      SmallProject project=new SmallProject();
      project.setName("String_Node_Str");
      project.addTeamMember(emp);
      emp.addProject(project);
      em.persist(emp);
      em.flush();
      em.clear();
      clearCache();
      emp=(Employee)em.find(Employee.class,emp.getId());
      PersistenceUnitUtil util=emf.getPersistenceUnitUtil();
      assertFalse("String_Node_Str",util.isLoaded(emp,"String_Node_Str"));
      assertFalse("String_Node_Str",util.isLoaded(emp,"String_Node_Str"));
      emp.getPhoneNumbers().size();
      assertTrue("String_Node_Str",util.isLoaded(emp,"String_Node_Str"));
      assertTrue("String_Node_Str",util.isLoaded(emp,"String_Node_Str"));
    }
  finally {
      rollbackTransaction(em);
    }
  }
}

Fixed version (ground truth):
public void testIsLoadedAttribute(){
  if (!isJPA10()) {
    EntityManagerFactory emf=getEntityManagerFactory();
    EntityManager em=emf.createEntityManager();
    beginTransaction(em);
    try {
      Employee emp=new Employee();
      emp.setFirstName("String_Node_Str");
      emp.setLastName("String_Node_Str");
      Address addr=new Address();
      addr.setCity("String_Node_Str");
      emp.setAddress(addr);
      PhoneNumber pn=new PhoneNumber();
      pn.setNumber("String_Node_Str");
      pn.setType("String_Node_Str");
      emp.addPhoneNumber(pn);
      pn.setOwner(emp);
      SmallProject project=new SmallProject();
      project.setName("String_Node_Str");
      project.addTeamMember(emp);
      emp.addProject(project);
      em.persist(emp);
      em.flush();
      em.clear();
      clearCache();
      emp=(Employee)em.find(Employee.class,emp.getId());
      PersistenceUnitUtil util=emf.getPersistenceUnitUtil();
      if (emp instanceof PersistenceWeaved) {
        assertFalse("String_Node_Str",util.isLoaded(emp,"String_Node_Str"));
      }
 else {
        assertTrue("String_Node_Str",util.isLoaded(emp,"String_Node_Str"));
      }
      assertFalse("String_Node_Str",util.isLoaded(emp,"String_Node_Str"));
      emp.getPhoneNumbers().size();
      assertTrue("String_Node_Str",util.isLoaded(emp,"String_Node_Str"));
      assertTrue("String_Node_Str",util.isLoaded(emp,"String_Node_Str"));
    }
  finally {
      rollbackTransaction(em);
    }
  }
}
Program: 66945
Project: 66945
Buggy source:
public void testIsLoadedWithoutReference(){
  EntityManagerFactory emf=getEntityManagerFactory();
  EntityManager em=emf.createEntityManager();
  beginTransaction(em);
  try {
    Employee emp=new Employee();
    emp.setFirstName("String_Node_Str");
    emp.setLastName("String_Node_Str");
    Address addr=new Address();
    addr.setCity("String_Node_Str");
    emp.setAddress(addr);
    PhoneNumber pn=new PhoneNumber();
    pn.setNumber("String_Node_Str");
    pn.setType("String_Node_Str");
    emp.addPhoneNumber(pn);
    pn.setOwner(emp);
    Employee manager=new Employee();
    manager.addManagedEmployee(emp);
    emp.setManager(manager);
    em.persist(emp);
    em.flush();
    Integer id=emp.getId();
    em.clear();
    clearCache();
    ProviderUtil util=(new PersistenceProvider()).getProviderUtil();
    assertTrue("String_Node_Str",util.isLoaded(emp).equals(LoadState.LOADED));
    emp=em.getReference(Employee.class,emp.getId());
    assertTrue("String_Node_Str",util.isLoaded(emp).equals(LoadState.NOT_LOADED));
    assertTrue("String_Node_Str",util.isLoaded(new NonEntity()).equals(LoadState.UNKNOWN));
  }
  finally {
    rollbackTransaction(em);
  }
}

Fixed version (ground truth):
public void testIsLoadedWithoutReference(){
  EntityManagerFactory emf=getEntityManagerFactory();
  EntityManager em=emf.createEntityManager();
  beginTransaction(em);
  try {
    Employee emp=new Employee();
    emp.setFirstName("String_Node_Str");
    emp.setLastName("String_Node_Str");
    Address addr=new Address();
    addr.setCity("String_Node_Str");
    emp.setAddress(addr);
    PhoneNumber pn=new PhoneNumber();
    pn.setNumber("String_Node_Str");
    pn.setType("String_Node_Str");
    emp.addPhoneNumber(pn);
    pn.setOwner(emp);
    Employee manager=new Employee();
    manager.addManagedEmployee(emp);
    emp.setManager(manager);
    em.persist(emp);
    em.flush();
    Integer id=emp.getId();
    em.clear();
    clearCache();
    ProviderUtil util=(new PersistenceProvider()).getProviderUtil();
    if (emp instanceof PersistenceWeaved) {
      assertTrue("String_Node_Str",util.isLoaded(emp).equals(LoadState.LOADED));
      emp=em.getReference(Employee.class,emp.getId());
      assertTrue("String_Node_Str",util.isLoaded(emp).equals(LoadState.NOT_LOADED));
    }
 else {
      assertTrue("String_Node_Str",util.isLoaded(emp).equals(LoadState.UNKNOWN));
      emp=em.getReference(Employee.class,emp.getId());
      assertTrue("String_Node_Str",util.isLoaded(emp).equals(LoadState.UNKNOWN));
    }
    assertTrue("String_Node_Str",util.isLoaded(new NonEntity()).equals(LoadState.UNKNOWN));
  }
  finally {
    rollbackTransaction(em);
  }
}
Program: 66946
Project: 66946
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  suite.addTest(new InheritedModelJunitTest("String_Node_Str"));
  return suite;
}