nus-yam/ex-repair huggingface dataset:
Program: 80101
Project: 80101
Buggy source:
private void _testPreStartedSlave(){
  Connection conn=null;
  String db=slaveDatabasePath + "String_Node_Str" + ReplicationRun.slaveDbSubPath+ "String_Node_Str"+ replicatedDb;
  String connectionURL="String_Node_Str" + "String_Node_Str" + slaveServerHost + "String_Node_Str"+ slaveServerPort+ "String_Node_Str"+ db+ "String_Node_Str"+ "String_Node_Str"+ slaveServerHost+ "String_Node_Str"+ slaveReplPort;
  util.DEBUG("String_Node_Str" + connectionURL);
  if (true)   return;
  try {
    conn=DriverManager.getConnection(connectionURL);
    util.DEBUG("String_Node_Str" + connectionURL);
  }
 catch (  SQLException se) {
    int ec=se.getErrorCode();
    String ss=se.getSQLState();
    String msg=ec + "String_Node_Str" + ss+ "String_Node_Str"+ se.getMessage();
    util.DEBUG(msg);
    assertTrue("String_Node_Str" + msg,SQLState.REPLICATION_SLAVE_STARTED_OK.equals(ss));
  }
  try {
    conn=DriverManager.getConnection(connectionURL);
    util.DEBUG("String_Node_Str" + connectionURL);
    assertTrue("String_Node_Str" + connectionURL,false);
  }
 catch (  SQLException se) {
    int ec=se.getErrorCode();
    String ss=se.getSQLState();
    String msg=ec + "String_Node_Str" + ss+ "String_Node_Str"+ se.getMessage();
    util.DEBUG(msg);
    assertTrue("String_Node_Str" + msg,SQLState.LOGIN_FAILED.equals(ss));
  }
}

Fixed version (ground truth):
private void _testPreStartedSlave(){
  Connection conn=null;
  String db=slaveDatabasePath + FS + ReplicationRun.slaveDbSubPath+ FS+ replicatedDb;
  String connectionURL="String_Node_Str" + "String_Node_Str" + slaveServerHost + "String_Node_Str"+ slaveServerPort+ "String_Node_Str"+ db+ "String_Node_Str"+ "String_Node_Str"+ slaveServerHost+ "String_Node_Str"+ slaveReplPort;
  util.DEBUG("String_Node_Str" + connectionURL);
  if (true)   return;
  try {
    conn=DriverManager.getConnection(connectionURL);
    util.DEBUG("String_Node_Str" + connectionURL);
  }
 catch (  SQLException se) {
    int ec=se.getErrorCode();
    String ss=se.getSQLState();
    String msg=ec + "String_Node_Str" + ss+ "String_Node_Str"+ se.getMessage();
    util.DEBUG(msg);
    assertTrue("String_Node_Str" + msg,SQLState.REPLICATION_SLAVE_STARTED_OK.equals(ss));
  }
  try {
    conn=DriverManager.getConnection(connectionURL);
    util.DEBUG("String_Node_Str" + connectionURL);
    assertTrue("String_Node_Str" + connectionURL,false);
  }
 catch (  SQLException se) {
    int ec=se.getErrorCode();
    String ss=se.getSQLState();
    String msg=ec + "String_Node_Str" + ss+ "String_Node_Str"+ se.getMessage();
    util.DEBUG(msg);
    assertTrue("String_Node_Str" + msg,SQLState.LOGIN_FAILED.equals(ss));
  }
}
Program: 80104
Project: 80104
Buggy source:
private void _testPreStartedMasterServer(){
  Connection conn=null;
  String db=masterDatabasePath + "String_Node_Str" + ReplicationRun.masterDbSubPath+ "String_Node_Str"+ replicatedDb;
  String connectionURL="String_Node_Str" + "String_Node_Str" + masterServerHost + "String_Node_Str"+ masterServerPort+ "String_Node_Str"+ db+ "String_Node_Str"+ "String_Node_Str"+ slaveServerHost+ "String_Node_Str"+ slaveServerPort;
  util.DEBUG("String_Node_Str" + connectionURL);
  try {
    conn=DriverManager.getConnection(connectionURL);
  }
 catch (  SQLException se) {
    int ec=se.getErrorCode();
    String ss=se.getSQLState();
    String msg=ec + "String_Node_Str" + ss+ "String_Node_Str"+ se.getMessage();
    util.DEBUG("String_Node_Str" + msg);
    assertTrue("String_Node_Str" + msg,"String_Node_Str".equals(ss));
    util.DEBUG("String_Node_Str");
    return;
  }
  assertTrue("String_Node_Str" + db + "String_Node_Str",false);
}

Fixed version (ground truth):
private void _testPreStartedMasterServer(){
  Connection conn=null;
  String db=masterDatabasePath + FS + ReplicationRun.masterDbSubPath+ FS+ replicatedDb;
  String connectionURL="String_Node_Str" + "String_Node_Str" + masterServerHost + "String_Node_Str"+ masterServerPort+ "String_Node_Str"+ db+ "String_Node_Str"+ "String_Node_Str"+ slaveServerHost+ "String_Node_Str"+ slaveServerPort;
  util.DEBUG("String_Node_Str" + connectionURL);
  try {
    conn=DriverManager.getConnection(connectionURL);
  }
 catch (  SQLException se) {
    int ec=se.getErrorCode();
    String ss=se.getSQLState();
    String msg=ec + "String_Node_Str" + ss+ "String_Node_Str"+ se.getMessage();
    util.DEBUG("String_Node_Str" + msg);
    assertTrue("String_Node_Str" + msg,"String_Node_Str".equals(ss));
    util.DEBUG("String_Node_Str");
    return;
  }
  assertTrue("String_Node_Str" + db + "String_Node_Str",false);
}
Program: 80105
Project: 80105
Buggy source:
public SSLTest(String testName){
  super(testName);
  _inputStreamHolder=new InputStream[1];
}

Fixed version (ground truth):
public SSLTest(String testName){
  super(testName);
}
Program: 80106
Project: 80106
Buggy source:
/** 
 * <p> Compose the required decorators to bring up the server in the correct configuration. </p>
 */
private static Test decorateTest(String testName){
  SSLTest sslTest=new SSLTest(testName);
  String[] startupProperties=getStartupProperties();
  String[] startupArgs=new String[]{};
  NetworkServerTestSetup networkServerTestSetup=new NetworkServerTestSetup(sslTest,startupProperties,startupArgs,true,sslTest._inputStreamHolder);
  Test testSetup=SecurityManagerSetup.noSecurityManager(networkServerTestSetup);
  testSetup=new SupportFilesSetup(testSetup,null,new String[]{"String_Node_Str"},null,new String[]{"String_Node_Str"});
  Test test=TestConfiguration.defaultServerDecorator(testSetup);
  test=TestConfiguration.changeSSLDecorator(test,"String_Node_Str");
  return test;
}

Fixed version (ground truth):
/** 
 * <p> Compose the required decorators to bring up the server in the correct configuration. </p>
 */
private static Test decorateTest(String testName){
  SSLTest sslTest=new SSLTest(testName);
  String[] startupProperties=getStartupProperties();
  String[] startupArgs=new String[]{};
  NetworkServerTestSetup networkServerTestSetup=new NetworkServerTestSetup(sslTest,startupProperties,startupArgs,true);
  Test testSetup=SecurityManagerSetup.noSecurityManager(networkServerTestSetup);
  testSetup=new SupportFilesSetup(testSetup,null,new String[]{"String_Node_Str"},null,new String[]{"String_Node_Str"});
  Test test=TestConfiguration.defaultServerDecorator(testSetup);
  test=TestConfiguration.changeSSLDecorator(test,"String_Node_Str");
  return test;
}
Program: 80107
Project: 80107
Buggy source:
/** 
 * <p> Compose the required decorators to bring up the server in the correct configuration. </p>
 */
private static Test decorateTest(boolean unsecureSet,boolean authenticationRequired,String customDerbyProperties,String wildCardHost,Outcome outcome){
  SecureServerTest secureServerTest=new SecureServerTest(unsecureSet,authenticationRequired,customDerbyProperties,wildCardHost,outcome);
  String[] startupProperties=getStartupProperties(authenticationRequired,customDerbyProperties);
  String[] startupArgs=getStartupArgs(unsecureSet,wildCardHost);
  NetworkServerTestSetup networkServerTestSetup=new NetworkServerTestSetup(secureServerTest,startupProperties,startupArgs,secureServerTest._outcome.serverShouldComeUp(),secureServerTest._inputStreamHolder);
  secureServerTest.nsTestSetup=networkServerTestSetup;
  Test testSetup=SecurityManagerSetup.noSecurityManager(networkServerTestSetup);
  if (customDerbyProperties != null) {
    testSetup=new SupportFilesSetup(testSetup,null,new String[]{"String_Node_Str"},null,new String[]{"String_Node_Str"});
  }
  Test test=TestConfiguration.defaultServerDecorator(testSetup);
  test=TestConfiguration.changeUserDecorator(test,SST_USER_NAME,SST_PASSWORD);
  return test;
}

Fixed version (ground truth):
/** 
 * <p> Compose the required decorators to bring up the server in the correct configuration. </p>
 */
private static Test decorateTest(boolean unsecureSet,boolean authenticationRequired,String customDerbyProperties,String wildCardHost,Outcome outcome){
  SecureServerTest secureServerTest=new SecureServerTest(unsecureSet,authenticationRequired,customDerbyProperties,wildCardHost,outcome);
  String[] startupProperties=getStartupProperties(authenticationRequired,customDerbyProperties);
  String[] startupArgs=getStartupArgs(unsecureSet,wildCardHost);
  NetworkServerTestSetup networkServerTestSetup=new NetworkServerTestSetup(secureServerTest,startupProperties,startupArgs,secureServerTest._outcome.serverShouldComeUp());
  secureServerTest.nsTestSetup=networkServerTestSetup;
  Test testSetup=SecurityManagerSetup.noSecurityManager(networkServerTestSetup);
  if (customDerbyProperties != null) {
    testSetup=new SupportFilesSetup(testSetup,null,new String[]{"String_Node_Str"},null,new String[]{"String_Node_Str"});
  }
  Test test=TestConfiguration.defaultServerDecorator(testSetup);
  test=TestConfiguration.changeUserDecorator(test,SST_USER_NAME,SST_PASSWORD);
  return test;
}
Program: 80108
Project: 80108
Buggy source:
/** 
 * <p> Run a NetworkServerControl command. </p>
 */
private String runServerCommand(String commandSpecifics) throws Exception {
  String portNumber=Integer.toString(getTestConfiguration().getPort());
  StringBuffer buffer=new StringBuffer();
  String classpath=getSystemProperty("String_Node_Str");
  buffer.append("String_Node_Str");
  buffer.append(classpath);
  buffer.append("String_Node_Str");
  buffer.append("String_Node_Str" + portNumber + "String_Node_Str"+ commandSpecifics);
  final String command=buffer.toString();
  println("String_Node_Str" + command);
  Process serverProcess=(Process)AccessController.doPrivileged(new PrivilegedAction(){
    public Object run(){
      Process result=null;
      try {
        result=Runtime.getRuntime().exec(command);
      }
 catch (      Exception ex) {
        ex.printStackTrace();
      }
      return result;
    }
  }
);
  InputStream is=serverProcess.getInputStream();
  return getProcessOutput(is,10000);
}

Fixed version (ground truth):
/** 
 * <p> Run a NetworkServerControl command. </p>
 */
private String runServerCommand(String commandSpecifics) throws Exception {
  String portNumber=Integer.toString(getTestConfiguration().getPort());
  StringBuffer buffer=new StringBuffer();
  String classpath=getSystemProperty("String_Node_Str");
  buffer.append("String_Node_Str");
  buffer.append(classpath);
  buffer.append("String_Node_Str");
  buffer.append("String_Node_Str" + portNumber + "String_Node_Str"+ commandSpecifics);
  final String command=buffer.toString();
  println("String_Node_Str" + command);
  Process serverProcess=(Process)AccessController.doPrivileged(new PrivilegedAction(){
    public Object run(){
      Process result=null;
      try {
        result=Runtime.getRuntime().exec(command);
      }
 catch (      Exception ex) {
        ex.printStackTrace();
      }
      return result;
    }
  }
);
  SpawnedProcess spawned=new SpawnedProcess(serverProcess,commandSpecifics);
  assertEquals(0,spawned.complete(false));
  return spawned.getFullServerOutput();
}
Program: 80109
Project: 80109
Buggy source:
private String getServerOutput() throws Exception {
  return getProcessOutput(_inputStreamHolder[0],1000);
}

Fixed version (ground truth):
private String getServerOutput() throws Exception {
  return nsTestSetup.getServerProcess().getNextServerOutput();
}
Program: 80110
Project: 80110
Buggy source:
private boolean serverCameUp() throws Exception {
  return NetworkServerTestSetup.pingForServerUp(NetworkServerTestSetup.getNetworkServerControl(),nsTestSetup.getServerProcess(),true);
}

Fixed version (ground truth):
private boolean serverCameUp() throws Exception {
  return NetworkServerTestSetup.pingForServerUp(NetworkServerTestSetup.getNetworkServerControl(),nsTestSetup.getServerProcess().getProcess(),true);
}
Program: 80111
Project: 80111
Buggy source:
public SecureServerTest(boolean unsecureSet,boolean authenticationRequired,String customDerbyProperties,String wildCardHost,Outcome outcome){
  super("String_Node_Str");
  _unsecureSet=unsecureSet;
  _authenticationRequired=authenticationRequired;
  _customDerbyProperties=customDerbyProperties;
  _wildCardHost=wildCardHost;
  _outcome=outcome;
  _inputStreamHolder=new InputStream[1];
}

Fixed version (ground truth):
public SecureServerTest(boolean unsecureSet,boolean authenticationRequired,String customDerbyProperties,String wildCardHost,Outcome outcome){
  super("String_Node_Str");
  _unsecureSet=unsecureSet;
  _authenticationRequired=authenticationRequired;
  _customDerbyProperties=customDerbyProperties;
  _wildCardHost=wildCardHost;
  _outcome=outcome;
}
Program: 80112
Project: 80112
Buggy source:
/** 
 * <p> Compose the required decorators to bring up the server in the correct configuration. </p>
 */
private static Test decorateTest(String testName,String[] startupProperties,String[] startupArgs,boolean startServer){
  ServerPropertiesTest spt=new ServerPropertiesTest(testName);
  String[] startupProps;
  if (startupProperties == null)   startupProps=new String[]{};
 else   startupProps=startupProperties;
  if (startupArgs == null)   startupArgs=new String[]{};
  NetworkServerTestSetup networkServerTestSetup;
  if (startServer) {
    networkServerTestSetup=new NetworkServerTestSetup(spt,startupProps,startupArgs,true,spt._inputStreamHolder);
  }
 else {
    networkServerTestSetup=new NetworkServerTestSetup(spt,true,false);
  }
  Test test=decorateWithPolicy(networkServerTestSetup);
  test=TestConfiguration.defaultServerDecorator(test);
  return test;
}

Fixed version (ground truth):
/** 
 * <p> Compose the required decorators to bring up the server in the correct configuration. </p>
 */
private static Test decorateTest(String testName,String[] startupProperties,String[] startupArgs,boolean startServer){
  ServerPropertiesTest spt=new ServerPropertiesTest(testName);
  String[] startupProps;
  if (startupProperties == null)   startupProps=new String[]{};
 else   startupProps=startupProperties;
  if (startupArgs == null)   startupArgs=new String[]{};
  NetworkServerTestSetup networkServerTestSetup;
  if (startServer) {
    networkServerTestSetup=new NetworkServerTestSetup(spt,startupProps,startupArgs,true);
  }
 else {
    networkServerTestSetup=new NetworkServerTestSetup(spt,true,false);
  }
  Test test=decorateWithPolicy(networkServerTestSetup);
  test=TestConfiguration.defaultServerDecorator(test);
  return test;
}
Program: 80113
Project: 80113
Buggy source:
public void tearDown() throws Exception {
  super.tearDown();
  POLICY_FILE_NAME=null;
  TARGET_POLICY_FILE_NAME=null;
  _inputStreamHolder=null;
  if (portsSoFar != null) {
    for (int i=0; i < portsSoFar.length; i++) {
      try {
        shutdownServer(portsSoFar[i],true);
      }
 catch (      SQLException e) {
        fail("String_Node_Str" + portsSoFar[i]);
      }
    }
    portsSoFar=null;
  }
}

Fixed version (ground truth):
public void tearDown() throws Exception {
  super.tearDown();
  POLICY_FILE_NAME=null;
  TARGET_POLICY_FILE_NAME=null;
  if (portsSoFar != null) {
    for (int i=0; i < portsSoFar.length; i++) {
      try {
        shutdownServer(portsSoFar[i],true);
      }
 catch (      SQLException e) {
        fail("String_Node_Str" + portsSoFar[i]);
      }
    }
    portsSoFar=null;
  }
}
Program: 80114
Project: 80114
Buggy source:
public ServerPropertiesTest(String name){
  super(name);
  _inputStreamHolder=new InputStream[1];
}

Fixed version (ground truth):
public ServerPropertiesTest(String name){
  super(name);
}
Program: 80115
Project: 80115
Buggy source:
protected static Test suite(Class testClass,String suiteName){
  TestSuite outerSuite=new TestSuite(suiteName);
  Test platform=new TestSuite(testClass,suiteName + "String_Node_Str");
  platform=TestConfiguration.clientServerDecorator(platform);
  platform=JMXConnectionDecorator.platformMBeanServer(platform);
  platform=SecurityManagerSetup.noSecurityManager(platform);
  outerSuite.addTest(platform);
  Test suite=new TestSuite(testClass,suiteName + "String_Node_Str");
  suite=JMXConnectionDecorator.remoteNoSecurity(suite);
  NetworkServerTestSetup networkServerTestSetup=new NetworkServerTestSetup(suite,getCommandLineProperties(),new String[0],true,new InputStream[1]);
  Test testSetup=SecurityManagerSetup.noSecurityManager(networkServerTestSetup);
  outerSuite.addTest(TestConfiguration.defaultServerDecorator(testSetup));
  return outerSuite;
}

Fixed version (ground truth):
protected static Test suite(Class testClass,String suiteName){
  TestSuite outerSuite=new TestSuite(suiteName);
  Test platform=new TestSuite(testClass,suiteName + "String_Node_Str");
  platform=TestConfiguration.clientServerDecorator(platform);
  platform=JMXConnectionDecorator.platformMBeanServer(platform);
  platform=SecurityManagerSetup.noSecurityManager(platform);
  outerSuite.addTest(platform);
  Test suite=new TestSuite(testClass,suiteName + "String_Node_Str");
  suite=JMXConnectionDecorator.remoteNoSecurity(suite);
  NetworkServerTestSetup networkServerTestSetup=new NetworkServerTestSetup(suite,getCommandLineProperties(),new String[0],true);
  Test testSetup=SecurityManagerSetup.noSecurityManager(networkServerTestSetup);
  outerSuite.addTest(TestConfiguration.defaultServerDecorator(testSetup));
  return outerSuite;
}
Program: 80116
Project: 80116
Buggy source:
/** 
 * Initializer for a RowNumberColumn node
 * @paran arg1 The window definition
 * @exception StandardException
 */
public void init(Object arg1) throws StandardException {
  this.init();
  setWindowNode((WindowNode)arg1);
}

Fixed version (ground truth):
/** 
 * Initializer for a RowNumberColumn node
 * @param arg1 The window definition
 * @exception StandardException
 */
public void init(Object arg1) throws StandardException {
  this.init();
  setWindowNode((WindowNode)arg1);
}
Program: 80117
Project: 80117
Buggy source:
/** 
 * setWindowNode
 * @param the WindowNode with the window definition for this window function column 
 */
public void setWindowNode(WindowNode wn){
  this.windowNode=wn;
}

Fixed version (ground truth):
/** 
 * setWindowNode
 * @param wn The WindowNode with the window definition for this window function column 
 */
public void setWindowNode(WindowNode wn){
  this.windowNode=wn;
}
Program: 80118
Project: 80118
Buggy source:
/** 
 * Window functions do not have a (base)tablename, so we return null.
 * @override
 */
public String getTableName(){
  return null;
}

Fixed version (ground truth):
/** 
 * Window functions do not have a (base)tablename, so we return null. Overrides method from parent class.
 */
public String getTableName(){
  return null;
}
Program: 80119
Project: 80119
Buggy source:
/** 
 * Set the windowFunctionLevel of this WindowNode in case there are  multiple window functions in a RCL.
 * @param the window function level of this window function column 
 */
public void setWindowFunctionLevel(int level){
  this.windowFunctionLevel=level;
}

Fixed version (ground truth):
/** 
 * Set the windowFunctionLevel of this WindowNode in case there are  multiple window functions in a RCL.
 * @param level The window function level of this window function column 
 */
public void setWindowFunctionLevel(int level){
  this.windowFunctionLevel=level;
}
Program: 80120
Project: 80120
Buggy source:
/** 
 * Get a catalog type that corresponds to a SQL Row Multiset
 * @param columnNames   Names of the columns in the Row Muliset
 * @param types                 Types of the columns in the Row Muliset
 * @return	A new DataTypeDescriptor describing the SQL Row Multiset
 */
public static TypeDescriptor getRowMultiSet(String[] columnNames,TypeDescriptor[] catalogTypes){
  RowMultiSetImpl rms=new RowMultiSetImpl(columnNames,catalogTypes);
  TypeId typeID=new TypeId(StoredFormatIds.ROW_MULTISET_CATALOG_ID,rms);
  return new DataTypeDescriptor(typeID,true).getCatalogType();
}

Fixed version (ground truth):
/** 
 * Get a catalog type that corresponds to a SQL Row Multiset
 * @param columnNames   Names of the columns in the Row Muliset
 * @param catalogTypes  Types of the columns in the Row Muliset
 * @return	A new DataTypeDescriptor describing the SQL Row Multiset
 */
public static TypeDescriptor getRowMultiSet(String[] columnNames,TypeDescriptor[] catalogTypes){
  RowMultiSetImpl rms=new RowMultiSetImpl(columnNames,catalogTypes);
  TypeId typeID=new TypeId(StoredFormatIds.ROW_MULTISET_CATALOG_ID,rms);
  return new DataTypeDescriptor(typeID,true).getCatalogType();
}
Program: 80121
Project: 80121
Buggy source:
/** 
 * Return locator for this lob.
 * @return
 */
public int getLocator(){
  return locator;
}

Fixed version (ground truth):
/** 
 * Return locator for this lob.
 * @return The locator identifying this lob.
 */
public int getLocator(){
  return locator;
}
Program: 80122
Project: 80122
Buggy source:
/** 
 * Private helper method. Runs the same test for different generated identity columns.
 * @param dataType SMALLINT, INT, or BIGINT
 * @param generatedType BY DEFAULT or ALWAYS
 * @throws Exception all errors passed on to JUnit
 */
private void testGeneratedIdentity(String dataType,String generateType) throws Exception {
  Statement s=createStatement();
  s.execute("String_Node_Str" + dataType + "String_Node_Str"+ generateType+ "String_Node_Str"+ "String_Node_Str");
  PreparedStatement implicit=prepareStatement("String_Node_Str");
  implicit.executeUpdate();
  implicit.executeUpdate();
  implicit.executeUpdate();
  PreparedStatement explicit=prepareStatement("String_Node_Str" + "String_Node_Str");
  explicit.executeUpdate();
  explicit.executeUpdate();
  explicit.executeUpdate();
}

Fixed version (ground truth):
/** 
 * Private helper method. Runs the same test for different generated identity columns.
 * @param dataType SMALLINT, INT, or BIGINT
 * @param generatedType BY DEFAULT or ALWAYS
 * @throws Exception all errors passed on to JUnit
 */
private void testGeneratedIdentity(String dataType,String generatedType) throws Exception {
  Statement s=createStatement();
  s.execute("String_Node_Str" + dataType + "String_Node_Str"+ generatedType+ "String_Node_Str"+ "String_Node_Str");
  PreparedStatement implicit=prepareStatement("String_Node_Str");
  implicit.executeUpdate();
  implicit.executeUpdate();
  implicit.executeUpdate();
  PreparedStatement explicit=prepareStatement("String_Node_Str" + "String_Node_Str");
  explicit.executeUpdate();
  explicit.executeUpdate();
  explicit.executeUpdate();
}
Program: 80124
Project: 80124
Buggy source:
public void testAmbigiousMethods() throws SQLException {
  Connection conn=getConnection();
  Statement s=createStatement();
  s.execute("String_Node_Str");
  assertCallError("String_Node_Str",conn,"String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  assertCallError("String_Node_Str",conn,"String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.close();
}

Fixed version (ground truth):
public void testAmbigiousMethods() throws SQLException {
  Statement s=createStatement();
  s.execute("String_Node_Str");
  assertCallError("String_Node_Str","String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  assertCallError("String_Node_Str","String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.close();
}
Program: 80126
Project: 80126
Buggy source:
/** 
 * Tests the exception that gets thrown at runtime when the external method for a SQL procedure doesn't exist -- there's no check for existence at CREATE time, the check occurs at runtime.
 * @throws SQLException
 */
public void testDelayedClassChecking() throws SQLException {
  Connection conn=getConnection();
  Statement s=createStatement();
  s.execute("String_Node_Str" + "String_Node_Str");
  s.execute("String_Node_Str" + "String_Node_Str");
  s.execute("String_Node_Str" + "String_Node_Str");
  s.execute("String_Node_Str" + "String_Node_Str");
  assertCallError("String_Node_Str",conn,"String_Node_Str");
  assertCallError("String_Node_Str",conn,"String_Node_Str");
  assertCallError("String_Node_Str",conn,"String_Node_Str");
  assertCallError("String_Node_Str",conn,"String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.close();
}

Fixed version (ground truth):
/** 
 * Tests the exception that gets thrown at runtime when the external method for a SQL procedure doesn't exist -- there's no check for existence at CREATE time, the check occurs at runtime.
 * @throws SQLException
 */
public void testDelayedClassChecking() throws SQLException {
  Statement s=createStatement();
  s.execute("String_Node_Str" + "String_Node_Str");
  s.execute("String_Node_Str" + "String_Node_Str");
  s.execute("String_Node_Str" + "String_Node_Str");
  s.execute("String_Node_Str" + "String_Node_Str");
  assertCallError("String_Node_Str","String_Node_Str");
  assertCallError("String_Node_Str","String_Node_Str");
  assertCallError("String_Node_Str","String_Node_Str");
  assertCallError("String_Node_Str","String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.execute("String_Node_Str");
  s.close();
}
Program: 80128
Project: 80128
Buggy source:
public static void sqlControl4(int sqlc,String[] e1,String[] e2,String[] e3,String[] e4,String[] e5,String[] e6,String[] e7,String[] e8) throws SQLException {
  Connection conn=DriverManager.getConnection("String_Node_Str");
  Statement s=conn.createStatement();
  String sql="String_Node_Str" + sqlc + "String_Node_Str";
  e1[0]=sql;
  CallableStatement cs1=conn.prepareCall(sql);
  try {
    for (int rop=1; rop <= 7; rop++) {
      cs1.registerOutParameter(rop,Types.VARCHAR);
    }
    cs1.execute();
    e2[0]=cs1.getString(1);
    e3[0]=cs1.getString(2);
    e4[0]=cs1.getString(3);
    e5[0]=cs1.getString(4);
    e6[0]=cs1.getString(5);
    e7[0]=cs1.getString(6);
    e8[0]=cs1.getString(7);
  }
 catch (  SQLException sqle) {
    StringBuffer sb=new StringBuffer(128);
    sb.append("String_Node_Str");
    do {
      sb.append("String_Node_Str");
      String ss=sqle.getSQLState();
      if (ss == null)       ss="String_Node_Str";
      sb.append(ss);
      sqle=sqle.getNextException();
    }
 while (sqle != null);
    e2[0]=sb.toString();
  }
  cs1.close();
  conn.close();
}

Fixed version (ground truth):
public static void sqlControl4(int sqlc,String[] e1,String[] e2,String[] e3,String[] e4,String[] e5,String[] e6,String[] e7,String[] e8) throws SQLException {
  Connection conn=DriverManager.getConnection("String_Node_Str");
  String sql="String_Node_Str" + sqlc + "String_Node_Str";
  e1[0]=sql;
  CallableStatement cs1=conn.prepareCall(sql);
  try {
    for (int rop=1; rop <= 7; rop++) {
      cs1.registerOutParameter(rop,Types.VARCHAR);
    }
    cs1.execute();
    e2[0]=cs1.getString(1);
    e3[0]=cs1.getString(2);
    e4[0]=cs1.getString(3);
    e5[0]=cs1.getString(4);
    e6[0]=cs1.getString(5);
    e7[0]=cs1.getString(6);
    e8[0]=cs1.getString(7);
  }
 catch (  SQLException sqle) {
    StringBuffer sb=new StringBuffer(128);
    sb.append("String_Node_Str");
    do {
      sb.append("String_Node_Str");
      String ss=sqle.getSQLState();
      if (ss == null)       ss="String_Node_Str";
      sb.append(ss);
      sqle=sqle.getNextException();
    }
 while (sqle != null);
    e2[0]=sb.toString();
  }
  cs1.close();
  conn.close();
}
Program: 80131
Project: 80131
Buggy source:
/** 
 * Executes the Callable statement that is expected to fail and verifies that it throws the expected SQL exception.
 * @param expectedSE The expected SQL exception
 * @param conn The Connection handle
 * @param callSQL The SQL to execute
 * @throws SQLException
 */
public static void assertCallError(String expectedSE,Connection conn,String callSQL) throws SQLException {
  try {
    CallableStatement cs=conn.prepareCall(callSQL);
    cs.execute();
    fail("String_Node_Str");
  }
 catch (  SQLException se) {
    assertSQLState(expectedSE,se.getSQLState(),se);
  }
}

Fixed version (ground truth):
/** 
 * Executes the Callable statement that is expected to fail and verifies that it throws the expected SQL exception.
 * @param expectedSE The expected SQL exception
 * @param callSQL The SQL to execute
 * @throws SQLException
 */
public void assertCallError(String expectedSE,String callSQL) throws SQLException {
  try {
    CallableStatement cs=prepareCall(callSQL);
    cs.execute();
    fail("String_Node_Str");
  }
 catch (  SQLException se) {
    assertSQLState(expectedSE,se);
  }
}
Program: 80133
Project: 80133
Buggy source:
/** 
 * Iterate through all optimizables in the current proposedJoinOrder and find the accumulated sum of their estimated costs.  This method is used to 'recover' cost estimate sums that have been lost due to the addition/subtraction of the cost estimate for the Optimizable at position "joinPosition".  Ex. If the total cost for Optimizables at positions < joinPosition is 1500, and then the Optimizable at joinPosition has an estimated cost of 3.14E40, adding those two numbers effectively "loses" the 1500. When we later subtract 3.14E40 from the total cost estimate (as part of "pull" processing), we'll end up with 0 as the result--which is wrong. This method allows us to recover the "1500" that we lost in the process of adding and subtracting 3.14E40.
 */
private double recoverCostFromProposedJoinOrder() throws StandardException {
  double recoveredCost=0.0d;
  for (int i=0; i < joinPosition; i++) {
    recoveredCost+=optimizableList.getOptimizable(proposedJoinOrder[i]).getBestAccessPath().getCostEstimate().getEstimatedCost();
  }
  return recoveredCost;
}

Fixed version (ground truth):
/** 
 * Iterate through all optimizables in the current proposedJoinOrder and find the accumulated sum of their estimated costs.  This method is used to 'recover' cost estimate sums that have been lost due to the addition/subtraction of the cost estimate for the Optimizable at position "joinPosition".  Ex. If the total cost for Optimizables at positions < joinPosition is 1500, and then the Optimizable at joinPosition has an estimated cost of 3.14E40, adding those two numbers effectively "loses" the 1500. When we later subtract 3.14E40 from the total cost estimate (as part of "pull" processing), we'll end up with 0 as the result--which is wrong. This method allows us to recover the "1500" that we lost in the process of adding and subtracting 3.14E40.
 */
private double recoverCostFromProposedJoinOrder(boolean sortAvoidance) throws StandardException {
  double recoveredCost=0.0d;
  for (int i=0; i < joinPosition; i++) {
    if (sortAvoidance) {
      recoveredCost+=optimizableList.getOptimizable(proposedJoinOrder[i]).getBestSortAvoidancePath().getCostEstimate().getEstimatedCost();
    }
 else {
      recoveredCost+=optimizableList.getOptimizable(proposedJoinOrder[i]).getBestAccessPath().getCostEstimate().getEstimatedCost();
    }
  }
  return recoveredCost;
}
Program: 80134
Project: 80134
Buggy source:
/** 
 * c
 * @param s The string to be parsed
 * @return An array of strings made by breaking the input string at its dots, '.'.
 * @exception StandardException Oops
 */
private static String[] parseMultiPartSQLIdentifier(StringReader r) throws StandardException {
  Vector v=new Vector();
  while (true) {
    String thisId=parseId(r,true);
    v.addElement(thisId);
    int dot;
    try {
      r.mark(0);
      dot=r.read();
      if (dot != '.') {
        if (dot != -1)         r.reset();
        break;
      }
    }
 catch (    IOException ioe) {
      throw StandardException.newException(SQLState.ID_PARSE_ERROR,ioe);
    }
  }
  String[] result=new String[v.size()];
  v.copyInto(result);
  return result;
}

Fixed version (ground truth):
/** 
 * @param r The multi-part identifier to be parsed
 * @return An array of strings made by breaking the input string at its dots, '.'.
 * @exception StandardException Oops
 */
private static String[] parseMultiPartSQLIdentifier(StringReader r) throws StandardException {
  Vector v=new Vector();
  while (true) {
    String thisId=parseId(r,true);
    v.addElement(thisId);
    int dot;
    try {
      r.mark(0);
      dot=r.read();
      if (dot != '.') {
        if (dot != -1)         r.reset();
        break;
      }
    }
 catch (    IOException ioe) {
      throw StandardException.newException(SQLState.ID_PARSE_ERROR,ioe);
    }
  }
  String[] result=new String[v.size()];
  v.copyInto(result);
  return result;
}
Program: 80135
Project: 80135
Buggy source:
/** 
 * Assert that the user name returned by various mechanisms matches the normal user name.
 * @param normalUserName
 * @param conn
 * @throws SQLException
 */
private void assertNormalUserName(String normalUserName,Connection connUser) throws SQLException {
  Statement s=connUser.createStatement();
  JDBC.assertSingleValueResultSet(s.executeQuery("String_Node_Str"),normalUserName);
  JDBC.assertSingleValueResultSet(s.executeQuery("String_Node_Str"),normalUserName);
  JDBC.assertSingleValueResultSet(s.executeQuery("String_Node_Str"),normalUserName);
  s.close();
}

Fixed version (ground truth):
/** 
 * Assert that the user name returned by various mechanisms matches the normal user name.
 * @param normalUserName
 * @param connUser
 * @throws SQLException
 */
private void assertNormalUserName(String normalUserName,Connection connUser) throws SQLException {
  Statement s=connUser.createStatement();
  JDBC.assertSingleValueResultSet(s.executeQuery("String_Node_Str"),normalUserName);
  JDBC.assertSingleValueResultSet(s.executeQuery("String_Node_Str"),normalUserName);
  JDBC.assertSingleValueResultSet(s.executeQuery("String_Node_Str"),normalUserName);
  s.close();
}
Program: 80136
Project: 80136
Buggy source:
/** 
 * Build a JBitSet of all of the tables that we are correlated with.
 * @param correlationMap	The JBitSet of the tables that we are correlated with.
 */
void getCorrelationTables(JBitSet correlationMap) throws StandardException {
  CollectNodesVisitor getCRs=new CollectNodesVisitor(ColumnReference.class);
  super.accept(getCRs);
  Vector colRefs=getCRs.getList();
  for (Enumeration e=colRefs.elements(); e.hasMoreElements(); ) {
    ColumnReference ref=(ColumnReference)e.nextElement();
    if (ref.getCorrelated()) {
      correlationMap.set(ref.getTableNumber());
    }
  }
}

Fixed version (ground truth):
/** 
 * Build a JBitSet of all of the tables that we are correlated with.
 * @param correlationMap	The JBitSet of the tables that we are correlated with.
 */
void getCorrelationTables(JBitSet correlationMap) throws StandardException {
  CollectNodesVisitor getCRs=new CollectNodesVisitor(ColumnReference.class);
  accept(getCRs);
  Vector colRefs=getCRs.getList();
  for (Enumeration e=colRefs.elements(); e.hasMoreElements(); ) {
    ColumnReference ref=(ColumnReference)e.nextElement();
    if (ref.getCorrelated()) {
      correlationMap.set(ref.getTableNumber());
    }
  }
}
Program: 80137
Project: 80137
Buggy source:
/** 
 * Append a byte[] to this LogBufferElement.
 * @return new position
 */
private int appendBytes(byte b[],int pos,int length){
  if (SanityManager.DEBUG) {
    SanityManager.ASSERT(freeSize() >= (pos + length),"String_Node_Str" + "String_Node_Str");
    SanityManager.ASSERT(b != null,"String_Node_Str");
  }
  System.arraycopy(b,0,bufferdata,pos,length);
  return pos + length;
}

Fixed version (ground truth):
/** 
 * Append a byte[] to this LogBufferElement.
 * @param b       where the bytes are copied from
 * @param offset  offset in b to start copying from
 * @param pos     the position in this LogBufferElement to start copying to
 * @param length  number of bytes to copy from b, starting from offset
 * @return new position
 */
private int appendBytes(byte b[],int offset,int pos,int length){
  if (SanityManager.DEBUG) {
    SanityManager.ASSERT(freeSize() >= length,"String_Node_Str" + "String_Node_Str");
    SanityManager.ASSERT(b != null,"String_Node_Str");
  }
  System.arraycopy(b,offset,bufferdata,pos,length);
  return pos + length;
}
Program: 80138
Project: 80138
Buggy source:
/** 
 * Method to determine whether or not the buffer had log record the last time next() was called.
 * @return true if the buffer contained log records the last timenext() was called. False if not, or if next() has not been called yet.
 */
public boolean validData(){
synchronized (outputLatch) {
    return validOutBuffer;
  }
}

Fixed version (ground truth):
/** 
 * Method to determine whether or not the buffer had any log records the last time next() was called.
 * @return true if the buffer contained log records the last timenext() was called. False if not, or if next() has not been called yet.
 */
public boolean validData(){
synchronized (outputLatch) {
    return validOutBuffer;
  }
}
Program: 80140
Project: 80140
Buggy source:
/** 
 * For a TERRITORY_BASED collation french database, differences between pre-composed accents such  as "\u00C0" (A-grave) and combining accents such as "A\u0300" (A, combining-grave) should match for = and like. But they do not match for UCS_BASIC. We insert both into a table and search based on equal and like. 
 * @param conn
 * @param expectedMatchCount  number of rows we expect back. 2 for french, 1 for English 
 * @throws SQLException
 */
private void compareAgrave(Connection conn,int expectedMatchCountForEqual,int expectedMatchCountForLike) throws SQLException {
  String agrave="String_Node_Str";
  String agraveCombined="String_Node_Str";
  Statement s=conn.createStatement();
  try {
    s.executeUpdate("String_Node_Str");
  }
 catch (  SQLException se) {
  }
  s.executeUpdate("String_Node_Str");
  PreparedStatement ps=conn.prepareStatement("String_Node_Str");
  ps.setString(1,agrave);
  ps.executeUpdate();
  ps.setString(1,agraveCombined);
  ps.executeUpdate();
  ps.close();
  ps=conn.prepareStatement("String_Node_Str");
  ps.setString(1,agrave);
  ResultSet rs=ps.executeQuery();
  JDBC.assertSingleValueResultSet(rs,Integer.toString(expectedMatchCountForEqual));
  ps=conn.prepareStatement("String_Node_Str");
  ps.setString(1,agrave);
  rs=ps.executeQuery();
  JDBC.assertSingleValueResultSet(rs,Integer.toString(expectedMatchCountForLike));
  rs.close();
  ps.close();
  s.close();
}

Fixed version (ground truth):
/** 
 * For a TERRITORY_BASED collation french database, differences between pre-composed accents such  as "\u00C0" (A-grave) and combining accents such as "A\u0300" (A, combining-grave) should match for = and like. But they do not match for UCS_BASIC. We insert both into a table and search based on equal and like. 
 * @param conn
 * @param expectedMatchCountForEqual  number of rows we expect back for =. 2 for French, 1 for English 
 * @param expectedMatchCountForLike  number of rows we expect back for LIKE. 1 for French and English 
 * @throws SQLException
 */
private void compareAgrave(Connection conn,int expectedMatchCountForEqual,int expectedMatchCountForLike) throws SQLException {
  String agrave="String_Node_Str";
  String agraveCombined="String_Node_Str";
  Statement s=conn.createStatement();
  try {
    s.executeUpdate("String_Node_Str");
  }
 catch (  SQLException se) {
  }
  s.executeUpdate("String_Node_Str");
  PreparedStatement ps=conn.prepareStatement("String_Node_Str");
  ps.setString(1,agrave);
  ps.executeUpdate();
  ps.setString(1,agraveCombined);
  ps.executeUpdate();
  ps.close();
  ps=conn.prepareStatement("String_Node_Str");
  ps.setString(1,agrave);
  ResultSet rs=ps.executeQuery();
  JDBC.assertSingleValueResultSet(rs,Integer.toString(expectedMatchCountForEqual));
  ps=conn.prepareStatement("String_Node_Str");
  ps.setString(1,agrave);
  rs=ps.executeQuery();
  JDBC.assertSingleValueResultSet(rs,Integer.toString(expectedMatchCountForLike));
  rs.close();
  ps.close();
  s.close();
}
Program: 80141
Project: 80141
Buggy source:
public int read(char[] cbuf,int off,int len) throws IOException {
synchronized (lock) {
    if (noMoreReads)     throw new IOException(READER_CLOSED);
    if (readPositionInBuffer >= charactersInBuffer) {
      if (fillBuffer()) {
        return -1;
      }
      readPositionInBuffer=0;
    }
    int remainingInBuffer=charactersInBuffer - readPositionInBuffer;
    if (len > remainingInBuffer)     len=remainingInBuffer;
    System.arraycopy(buffer,readPositionInBuffer,cbuf,off,len);
    readPositionInBuffer+=len;
    return len;
  }
}

Fixed version (ground truth):
/** 
 * Reads characters into an array.
 * @return The number of characters read, or <code>-1</code> if the end ofthe stream has been reached.
 */
public int read(char[] cbuf,int off,int len) throws IOException {
synchronized (lock) {
    if (noMoreReads)     throw new IOException(READER_CLOSED);
    if (readPositionInBuffer >= charactersInBuffer) {
      if (fillBuffer()) {
        return -1;
      }
      readPositionInBuffer=0;
    }
    int remainingInBuffer=charactersInBuffer - readPositionInBuffer;
    if (len > remainingInBuffer)     len=remainingInBuffer;
    System.arraycopy(buffer,readPositionInBuffer,cbuf,off,len);
    readPositionInBuffer+=len;
    return len;
  }
}
Program: 80142
Project: 80142
Buggy source:
public int readInto(StringBuffer sb,int len) throws IOException {
synchronized (lock) {
    if (readPositionInBuffer >= charactersInBuffer) {
      if (fillBuffer()) {
        return -1;
      }
      readPositionInBuffer=0;
    }
    int remainingInBuffer=charactersInBuffer - readPositionInBuffer;
    if (len > remainingInBuffer)     len=remainingInBuffer;
    sb.append(buffer,readPositionInBuffer,len);
    readPositionInBuffer+=len;
    return len;
  }
}

Fixed version (ground truth):
/** 
 * Reads characters from the stream. <p> Due to internal buffering a smaller number of characters than what is requested might be returned. To ensure that the request is fulfilled, call this method in a loop until the requested number of characters is read or <code>-1</code> is returned.
 * @param sb the destination buffer
 * @param len maximum number of characters to read
 * @return The number of characters read, or <code>-1</code> if the end ofthe stream is reached.
 */
public int readInto(StringBuffer sb,int len) throws IOException {
synchronized (lock) {
    if (readPositionInBuffer >= charactersInBuffer) {
      if (fillBuffer()) {
        return -1;
      }
      readPositionInBuffer=0;
    }
    int remainingInBuffer=charactersInBuffer - readPositionInBuffer;
    if (len > remainingInBuffer)     len=remainingInBuffer;
    sb.append(buffer,readPositionInBuffer,len);
    readPositionInBuffer+=len;
    return len;
  }
}
Program: 80143
Project: 80143
Buggy source:
/** 
 * Constructs a <code>UTF8Reader</code> using a stream. <p> This consturctor accepts the stream size as parameter and doesn't attempt to read the length from the stream.
 * @param in the underlying stream
 * @param maxFieldSize the maximum allowed length for the associated column
 * @param streamSize size of the underlying stream in bytes
 * @param parent the connection child this stream is associated with
 * @param synchronization object to synchronize on
 */
public UTF8Reader(InputStream in,long maxFieldSize,long streamSize,ConnectionChild parent,Object synchronization) throws IOException {
  super(synchronization);
  this.maxFieldSize=maxFieldSize;
  this.parent=parent;
  this.utfLen=streamSize;
  this.positionedIn=null;
  if (SanityManager.DEBUG) {
    SanityManager.ASSERT(!(in instanceof Resetable));
  }
  this.in=new BufferedInputStream(in);
}

Fixed version (ground truth):
/** 
 * Constructs a <code>UTF8Reader</code> using a stream. <p> This consturctor accepts the stream size as parameter and doesn't attempt to read the length from the stream.
 * @param in the underlying stream
 * @param maxFieldSize the maximum allowed length for the associated column
 * @param streamSize size of the underlying stream in bytes
 * @param parent the connection child this stream is associated with
 * @param synchronization object to synchronize on
 */
public UTF8Reader(InputStream in,long maxFieldSize,long streamSize,ConnectionChild parent,Object synchronization){
  super(synchronization);
  this.maxFieldSize=maxFieldSize;
  this.parent=parent;
  this.utfLen=streamSize;
  this.positionedIn=null;
  if (SanityManager.DEBUG) {
    SanityManager.ASSERT(!(in instanceof Resetable));
  }
  this.in=new BufferedInputStream(in);
}
Program: 80144
Project: 80144
Buggy source:
int readAsciiInto(byte[] abuf,int off,int len) throws IOException {
synchronized (lock) {
    if (readPositionInBuffer >= charactersInBuffer) {
      if (fillBuffer()) {
        return -1;
      }
      readPositionInBuffer=0;
    }
    int remainingInBuffer=charactersInBuffer - readPositionInBuffer;
    if (len > remainingInBuffer)     len=remainingInBuffer;
    char[] lbuffer=buffer;
    for (int i=0; i < len; i++) {
      char c=lbuffer[readPositionInBuffer + i];
      byte cb;
      if (c <= 255)       cb=(byte)c;
 else       cb=(byte)'?';
      abuf[off + i]=cb;
    }
    readPositionInBuffer+=len;
    return len;
  }
}

Fixed version (ground truth):
/** 
 * Reads characters into an array as ASCII characters. <p> Due to internal buffering a smaller number of characters than what is requested might be returned. To ensure that the request is fulfilled, call this method in a loop until the requested number of characters is read or <code>-1</code> is returned. <p> Characters outside the ASCII range are replaced with an out of range marker.
 * @param abuf the buffer to read into
 * @param off the offset into the destination buffer
 * @param len maximum number of characters to read
 * @return The number of characters read, or <code>-1</code> if the end ofthe stream is reached.
 */
int readAsciiInto(byte[] abuf,int off,int len) throws IOException {
synchronized (lock) {
    if (readPositionInBuffer >= charactersInBuffer) {
      if (fillBuffer()) {
        return -1;
      }
      readPositionInBuffer=0;
    }
    int remainingInBuffer=charactersInBuffer - readPositionInBuffer;
    if (len > remainingInBuffer)     len=remainingInBuffer;
    char[] lbuffer=buffer;
    for (int i=0; i < len; i++) {
      char c=lbuffer[readPositionInBuffer + i];
      byte cb;
      if (c <= 255)       cb=(byte)c;
 else       cb=(byte)'?';
      abuf[off + i]=cb;
    }
    readPositionInBuffer+=len;
    return len;
  }
}
Program: 80146
Project: 80146
Buggy source:
public long skip(long len) throws IOException {
  if (len < 0) {
    throw new IllegalArgumentException("String_Node_Str" + len);
  }
synchronized (lock) {
    if (noMoreReads)     throw new IOException(READER_CLOSED);
    if (readPositionInBuffer >= charactersInBuffer) {
      if (fillBuffer()) {
        return 0L;
      }
      readPositionInBuffer=0;
    }
    int remainingInBuffer=charactersInBuffer - readPositionInBuffer;
    if (len > remainingInBuffer)     len=remainingInBuffer;
    readPositionInBuffer+=len;
    return len;
  }
}

Fixed version (ground truth):
/** 
 * Skips characters.
 * @param len the numbers of characters to skip
 * @return The number of characters actually skipped.
 * @throws IllegalArgumentException if the number of characters to skip isnegative
 * @throws IOException if accessing the underlying stream fails
 */
public long skip(long len) throws IOException {
  if (len < 0) {
    throw new IllegalArgumentException("String_Node_Str" + len);
  }
synchronized (lock) {
    if (noMoreReads)     throw new IOException(READER_CLOSED);
    if (readPositionInBuffer >= charactersInBuffer) {
      if (fillBuffer()) {
        return 0L;
      }
      readPositionInBuffer=0;
    }
    int remainingInBuffer=charactersInBuffer - readPositionInBuffer;
    if (len > remainingInBuffer)     len=remainingInBuffer;
    readPositionInBuffer+=len;
    return len;
  }
}
Program: 80147
Project: 80147
Buggy source:
private void closeIn(){
  if (in != null) {
    try {
      in.close();
    }
 catch (    IOException ioe) {
    }
 finally {
      in=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Close the underlying stream if it is open.
 */
private void closeIn(){
  if (in != null) {
    try {
      in.close();
    }
 catch (    IOException ioe) {
    }
 finally {
      in=null;
    }
  }
}
Program: 80148
Project: 80148
Buggy source:
private IOException utfFormatException(String s){
  noMoreReads=true;
  closeIn();
  return new UTFDataFormatException(s);
}

Fixed version (ground truth):
/** 
 * Convenience method generating an   {@link UTFDataFormatException} andcleaning up the reader state.
 */
private IOException utfFormatException(String s){
  noMoreReads=true;
  closeIn();
  return new UTFDataFormatException(s);
}