nus-yam/ex-repair huggingface dataset:
Program: 98035
Project: 98035
Buggy source:
public final void jdoZooMarkDirty(){
  context.notifyEvent(this,ZooInstanceEvent.PRE_DIRTY);
switch (status) {
case PERSISTENT_CLEAN:
    setPersDirty();
  getPrevValues();
break;
case PERSISTENT_NEW:
break;
case PERSISTENT_DIRTY:
break;
case HOLLOW_PERSISTENT_NONTRANSACTIONAL:
if (getClass() == GenericObject.class) {
((GenericObject)this).activateRead();
}
 else {
zooActivateRead();
}
jdoZooMarkDirty();
break;
default :
throw new IllegalStateException("String_Node_Str" + status + "String_Node_Str"+ Util.oidToString(jdoZooOid));
}
context.notifyEvent(this,ZooInstanceEvent.POST_DIRTY);
}

Fixed version (ground truth):
public final void jdoZooMarkDirty(){
switch (status) {
case PERSISTENT_NEW:
case PERSISTENT_DIRTY:
    return;
case PERSISTENT_CLEAN:
  context.notifyEvent(this,ZooInstanceEvent.PRE_DIRTY);
setPersDirty();
getPrevValues();
break;
case HOLLOW_PERSISTENT_NONTRANSACTIONAL:
context.notifyEvent(this,ZooInstanceEvent.PRE_DIRTY);
if (getClass() == GenericObject.class) {
((GenericObject)this).activateRead();
}
 else {
zooActivateRead();
}
jdoZooMarkDirty();
break;
default :
throw new IllegalStateException("String_Node_Str" + status + "String_Node_Str"+ Util.oidToString(jdoZooOid));
}
context.notifyEvent(this,ZooInstanceEvent.POST_DIRTY);
}
Program: 98036
Project: 98036
Buggy source:
@Override public ZooPC next(){
  ZooPC ret=next;
  ZooPC co=null;
  final boolean subClasses=this.subClasses;
  while (iter.hasNextEntry()) {
    co=iter.nextValue();
    ZooClassDef defCand=co.jdoZooGetClassDef();
    if (defCand == cls || (subClasses && cls.hasSuperClass(cls))) {
      if (co.jdoZooHasState(state)) {
        next=co;
        return ret;
      }
    }
  }
  next=null;
  return ret;
}

Fixed version (ground truth):
@Override public ZooPC next(){
  return iter.next();
}
Program: 98037
Project: 98037
Buggy source:
@Override public boolean hasNext(){
  return next != null;
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  return iter.hasNext();
}
Program: 98038
Project: 98038
Buggy source:
public Entry<V> next(){
  return nextEntry();
}

Fixed version (ground truth):
@Override public Entry<V> next(){
  return nextEntry();
}
Program: 98039
Project: 98039
Buggy source:
/** 
 * Returns a   {@link Collection} view of the values contained in this map.The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa.  If the map is modified while an iteration over the collection is in progress (except through the iterator's own <tt>remove</tt> operation), the results of the iteration are undefined.  The collection supports element removal, which removes the corresponding mapping from the map, via the <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
 */
public PrimLongValues values(){
  PrimLongValues vs=values;
  return vs != null ? vs : (values=new PrimLongValues());
}

Fixed version (ground truth):
/** 
 * Returns a   {@link Collection} view of the values contained in this map.The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa.  If the map is modified while an iteration over the collection is in progress (except through the iterator's own <tt>remove</tt> operation), the results of the iteration are undefined.  The collection supports element removal, which removes the corresponding mapping from the map, via the <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
 */
@Override public PrimLongValues values(){
  PrimLongValues vs=values;
  return vs != null ? vs : (values=new PrimLongValues());
}
Program: 98040
Project: 98040
Buggy source:
/** 
 * Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.
 * @param keyBits key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with <tt>key</tt>, or<tt>null</tt> if there was no mapping for <tt>key</tt>. (A <tt>null</tt> return can also indicate that the map previously associated <tt>null</tt> with <tt>key</tt>.)
 */
public V put(long keyBits,V value){
  int i=indexFor(keyBits,table.length);
  for (Entry<V> e=table[i]; e != null; e=e.next) {
    if (e.key == keyBits) {
      V oldValue=e.value;
      e.value=value;
      e.recordAccess(this);
      return oldValue;
    }
  }
  modCount++;
  addEntry(keyBits,value,i);
  return null;
}

Fixed version (ground truth):
/** 
 * Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.
 * @param keyBits key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with <tt>key</tt>, or<tt>null</tt> if there was no mapping for <tt>key</tt>. (A <tt>null</tt> return can also indicate that the map previously associated <tt>null</tt> with <tt>key</tt>.)
 */
@Override public V put(long keyBits,V value){
  int i=indexFor(keyBits,table.length);
  for (Entry<V> e=table[i]; e != null; e=e.next) {
    if (e.key == keyBits) {
      V oldValue=e.value;
      e.value=value;
      e.recordAccess(this);
      return oldValue;
    }
  }
  modCount++;
  addEntry(keyBits,value,i);
  return null;
}
Program: 98041
Project: 98041
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean remove(Object o){
  return removeMapping((Entry<V>)o) != null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public boolean remove(Object o){
  return removeMapping((Entry<V>)o) != null;
}
Program: 98042
Project: 98042
Buggy source:
/** 
 * Returns <tt>true</tt> if this map maps one or more keys to the specified value.
 * @param value value whose presence in this map is to be tested
 * @return <tt>true</tt> if this map maps one or more keys to thespecified value
 */
public boolean containsValue(V value){
  if (value == null) {
    return containsNullValue();
  }
  Entry<V>[] tab=table;
  for (int i=0; i < tab.length; i++) {
    for (Entry<V> e=tab[i]; e != null; e=e.next) {
      if (value.equals(e.value)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns <tt>true</tt> if this map maps one or more keys to the specified value.
 * @param value value whose presence in this map is to be tested
 * @return <tt>true</tt> if this map maps one or more keys to thespecified value
 */
@Override public boolean containsValue(V value){
  if (value == null) {
    return containsNullValue();
  }
  Entry<V>[] tab=table;
  for (int i=0; i < tab.length; i++) {
    for (Entry<V> e=tab[i]; e != null; e=e.next) {
      if (value.equals(e.value)) {
        return true;
      }
    }
  }
  return false;
}
Program: 98043
Project: 98043
Buggy source:
public EntryIterator iterator(){
  return newEntryIterator();
}

Fixed version (ground truth):
@Override public EntryIterator iterator(){
  return newEntryIterator();
}
Program: 98044
Project: 98044
Buggy source:
public final int hashCode(){
  return ((int)key) ^ (value == null ? 0 : value.hashCode());
}

Fixed version (ground truth):
@Override public final int hashCode(){
  return ((int)key) ^ (value == null ? 0 : value.hashCode());
}
Program: 98045
Project: 98045
Buggy source:
/** 
 * Returns the value to which the specified key is mapped, or   {@code null} if this map contains no mapping for the key.<p>More formally, if this map contains a mapping from a key {@code k} to a value {@code v} such that {@code (key==null ? k==null :key.equals(k))}, then this method returns   {@code v}; otherwise it returns   {@code null}.  (There can be at most one such mapping.) <p>A return value of   {@code null} does not <i>necessarily</i>indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to  {@code null}. The   {@link #containsKey containsKey} operation may be used todistinguish these two cases.
 * @see #put(long,Object)
 */
public V get(long keyBits){
  for (Entry<V> e=table[indexFor(keyBits,table.length)]; e != null; e=e.next) {
    if (e.key == keyBits) {
      return e.value;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the value to which the specified key is mapped, or   {@code null} if this map contains no mapping for the key.<p>More formally, if this map contains a mapping from a key {@code k} to a value {@code v} such that {@code (key==null ? k==null :key.equals(k))}, then this method returns   {@code v}; otherwise it returns   {@code null}.  (There can be at most one such mapping.) <p>A return value of   {@code null} does not <i>necessarily</i>indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to  {@code null}. The   {@link #containsKey containsKey} operation may be used todistinguish these two cases.
 * @see #put(long,Object)
 */
@Override public V get(long keyBits){
  for (Entry<V> e=table[indexFor(keyBits,table.length)]; e != null; e=e.next) {
    if (e.key == keyBits) {
      return e.value;
    }
  }
  return null;
}
Program: 98046
Project: 98046
Buggy source:
/** 
 * Copies all of the mappings from the specified map to this map. These mappings will replace any mappings that this map had for any of the keys currently in the specified map.
 * @param m mappings to be stored in this map
 * @throws NullPointerException if the specified map is null
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void putAll(PrimLongMap<? extends V> m){
  int numKeysToBeAdded=m.size();
  if (numKeysToBeAdded == 0) {
    return;
  }
  if (numKeysToBeAdded > threshold) {
    int targetCapacity=(int)(numKeysToBeAdded / loadFactor + 1);
    if (targetCapacity > MAXIMUM_CAPACITY) {
      targetCapacity=MAXIMUM_CAPACITY;
    }
    int newCapacity=table.length;
    while (newCapacity < targetCapacity) {
      newCapacity<<=1;
    }
    if (newCapacity > table.length) {
      resize(newCapacity);
    }
  }
  for (final Iterator i=m.entrySet().iterator(); i.hasNext(); ) {
    PrimLongMapLI.Entry<? extends V> e=(Entry<? extends V>)i.next();
    put(e.getKey(),e.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Copies all of the mappings from the specified map to this map. These mappings will replace any mappings that this map had for any of the keys currently in the specified map.
 * @param m mappings to be stored in this map
 * @throws NullPointerException if the specified map is null
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void putAll(PrimLongMap<? extends V> m){
  int numKeysToBeAdded=m.size();
  if (numKeysToBeAdded == 0) {
    return;
  }
  if (numKeysToBeAdded > threshold) {
    int targetCapacity=(int)(numKeysToBeAdded / loadFactor + 1);
    if (targetCapacity > MAXIMUM_CAPACITY) {
      targetCapacity=MAXIMUM_CAPACITY;
    }
    int newCapacity=table.length;
    while (newCapacity < targetCapacity) {
      newCapacity<<=1;
    }
    if (newCapacity > table.length) {
      resize(newCapacity);
    }
  }
  for (final Iterator i=m.entrySet().iterator(); i.hasNext(); ) {
    PrimLongMapLI.Entry<? extends V> e=(Entry<? extends V>)i.next();
    put(e.getKey(),e.getValue());
  }
}
Program: 98047
Project: 98047
Buggy source:
/** 
 * Returns a   {@link Set} view of the keys contained in this map.The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.  If the map is modified while an iteration over the set is in progress (except through the iterator's own <tt>remove</tt> operation), the results of the iteration are undefined.  The set supports element removal, which removes the corresponding mapping from the map, via the <tt>Iterator.remove</tt>, <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> operations.  It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
 */
public Set<Long> keySet(){
  Set<Long> ks=keySet;
  return ks != null ? ks : (keySet=new KeySet());
}

Fixed version (ground truth):
/** 
 * Returns a   {@link Set} view of the keys contained in this map.The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.  If the map is modified while an iteration over the set is in progress (except through the iterator's own <tt>remove</tt> operation), the results of the iteration are undefined.  The set supports element removal, which removes the corresponding mapping from the map, via the <tt>Iterator.remove</tt>, <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> operations.  It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
 */
@Override public Set<Long> keySet(){
  Set<Long> ks=keySet;
  return ks != null ? ks : (keySet=new KeySet());
}
Program: 98048
Project: 98048
Buggy source:
public final long getKey(){
  return key;
}

Fixed version (ground truth):
@Override public final long getKey(){
  return key;
}
Program: 98049
Project: 98049
Buggy source:
/** 
 * Returns index for hash code h.
 */
static int indexFor(long h,int length){
  return (int)h & (length - 1);
}

Fixed version (ground truth):
/** 
 * Returns index for hash code h.
 */
private static int indexFor(long h,int length){
  return (int)h & (length - 1);
}
Program: 98050
Project: 98050
Buggy source:
/** 
 * Returns a   {@link Set} view of the mappings contained in this map.The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.  If the map is modified while an iteration over the set is in progress (except through the iterator's own <tt>remove</tt> operation, or through the <tt>setValue</tt> operation on a map entry returned by the iterator) the results of the iteration are undefined.  The set supports element removal, which removes the corresponding mapping from the map, via the <tt>Iterator.remove</tt>, <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
 * @return a set view of the mappings contained in this map
 */
@SuppressWarnings("String_Node_Str") public Set<PrimLongEntry<V>> entrySet(){
  Set<PrimLongEntry<V>> es=(Set<PrimLongMap.PrimLongEntry<V>>)entrySet;
  return (Set<PrimLongEntry<V>>)(es != null ? es : (entrySet=new EntrySet()));
}

Fixed version (ground truth):
/** 
 * Returns a   {@link Set} view of the mappings contained in this map.The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.  If the map is modified while an iteration over the set is in progress (except through the iterator's own <tt>remove</tt> operation, or through the <tt>setValue</tt> operation on a map entry returned by the iterator) the results of the iteration are undefined.  The set supports element removal, which removes the corresponding mapping from the map, via the <tt>Iterator.remove</tt>, <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
 * @return a set view of the mappings contained in this map
 */
@SuppressWarnings("String_Node_Str") @Override public Set<PrimLongEntry<V>> entrySet(){
  Set<PrimLongEntry<V>> es=(Set<PrimLongMap.PrimLongEntry<V>>)entrySet;
  return (Set<PrimLongEntry<V>>)(es != null ? es : (entrySet=new EntrySet()));
}
Program: 98051
Project: 98051
Buggy source:
/** 
 * Returns <tt>true</tt> if this map contains a mapping for the specified key.
 * @param key   The key whose presence in this map is to be tested
 * @return <tt>true</tt> if this map contains a mapping for the specifiedkey.
 */
public boolean containsKey(long key){
  return getEntry(key) != null;
}

Fixed version (ground truth):
/** 
 * Returns <tt>true</tt> if this map contains a mapping for the specified key.
 * @param key   The key whose presence in this map is to be tested
 * @return <tt>true</tt> if this map contains a mapping for the specifiedkey.
 */
@Override public boolean containsKey(long key){
  return getEntry(key) != null;
}
Program: 98052
Project: 98052
Buggy source:
public void clear(){
  PrimLongMapLI.this.clear();
}

Fixed version (ground truth):
@Override public void clear(){
  PrimLongMapLI.this.clear();
}
Program: 98053
Project: 98053
Buggy source:
public final boolean hasNext(){
  return next != null;
}

Fixed version (ground truth):
@Override public final boolean hasNext(){
  return next != null;
}
Program: 98054
Project: 98054
Buggy source:
public final V getValue(){
  return value;
}

Fixed version (ground truth):
@Override public final V getValue(){
  return value;
}
Program: 98055
Project: 98055
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean contains(Object o){
  if (!(o instanceof Entry)) {
    return false;
  }
  Entry<V> e=(Entry<V>)o;
  Entry<V> candidate=getEntry(e.getKey());
  return candidate != null && candidate.equals(e);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public boolean contains(Object o){
  if (!(o instanceof Entry)) {
    return false;
  }
  Entry<V> e=(Entry<V>)o;
  Entry<V> candidate=getEntry(e.getKey());
  return candidate != null && candidate.equals(e);
}
Program: 98056
Project: 98056
Buggy source:
public int size(){
  return size;
}

Fixed version (ground truth):
@Override public int size(){
  return size;
}
Program: 98057
Project: 98057
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public final boolean equals(Object o){
  if (!(o instanceof Entry)) {
    return false;
  }
  if (this == o) {
    return true;
  }
  Entry<V> e=(Entry)o;
  long k1=key;
  long k2=e.key;
  if (k1 == k2) {
    Object v1=getValue();
    Object v2=e.getValue();
    if (v1 == v2 || (v1 != null && v1.equals(v2))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public final boolean equals(Object o){
  if (!(o instanceof Entry)) {
    return false;
  }
  if (this == o) {
    return true;
  }
  Entry<V> e=(Entry)o;
  long k1=key;
  long k2=e.key;
  if (k1 == k2) {
    Object v1=getValue();
    Object v2=e.getValue();
    if (v1 == v2 || (v1 != null && v1.equals(v2))) {
      return true;
    }
  }
  return false;
}
Program: 98058
Project: 98058
Buggy source:
public final String toString(){
  return getKey() + "String_Node_Str" + getValue();
}

Fixed version (ground truth):
@Override public final String toString(){
  return getKey() + "String_Node_Str" + getValue();
}
Program: 98059
Project: 98059
Buggy source:
public V nextValue(){
  return nextEntry().value;
}

Fixed version (ground truth):
@Override public V nextValue(){
  return nextEntry().value;
}
Program: 98060
Project: 98060
Buggy source:
/** 
 * Returns index for hash code h.
 */
static int indexFor(long h,int length){
  return (int)h & (length - 1);
}

Fixed version (ground truth):
/** 
 * Returns index for hash code h.
 */
private static int indexFor(long h,int length){
  return (int)h & (length - 1);
}
Program: 98061
Project: 98061
Buggy source:
private void processOptimisticTransactionResult(OptimisticTransactionResult otr){
  if (otr.requiresReset()) {
    isActive=false;
    close();
    throw DBLogger.newFatalDataStore("String_Node_Str",null);
  }
  if (otr.requiresRefresh()) {
    if (schemaManager.hasChanges()) {
      throw new JDOOptimisticVerificationException("String_Node_Str" + "String_Node_Str");
    }
    schemaManager.refreshSchemaAll();
  }
}

Fixed version (ground truth):
private void processOptimisticTransactionResult(OptimisticTransactionResult otr){
  if (otr.requiresReset()) {
    isActive=false;
    closeInternal();
    throw DBLogger.newFatalDataStore("String_Node_Str",null);
  }
  if (otr.requiresRefresh()) {
    if (schemaManager.hasChanges()) {
      throw new JDOOptimisticVerificationException("String_Node_Str" + "String_Node_Str");
    }
    schemaManager.refreshSchemaAll();
  }
}
Program: 98062
Project: 98062
Buggy source:
public Session(Object parentSession,String dbPath,SessionConfig config){
  dbPath=ZooHelper.getDataStoreManager().getDbPath(dbPath);
  this.parentSession=parentSession;
  this.config=config;
  this.primary=ZooFactory.get().createNode(dbPath,this);
  this.cache=new ClientSessionCache(this);
  this.schemaManager=new SchemaManager(cache,config.getAutoCreateSchema());
  this.nodes.add(primary);
  this.cache.addNode(primary);
  this.primary.connect();
}

Fixed version (ground truth):
public Session(SessionParentCallback parentSession,String dbPath,SessionConfig config){
  dbPath=ZooHelper.getDataStoreManager().getDbPath(dbPath);
  this.parentSession=parentSession;
  this.config=config;
  this.primary=ZooFactory.get().createNode(dbPath,this);
  this.cache=new ClientSessionCache(this);
  this.schemaManager=new SchemaManager(cache,config.getAutoCreateSchema());
  this.nodes.add(primary);
  this.cache.addNode(primary);
  this.primary.connect();
}
Program: 98063
Project: 98063
Buggy source:
@Override public void close(){
  for (  PersistenceManagerImpl pm : pms) {
    if (!pm.isClosed()) {
      throw new JDOUserException("String_Node_Str",new JDOUserException(),pm);
    }
  }
  JDOImplHelper.getInstance().removeStateInterrogation(SI);
  isClosed=true;
}

Fixed version (ground truth):
@Override public void close(){
  for (  PersistenceManagerImpl pm : pms) {
    if (!pm.isClosed() && pm.currentTransaction().isActive()) {
      throw new JDOUserException("String_Node_Str",new JDOUserException(),pm);
    }
  }
  while (!pms.isEmpty()) {
    PersistenceManager pm=pms.iterator().next();
    if (!pm.isClosed()) {
      pm.close();
    }
  }
  JDOImplHelper.getInstance().removeStateInterrogation(SI);
  isClosed=true;
}
Program: 98064
Project: 98064
Buggy source:
@Test public void testCreateAndCloseSession(){
  ZooJdoProperties props=new ZooJdoProperties(TestTools.getDbName());
  PersistenceManagerFactory pmf1=JDOHelper.getPersistenceManagerFactory(props);
  PersistenceManager pm11=pmf1.getPersistenceManager();
  PersistenceManagerFactory pmf2=JDOHelper.getPersistenceManagerFactory(props);
  PersistenceManager pm21=pmf2.getPersistenceManager();
  assertFalse(pm21 == pm11);
  PersistenceManager pm12=pmf1.getPersistenceManager();
  assertTrue(pm12 != pm11);
  try {
    pmf1.close();
    fail();
  }
 catch (  JDOUserException e) {
  }
  assertFalse(pm11.isClosed());
  assertFalse(pm12.isClosed());
  pm11.close();
  pm12.close();
  assertTrue(pm11.isClosed());
  assertTrue(pm12.isClosed());
  assertFalse(pm21.isClosed());
  pm21.close();
  assertTrue(pm21.isClosed());
  pmf1.close();
  pmf2.close();
  try {
    pmf1.getPersistenceManager();
    fail();
  }
 catch (  JDOUserException e) {
  }
  try {
    pmf1.setConnectionURL("String_Node_Str");
    fail();
  }
 catch (  JDOUserException e) {
  }
}

Fixed version (ground truth):
@Test public void testCreateAndCloseSession(){
  ZooJdoProperties props=new ZooJdoProperties(TestTools.getDbName());
  PersistenceManagerFactory pmf1=JDOHelper.getPersistenceManagerFactory(props);
  PersistenceManager pm11=pmf1.getPersistenceManager();
  PersistenceManagerFactory pmf2=JDOHelper.getPersistenceManagerFactory(props);
  PersistenceManager pm21=pmf2.getPersistenceManager();
  assertFalse(pm21 == pm11);
  PersistenceManager pm12=pmf1.getPersistenceManager();
  assertTrue(pm12 != pm11);
  pm12.currentTransaction().begin();
  try {
    pmf1.close();
    fail();
  }
 catch (  JDOUserException e) {
  }
  pm12.currentTransaction().commit();
  assertFalse(pm11.isClosed());
  assertFalse(pm12.isClosed());
  pm11.close();
  pm12.close();
  assertTrue(pm11.isClosed());
  assertTrue(pm12.isClosed());
  assertFalse(pm21.isClosed());
  pm21.close();
  assertTrue(pm21.isClosed());
  pmf1.close();
  pmf2.close();
  try {
    pmf1.getPersistenceManager();
    fail();
  }
 catch (  JDOUserException e) {
  }
  try {
    pmf1.setConnectionURL("String_Node_Str");
    fail();
  }
 catch (  JDOUserException e) {
  }
}
Program: 98065
Project: 98065
Buggy source:
private void processOptimisticVerification(boolean isTrialRun){
  ArrayList<Long> updateOids=new ArrayList<>();
  ArrayList<Long> updateTimstamps=new ArrayList<>();
  getObjectToCommit(updateOids,updateTimstamps);
  OptimisticTransactionResult ovrSummary=new OptimisticTransactionResult();
  for (  Node n : nodes) {
    ovrSummary.add(n.beginCommit(updateOids,updateTimstamps));
  }
  processOptimisticTransactionResult(ovrSummary);
  if (!ovrSummary.getConflicts().isEmpty()) {
    JDOOptimisticVerificationException[] ea=new JDOOptimisticVerificationException[ovrSummary.getConflicts().size()];
    int pos=0;
    for (    Long oid : ovrSummary.getConflicts()) {
      Object failedObj=cache.findCoByOID(oid);
      if (failedObj == null) {
        failedObj=cache.getGeneric(oid).getOrCreateHandle();
      }
      ea[pos]=new JDOOptimisticVerificationException(Util.oidToString(oid),failedObj);
      pos++;
    }
    if (!isTrialRun) {
      rollback();
    }
    throw new JDOOptimisticVerificationException("String_Node_Str",ea);
  }
}

Fixed version (ground truth):
private void processOptimisticVerification(boolean isTrialRun){
  ArrayList<Long> updateOids=new ArrayList<>();
  ArrayList<Long> updateTimstamps=new ArrayList<>();
  getObjectToCommit(updateOids,updateTimstamps);
  OptimisticTransactionResult ovrSummary=new OptimisticTransactionResult();
  for (  Node n : nodes) {
    if (isTrialRun) {
      ovrSummary.add(n.checkTxConsistency(updateOids,updateTimstamps));
    }
 else {
      ovrSummary.add(n.beginCommit(updateOids,updateTimstamps));
    }
  }
  processOptimisticTransactionResult(ovrSummary);
  if (!ovrSummary.getConflicts().isEmpty()) {
    JDOOptimisticVerificationException[] ea=new JDOOptimisticVerificationException[ovrSummary.getConflicts().size()];
    int pos=0;
    for (    Long oid : ovrSummary.getConflicts()) {
      Object failedObj=cache.findCoByOID(oid);
      if (failedObj == null) {
        failedObj=cache.getGeneric(oid).getOrCreateHandle();
      }
      ea[pos]=new JDOOptimisticVerificationException(Util.oidToString(oid),failedObj);
      pos++;
    }
    if (!isTrialRun) {
      rollback();
    }
    throw new JDOOptimisticVerificationException("String_Node_Str",ea);
  }
}
Program: 98066
Project: 98066
Buggy source:
@Override public OptimisticTransactionResult checkTxConsistency(ArrayList<Long> updateOid,ArrayList<Long> updateTimestamps){
  DBLogger.debugPrintln(1,"String_Node_Str");
  lock.unlock();
  lock=sm.getWriteLock();
  lock.lock();
  OptimisticTransactionResult ovr=checkConsistencyInternal(updateOid,updateTimestamps,true);
  if (ovr.hasFailed()) {
    return ovr;
  }
  DBLogger.debugPrintln(1,"String_Node_Str");
  lock.unlock();
  lock=sm.getWriteLock();
  lock.lock();
  return ovr;
}

Fixed version (ground truth):
@Override public OptimisticTransactionResult checkTxConsistency(ArrayList<Long> updateOid,ArrayList<Long> updateTimestamps){
  DBLogger.debugPrintln(1,"String_Node_Str");
  sm.getLock().release(this);
  sm.getLock().writeLock(this);
  OptimisticTransactionResult ovr=checkConsistencyInternal(updateOid,updateTimestamps,true);
  if (ovr.hasFailed()) {
    return ovr;
  }
  DBLogger.debugPrintln(1,"String_Node_Str");
  sm.getLock().release(this);
  if (ALLOW_READ_CONCURRENCY) {
    sm.getLock().readLock(this);
  }
 else {
    sm.getLock().writeLock(this);
  }
  return ovr;
}
Program: 98067
Project: 98067
Buggy source:
@Override public OptimisticTransactionResult rollbackTransaction(){
  try {
    OptimisticTransactionResult txr=new OptimisticTransactionResult(null,false,false);
    if (txContext.getSchemaIndexTxId() != schemaIndex.getTxIdOfLastWriteThatRequiresRefresh()) {
      txr.setRefreshRequired(true);
    }
    if (txContext.getSchemaTxId() != schemaIndex.getTxIdOfLastWrite()) {
      txr.setResetRequired(true);
    }
    txContext.setSchemaTxId(schemaIndex.getTxIdOfLastWrite());
    txContext.setSchemaIndexTxId(schemaIndex.getTxIdOfLastWriteThatRequiresRefresh());
    return txr;
  }
  finally {
    DBLogger.debugPrintln(1,"String_Node_Str");
    lock.unlock();
    lock=null;
  }
}

Fixed version (ground truth):
@Override public OptimisticTransactionResult rollbackTransaction(){
  try {
    OptimisticTransactionResult txr=new OptimisticTransactionResult(null,false,false);
    if (txContext.getSchemaIndexTxId() != schemaIndex.getTxIdOfLastWriteThatRequiresRefresh()) {
      txr.setRefreshRequired(true);
    }
    if (txContext.getSchemaTxId() != schemaIndex.getTxIdOfLastWrite()) {
      txr.setResetRequired(true);
    }
    txContext.setSchemaTxId(schemaIndex.getTxIdOfLastWrite());
    txContext.setSchemaIndexTxId(schemaIndex.getTxIdOfLastWriteThatRequiresRefresh());
    return txr;
  }
  finally {
    DBLogger.debugPrintln(1,"String_Node_Str");
    sm.getLock().release(this);
  }
}
Program: 98068
Project: 98068
Buggy source:
@Override public void commit(){
  try {
    int oidPage=oidIndex.write();
    int schemaPage1=schemaIndex.write(txId);
    txContext.setSchemaTxId(schemaIndex.getTxIdOfLastWrite());
    txContext.setSchemaIndexTxId(schemaIndex.getTxIdOfLastWriteThatRequiresRefresh());
    sm.commitInfrastructure(oidPage,schemaPage1,oidIndex.getLastUsedOid(),txId);
    txContext.reset();
  }
  finally {
    DBLogger.debugPrintln(1,"String_Node_Str");
    lock.unlock();
    lock=null;
  }
}

Fixed version (ground truth):
@Override public void commit(){
  try {
    int oidPage=oidIndex.write();
    int schemaPage1=schemaIndex.write(txId);
    txContext.setSchemaTxId(schemaIndex.getTxIdOfLastWrite());
    txContext.setSchemaIndexTxId(schemaIndex.getTxIdOfLastWriteThatRequiresRefresh());
    sm.commitInfrastructure(oidPage,schemaPage1,oidIndex.getLastUsedOid(),txId);
    txContext.reset();
  }
  finally {
    DBLogger.debugPrintln(1,"String_Node_Str");
    sm.getLock().release(this);
  }
}
Program: 98069
Project: 98069
Buggy source:
DiskAccessOneFile(Node node,AbstractCache cache,SessionManager sm){
  this.sm=sm;
  this.node=node;
  this.cache=cache;
  DBLogger.debugPrintln(1,"String_Node_Str");
  lock=sm.getReadLock();
  lock.lock();
  this.freeIndex=sm.getFsm();
  this.file=sm.getFile();
  oidIndex=sm.getOidIndex();
  schemaIndex=sm.getSchemaIndex();
  objectReader=new ObjectReader(file);
  ddsPool=new PoolDDS(file,this.cache);
  fileInAP=file.getReader(true);
}

Fixed version (ground truth):
DiskAccessOneFile(Node node,AbstractCache cache,SessionManager sm){
  this.sm=sm;
  this.node=node;
  this.cache=cache;
  DBLogger.debugPrintln(1,"String_Node_Str");
  sm.getLock().readLock(this);
  this.freeIndex=sm.getFsm();
  this.file=sm.getFile();
  oidIndex=sm.getOidIndex();
  schemaIndex=sm.getSchemaIndex();
  objectReader=new ObjectReader(file);
  ddsPool=new PoolDDS(file,this.cache);
  fileInAP=file.getReader(true);
}
Program: 98070
Project: 98070
Buggy source:
@Override public long beginTransaction(){
  txContext.reset();
  lock=sm.getWriteLock();
  try {
    DBLogger.debugPrintln(1,"String_Node_Str");
    if (!lock.tryLock(10,TimeUnit.SECONDS)) {
      throw DBLogger.newUser("String_Node_Str");
    }
  }
 catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
  }
  txId=sm.getNextTxId();
  return txId;
}

Fixed version (ground truth):
@Override public long beginTransaction(){
  txContext.reset();
  if (ALLOW_READ_CONCURRENCY) {
    sm.getLock().readLock(this);
  }
 else {
    sm.getLock().writeLock(this);
  }
  txId=sm.getNextTxId();
  return txId;
}
Program: 98071
Project: 98071
Buggy source:
@Override public OptimisticTransactionResult beginCommit(ArrayList<Long> updateOid,ArrayList<Long> updateTimestamps){
  DBLogger.debugPrintln(1,"String_Node_Str");
  lock.unlock();
  lock=sm.getWriteLock();
  lock.lock();
  OptimisticTransactionResult ovr=checkConsistencyInternal(updateOid,updateTimestamps,false);
  if (ovr.hasFailed()) {
    return ovr;
  }
  file.newTransaction(txId);
  freeIndex.notifyBegin(txId);
  return ovr;
}

Fixed version (ground truth):
@Override public OptimisticTransactionResult beginCommit(ArrayList<Long> updateOid,ArrayList<Long> updateTimestamps){
  DBLogger.debugPrintln(1,"String_Node_Str");
  sm.getLock().release(this);
  sm.getLock().writeLock(this);
  OptimisticTransactionResult ovr=checkConsistencyInternal(updateOid,updateTimestamps,false);
  if (ovr.hasFailed()) {
    return ovr;
  }
  file.newTransaction(txId);
  freeIndex.notifyBegin(txId);
  return ovr;
}
Program: 98072
Project: 98072
Buggy source:
@Before public void setUp(){
  TestTools.removeDb();
  TestTools.createDb();
}

Fixed version (ground truth):
@Before public void setUp(){
  DiskAccessOneFile.allowReadConcurrency(true);
  TestTools.removeDb();
  TestTools.createDb();
}
Program: 98073
Project: 98073
Buggy source:
@After public void tearDown(){
  TestTools.removeDb();
}

Fixed version (ground truth):
@After public void tearDown(){
  DiskAccessOneFile.allowReadConcurrency(false);
  TestTools.removeDb();
}
Program: 98074
Project: 98074
Buggy source:
@Before public void setUp(){
  TestTools.removeDb();
  TestTools.createDb();
}

Fixed version (ground truth):
@Before public void setUp(){
  DiskAccessOneFile.allowReadConcurrency(true);
  TestTools.removeDb();
  TestTools.createDb();
}
Program: 98075
Project: 98075
Buggy source:
@After public void tearDown(){
  TestTools.removeDb();
}

Fixed version (ground truth):
@After public void tearDown(){
  DiskAccessOneFile.allowReadConcurrency(false);
  TestTools.removeDb();
}
Program: 98076
Project: 98076
Buggy source:
@Before public void setUp(){
  TestTools.removeDb();
  TestTools.createDb();
}

Fixed version (ground truth):
@Before public void setUp(){
  DiskAccessOneFile.allowReadConcurrency(true);
  TestTools.removeDb();
  TestTools.createDb();
}
Program: 98077
Project: 98077
Buggy source:
@After public void tearDown(){
  TestTools.removeDb();
}

Fixed version (ground truth):
@After public void tearDown(){
  DiskAccessOneFile.allowReadConcurrency(false);
  TestTools.removeDb();
}
Program: 98078
Project: 98078
Buggy source:
/** 
 * Start a process through a main() method.
 */
public static TestProcess launchProcess(String optionsAsString,Class<?> mainClass,String[] arguments){
  String FS=File.separator;
  String jvm=System.getProperty("String_Node_Str") + FS + "String_Node_Str"+ FS+ "String_Node_Str";
  String cp=System.getProperty("String_Node_Str");
  String[] options=optionsAsString.split("String_Node_Str");
  List<String> command=new ArrayList<String>();
  command.add(jvm);
  command.addAll(Arrays.asList(options));
  command.add(mainClass.getName());
  command.addAll(Arrays.asList(arguments));
  return createProcess(command,cp);
}

Fixed version (ground truth):
/** 
 * Start a process through a main() method.
 */
public static TestProcess launchProcess(String optionsAsString,Class<?> mainClass,String[] arguments){
  String FS=File.separator;
  String jvm=System.getProperty("String_Node_Str") + FS + "String_Node_Str"+ FS+ "String_Node_Str";
  String cp=System.getProperty("String_Node_Str");
  List<String> command=new ArrayList<String>();
  command.add(jvm);
  if (optionsAsString != null && optionsAsString.length() > 0) {
    String[] options=optionsAsString.split("String_Node_Str");
    command.addAll(Arrays.asList(options));
  }
  command.add(mainClass.getName());
  command.addAll(Arrays.asList(arguments));
  return createProcess(command,cp);
}
Program: 98079
Project: 98079
Buggy source:
public DataIndexUpdater(ZooClassDef def){
  ArrayList<ZooFieldDef> pfl=new ArrayList<ZooFieldDef>();
  for (  ZooFieldDef f : def.getAllFields()) {
    if (f.isIndexed()) {
      pfl.add(f);
    }
  }
  indFields=pfl.toArray(new ZooFieldDef[pfl.size()]);
}

Fixed version (ground truth):
public DataIndexUpdater(ZooClassDef def){
  refreshWithSchema(def);
}
Program: 98081
Project: 98081
Buggy source:
public void activateRead(){
  if (isHollow) {
    GenericObject go=context.getNode().readGenericObject(def,oid);
    if (go != this) {
      throw DBLogger.newFatal("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void activateRead(){
  if (isHollow) {
    GenericObject go=context.getNode().readGenericObject(def,oid);
    if (go != this) {
      throw DBLogger.newFatalInternal("String_Node_Str");
    }
  }
}
Program: 98082
Project: 98082
Buggy source:
public abstract List<Long> checkTxConsistency(ArrayList<Long> updateOids,ArrayList<Long> updateTimstamps);

Fixed version (ground truth):
public abstract OptimisticVerificationResult checkTxConsistency(ArrayList<Long> updateOids,ArrayList<Long> updateTimstamps);
Program: 98083
Project: 98083
Buggy source:
public abstract List<Long> beginCommit(ArrayList<Long> updateOids,ArrayList<Long> updatesTimstamps);

Fixed version (ground truth):
public abstract OptimisticVerificationResult beginCommit(ArrayList<Long> updateOids,ArrayList<Long> updatesTimstamps);
Program: 98084
Project: 98084
Buggy source:
/** 
 * Verify optimistic consistency of the current transaction.
 */
public void checkConsistency(){
  if (schemaManager.hasChanges()) {
    throw new JDOOptimisticVerificationException("String_Node_Str" + "String_Node_Str");
  }
  DBLogger.warning("String_Node_Str");
  ArrayList<Long> updateOids=new ArrayList<>();
  ArrayList<Long> updateTimstamps=new ArrayList<>();
  getObjectToCommit(updateOids,updateTimstamps);
  ArrayList<Long> failedOids=new ArrayList<Long>();
  for (  Node n : nodes) {
    List<Long> nodeFailures=n.checkTxConsistency(updateOids,updateTimstamps);
    if (!nodeFailures.isEmpty()) {
      failedOids.addAll(nodeFailures);
    }
  }
  if (!failedOids.isEmpty()) {
    JDOOptimisticVerificationException[] ea=new JDOOptimisticVerificationException[failedOids.size()];
    for (int i=0; i < failedOids.size(); i++) {
      Long oid=failedOids.get(i);
      Object failedObj=cache.findCoByOID(oid);
      ea[i]=new JDOOptimisticVerificationException(Util.oidToString(oid),failedObj);
    }
    throw new JDOOptimisticVerificationException("String_Node_Str",ea);
  }
}

Fixed version (ground truth):
/** 
 * Verify optimistic consistency of the current transaction.
 */
public void checkConsistency(){
  processOptimisticVerification(true);
}
Program: 98085
Project: 98085
Buggy source:
public void commit(boolean retainValues){
  checkActive();
  ObjectGraphTraverser ogt=new ObjectGraphTraverser(this,cache);
  ogt.traverse();
  preCommit();
  schemaManager.commit();
  try {
    commitInternal();
    for (    Node n : nodes) {
      n.commit();
    }
    cache.postCommit(retainValues);
  }
 catch (  RuntimeException e) {
    if (DBLogger.isUser(e)) {
      for (      ZooClassDef cs : cache.getSchemata()) {
        cs.getProvidedContext().getDataSink().reset();
        cs.getProvidedContext().getDataDeleteSink().reset();
      }
      for (      Node n : nodes) {
        n.revert();
      }
    }
    throw e;
  }
  for (  CloseableIterator<?> ext : extents.keySet().toArray(new CloseableIterator[0])) {
    ext.close();
  }
  DBLogger.debugPrintln(2,"String_Node_Str");
  isActive=false;
}

Fixed version (ground truth):
public void commit(boolean retainValues){
  try {
    checkActive();
    ObjectGraphTraverser ogt=new ObjectGraphTraverser(this,cache);
    ogt.traverse();
    preCommit();
    schemaManager.commit();
    try {
      commitInternal();
      for (      Node n : nodes) {
        n.commit();
      }
      cache.postCommit(retainValues);
    }
 catch (    RuntimeException e) {
      if (DBLogger.isUser(e)) {
        for (        ZooClassDef cs : cache.getSchemata()) {
          cs.getProvidedContext().getDataSink().reset();
          cs.getProvidedContext().getDataDeleteSink().reset();
        }
        for (        Node n : nodes) {
          n.revert();
        }
      }
      throw e;
    }
    for (    CloseableIterator<?> ext : extents.keySet().toArray(new CloseableIterator[0])) {
      ext.close();
    }
    DBLogger.debugPrintln(2,"String_Node_Str");
    isActive=false;
  }
 catch (  RuntimeException e) {
    if (DBLogger.isFatalDataStoreException(e) && !DBLogger.isOptimisticVerificationException(e)) {
      isActive=false;
      close();
    }
    throw e;
  }
}
Program: 98086
Project: 98086
Buggy source:
private void preCommit(){
  ArrayList<Long> updateOids=new ArrayList<>();
  ArrayList<Long> updateTimstamps=new ArrayList<>();
  getObjectToCommit(updateOids,updateTimstamps);
  ArrayList<Long> failedOids=new ArrayList<Long>();
  for (  Node n : nodes) {
    List<Long> nodeFailures=n.beginCommit(updateOids,updateTimstamps);
    if (!nodeFailures.isEmpty()) {
      failedOids.addAll(nodeFailures);
    }
  }
  if (!failedOids.isEmpty()) {
    JDOOptimisticVerificationException[] ea=new JDOOptimisticVerificationException[failedOids.size()];
    for (int i=0; i < failedOids.size(); i++) {
      Long oid=failedOids.get(i);
      Object failedObj=cache.findCoByOID(oid);
      ea[i]=new JDOOptimisticVerificationException(Util.oidToString(oid),failedObj);
    }
    rollback();
    throw new JDOOptimisticVerificationException("String_Node_Str",ea);
  }
}

Fixed version (ground truth):
private void preCommit(){
  processOptimisticVerification(false);
}
Program: 98087
Project: 98087
Buggy source:
public static ZooClassDef createFromJavaType(Class<?> cls,ZooClassDef defSuper,Node node,Session session){
  ZooClassDef def;
  long superOid=0;
  if (cls != ZooPC.class) {
    if (defSuper == null) {
      throw DBLogger.newUser("String_Node_Str" + cls);
    }
    superOid=defSuper.getOid();
    if (superOid == 0) {
      throw DBLogger.newFatal("String_Node_Str" + cls.getName());
    }
  }
  long oid=node.getOidBuffer().allocateOid();
  def=new ZooClassDef(cls.getName(),oid,superOid,oid,0);
  ArrayList<ZooFieldDef> fieldList=new ArrayList<ZooFieldDef>();
  Field[] fields=cls.getDeclaredFields();
  for (int i=0; i < fields.length; i++) {
    Field jField=fields[i];
    if (Modifier.isStatic(jField.getModifiers()) || Modifier.isTransient(jField.getModifiers())) {
      continue;
    }
    long fieldOid=node.getOidBuffer().allocateOid();
    ZooFieldDef zField=ZooFieldDef.createFromJavaType(def,jField,fieldOid);
    fieldList.add(zField);
  }
  def.registerFields(fieldList);
  def.cls=cls;
  def.associateSuperDef(defSuper);
  def.associateProxy(new ZooClassProxy(def,session));
  def.associateFields();
  return def;
}

Fixed version (ground truth):
public static ZooClassDef createFromJavaType(Class<?> cls,ZooClassDef defSuper,Node node,Session session){
  ZooClassDef def;
  long superOid=0;
  if (cls != ZooPC.class) {
    if (defSuper == null) {
      throw DBLogger.newUser("String_Node_Str" + cls);
    }
    superOid=defSuper.getOid();
    if (superOid == 0) {
      throw DBLogger.newFatalInternal("String_Node_Str" + cls.getName());
    }
  }
  long oid=node.getOidBuffer().allocateOid();
  def=new ZooClassDef(cls.getName(),oid,superOid,oid,0);
  ArrayList<ZooFieldDef> fieldList=new ArrayList<ZooFieldDef>();
  Field[] fields=cls.getDeclaredFields();
  for (int i=0; i < fields.length; i++) {
    Field jField=fields[i];
    if (Modifier.isStatic(jField.getModifiers()) || Modifier.isTransient(jField.getModifiers())) {
      continue;
    }
    long fieldOid=node.getOidBuffer().allocateOid();
    ZooFieldDef zField=ZooFieldDef.createFromJavaType(def,jField,fieldOid);
    fieldList.add(zField);
  }
  def.registerFields(fieldList);
  def.cls=cls;
  def.associateSuperDef(defSuper);
  def.associateProxy(new ZooClassProxy(def,session));
  def.associateFields();
  return def;
}
Program: 98088
Project: 98088
Buggy source:
/** 
 * Schema operation callback for removing this class definition.
 */
public void socRemoveDef(){
  if (!superProxy.subClasses.remove(this)) {
    throw DBLogger.newFatal("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Schema operation callback for removing this class definition.
 */
public void socRemoveDef(){
  if (!superProxy.subClasses.remove(this)) {
    throw DBLogger.newFatalInternal("String_Node_Str");
  }
}
Program: 98089
Project: 98089
Buggy source:
public void refreshSchema(ZooClassDef def){
  def.jdoZooGetNode().refreshSchema(def);
}

Fixed version (ground truth):
public void refreshSchema(ZooClassDef def){
  def.jdoZooGetNode().refreshSchema(def);
  def.getProvidedContext().getIndexer().refreshWithSchema(def);
}
Program: 98090
Project: 98090
Buggy source:
public final void makeTransient(ZooPC pc){
  if (objs.remove(pc.jdoZooGetOid()) == null) {
    throw DBLogger.newFatal("String_Node_Str");
  }
  pc.jdoZooMarkTransient();
}

Fixed version (ground truth):
public final void makeTransient(ZooPC pc){
  if (objs.remove(pc.jdoZooGetOid()) == null) {
    throw DBLogger.newFatalInternal("String_Node_Str");
  }
  pc.jdoZooMarkTransient();
}
Program: 98091
Project: 98091
Buggy source:
/** 
 * @param oid
 * @return Whether the object exists
 */
public boolean isOidUsed(long oid){
  checkOpen();
  ZooPCImpl co=cache.findCoByOID(oid);
  if (co != null) {
    return true;
  }
  GenericObject go=cache.getGeneric(oid);
  if (go != null) {
    return true;
  }
  for (  Node n : nodes) {
    if (n.checkIfObjectExists(oid)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param oid
 * @return Whether the object exists
 */
public boolean isOidUsed(long oid){
  checkActive();
  ZooPCImpl co=cache.findCoByOID(oid);
  if (co != null) {
    return true;
  }
  GenericObject go=cache.getGeneric(oid);
  if (go != null) {
    return true;
  }
  for (  Node n : nodes) {
    if (n.checkIfObjectExists(oid)) {
      return true;
    }
  }
  return false;
}
Program: 98092
Project: 98092
Buggy source:
public ZooHandleImpl getHandle(long oid){
  checkOpen();
  GenericObject gob=cache.getGeneric(oid);
  if (gob != null) {
    return gob.getOrCreateHandle();
  }
  ZooPCImpl co=cache.findCoByOID(oid);
  if (co != null) {
    if (co.jdoZooIsNew() || co.jdoZooIsDirty()) {
      throw new UnsupportedOperationException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ Util.getOidAsString(co));
    }
    ZooClassDef schema=co.jdoZooGetClassDef();
    GenericObject go=co.jdoZooGetNode().readGenericObject(schema,oid);
    return go.getOrCreateHandle();
  }
  try {
    for (    Node n : nodes) {
      ZooClassProxy schema=getSchemaManager().locateSchemaForObject(oid,n);
      GenericObject go=n.readGenericObject(schema.getSchemaDef(),oid);
      return go.getOrCreateHandle();
    }
  }
 catch (  RuntimeException e) {
    if (!DBLogger.isObjectNotFoundException(e)) {
      throw e;
    }
  }
  return null;
}

Fixed version (ground truth):
public ZooHandleImpl getHandle(long oid){
  checkActive();
  GenericObject gob=cache.getGeneric(oid);
  if (gob != null) {
    return gob.getOrCreateHandle();
  }
  ZooPCImpl co=cache.findCoByOID(oid);
  if (co != null) {
    if (co.jdoZooIsNew() || co.jdoZooIsDirty()) {
      throw new UnsupportedOperationException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ Util.getOidAsString(co));
    }
    ZooClassDef schema=co.jdoZooGetClassDef();
    GenericObject go=co.jdoZooGetNode().readGenericObject(schema,oid);
    return go.getOrCreateHandle();
  }
  try {
    for (    Node n : nodes) {
      ZooClassProxy schema=getSchemaManager().locateSchemaForObject(oid,n);
      GenericObject go=n.readGenericObject(schema.getSchemaDef(),oid);
      return go.getOrCreateHandle();
    }
  }
 catch (  RuntimeException e) {
    if (!DBLogger.isObjectNotFoundException(e)) {
      throw e;
    }
  }
  return null;
}
Program: 98093
Project: 98093
Buggy source:
public void deletePersistent(Object pc){
  checkOpen();
  ZooPCImpl co=checkObject(pc);
  co.jdoZooMarkDeleted();
}

Fixed version (ground truth):
public void deletePersistent(Object pc){
  checkActive();
  ZooPCImpl co=checkObject(pc);
  co.jdoZooMarkDeleted();
}