Program: 68408
Project: 68408
Buggy source:
public void testResultSetFetchSizeReset(Session session){
  ReadAllQuery query=new ReadAllQuery(QueryOptionEmployee.class);
  query.useScrollableCursor();
  String sql="String_Node_Str";
  int fetchSize=100;
  query.setSQLString(sql);
  query.setFetchSize(fetchSize);
  org.eclipse.persistence.internal.sessions.DatabaseSessionImpl impl=(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl)session;
  DatabaseAccessor accessor=(DatabaseAccessor)impl.getAccessor();
  Hashtable statementCache=null;
  try {
    Method method=PrivilegedAccessHelper.getDeclaredMethod(DatabaseAccessor.class,"String_Node_Str",new Class[]{});
    method.setAccessible(true);
    statementCache=(Hashtable)method.invoke(accessor,new Object[]{});
  }
 catch (  Exception nsme) {
    throwError("String_Node_Str",nsme);
  }
  int previousFetchSize=0;
  Statement statement=(Statement)statementCache.get(sql);
  if (statement != null) {
    try {
      previousFetchSize=statement.getFetchSize();
    }
 catch (    SQLException sqle) {
      throwError("String_Node_Str",sqle);
    }
  }
  ScrollableCursor cursor=(ScrollableCursor)session.executeQuery(query);
  List employees=new ArrayList();
  while (cursor.hasNext()) {
    employees.add(cursor.next());
  }
  cursor.close();
  int postQueryFetchSize=0;
  statement=(Statement)statementCache.get(sql);
  if (statement != null) {
    try {
      postQueryFetchSize=statement.getFetchSize();
    }
 catch (    SQLException sqle) {
      throwError("String_Node_Str",sqle);
    }
  }
  if (postQueryFetchSize == fetchSize) {
    throwError("String_Node_Str");
  }
}

Fixed version (ground truth):
public void testResultSetFetchSizeReset(Session session){
  ReadAllQuery query=new ReadAllQuery(QueryOptionEmployee.class);
  if (TYPE_SCROLL_INSENSITIVE_isSupported && CONCUR_UPDATABLE_isSupported) {
    query.useScrollableCursor(2);
  }
 else {
    ScrollableCursorPolicy policy=new ScrollableCursorPolicy();
    if (!TYPE_SCROLL_INSENSITIVE_isSupported) {
      policy.setResultSetType(ScrollableCursorPolicy.TYPE_SCROLL_SENSITIVE);
    }
    if (!CONCUR_UPDATABLE_isSupported) {
      policy.setResultSetConcurrency(ScrollableCursorPolicy.CONCUR_READ_ONLY);
    }
    policy.setPageSize(10);
    query.useScrollableCursor(policy);
  }
  String sql="String_Node_Str";
  int fetchSize=100;
  query.setSQLString(sql);
  query.setFetchSize(fetchSize);
  org.eclipse.persistence.internal.sessions.DatabaseSessionImpl impl=(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl)session;
  DatabaseAccessor accessor=(DatabaseAccessor)impl.getAccessor();
  Hashtable statementCache=null;
  try {
    Method method=PrivilegedAccessHelper.getDeclaredMethod(DatabaseAccessor.class,"String_Node_Str",new Class[]{});
    method.setAccessible(true);
    statementCache=(Hashtable)method.invoke(accessor,new Object[]{});
  }
 catch (  Exception nsme) {
    throwError("String_Node_Str",nsme);
  }
  int previousFetchSize=0;
  Statement statement=(Statement)statementCache.get(sql);
  if (statement != null) {
    try {
      previousFetchSize=statement.getFetchSize();
    }
 catch (    SQLException sqle) {
      throwError("String_Node_Str",sqle);
    }
  }
  ScrollableCursor cursor=(ScrollableCursor)session.executeQuery(query);
  List employees=new ArrayList();
  while (cursor.hasNext()) {
    employees.add(cursor.next());
  }
  cursor.close();
  int postQueryFetchSize=0;
  statement=(Statement)statementCache.get(sql);
  if (statement != null) {
    try {
      postQueryFetchSize=statement.getFetchSize();
    }
 catch (    SQLException sqle) {
      throwError("String_Node_Str",sqle);
    }
  }
  if (postQueryFetchSize == fetchSize) {
    throwError("String_Node_Str");
  }
}