nus-yam/ex-repair huggingface dataset:
Program: 54317
Project: 54317
Buggy source:
public boolean install(){
  Log.d(TAG,"String_Node_Str");
  ZipInputStream zipInput;
  ZipEntry zipEntry;
  byte[] buffer=new byte[BUFFER_SIZE];
  int read;
  FileOutputStream fileOutput;
  File file;
  String fileName;
  try {
    zipInput=new ZipInputStream(new BufferedInputStream(mAppContext.getAssets().open(TOOLS_FILENAME)));
    while ((zipEntry=zipInput.getNextEntry()) != null) {
      fileName=mDestPath + "String_Node_Str" + zipEntry.getName();
      file=new File(mDestPath + "String_Node_Str" + zipEntry.getName());
      if (zipEntry.isDirectory())       file.mkdirs();
 else {
        fileOutput=new FileOutputStream(fileName);
        while ((read=zipInput.read(buffer,0,BUFFER_SIZE)) > -1) {
          fileOutput.write(buffer,0,read);
        }
        fileOutput.close();
        zipInput.closeEntry();
      }
    }
    zipInput.close();
    String cmd="String_Node_Str";
    for (    String install_cmd : INSTALL_COMMANDS) {
      cmd+=install_cmd.replace("String_Node_Str",mDestPath + "String_Node_Str") + "String_Node_Str";
    }
    Shell.exec(cmd);
    return true;
  }
 catch (  Exception e) {
    Log.e("String_Node_Str",e.getMessage());
    return false;
  }
}

Fixed version (ground truth):
public boolean install(){
  Log.d(TAG,"String_Node_Str");
  System.clean();
  ZipInputStream zipInput;
  ZipEntry zipEntry;
  byte[] buffer=new byte[BUFFER_SIZE];
  int read;
  FileOutputStream fileOutput;
  File file;
  String fileName;
  try {
    zipInput=new ZipInputStream(new BufferedInputStream(mAppContext.getAssets().open(TOOLS_FILENAME)));
    while ((zipEntry=zipInput.getNextEntry()) != null) {
      fileName=mDestPath + "String_Node_Str" + zipEntry.getName();
      file=new File(mDestPath + "String_Node_Str" + zipEntry.getName());
      if (zipEntry.isDirectory())       file.mkdirs();
 else {
        fileOutput=new FileOutputStream(fileName);
        while ((read=zipInput.read(buffer,0,BUFFER_SIZE)) > -1) {
          fileOutput.write(buffer,0,read);
        }
        fileOutput.close();
        zipInput.closeEntry();
      }
    }
    zipInput.close();
    String cmd="String_Node_Str";
    for (    String install_cmd : INSTALL_COMMANDS) {
      cmd+=install_cmd.replace("String_Node_Str",mDestPath + "String_Node_Str") + "String_Node_Str";
    }
    Shell.exec(cmd);
    return true;
  }
 catch (  Exception e) {
    Log.e("String_Node_Str",e.getMessage());
    return false;
  }
}
Program: 54319
Project: 54319
Buggy source:
private int countBits(int n){
  int bits=0;
  while (n > 0) {
    bits+=n & 1;
    n>>=1;
  }
  return bits;
}

Fixed version (ground truth):
private static int countBits(int n){
  int bits, i;
  for (i=0, bits=(n & 1); i < 32; i++, n>>=1, bits+=n & 1)   ;
  return bits;
}
Program: 54321
Project: 54321
Buggy source:
public void addChild(String group,Vulnerability child){
  if (!hasGroup(group))   addGroup(group);
  mGroups.get(group).add(child);
  Object[] keys=mGroups.keySet().toArray();
  int groups=keys.length;
  for (int i=0; i < groups; i++) {
    if (keys[i].toString().equals(group)) {
      mListView.expandGroup(i);
      break;
    }
  }
  notifyDataSetChanged();
}

Fixed version (ground truth):
public void addChild(String group,Vulnerability child){
  if (!hasGroup(group))   addGroup(group);
  mGroups.get(group).add(child);
  notifyDataSetChanged();
}
Program: 54322
Project: 54322
Buggy source:
public void run(){
  int read=-1;
  byte[] stream=null, buffer=new byte[BUFFER_SIZE];
  try {
    while (true) {
      try {
        if ((read=mReader.read(buffer,0,BUFFER_SIZE)) != -1) {
          stream=streamAppend(stream,buffer,read);
        }
 else         break;
      }
 catch (      SocketTimeoutException timeout) {
      }
    }
    if (streamIndexOf(stream,"String_Node_Str".getBytes()) != -1) {
      String data=new String(stream);
      String[] split=data.split("String_Node_Str",2);
      String headers=split[0], body=(split.length > 1 ? split[1] : "String_Node_Str"), patched="String_Node_Str";
      body=mFilter.onHtmlReceived(body);
      for (      String header : headers.split("String_Node_Str")) {
        if (header.toLowerCase().contains("String_Node_Str") == false)         patched+=header + "String_Node_Str";
      }
      headers=patched;
      stream=(headers + "String_Node_Str" + body).getBytes();
    }
    mWriter.write(stream);
    mWriter.flush();
  }
 catch (  IOException e) {
    Log.e(TAG,e.toString());
  }
 finally {
    try {
      mWriter.flush();
      mWriter.close();
      mReader.close();
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
  }
}

Fixed version (ground truth):
public void run(){
  int read=-1;
  byte[] stream=null, buffer=new byte[BUFFER_SIZE];
  try {
    while (true) {
      try {
        if ((read=mReader.read(buffer,0,BUFFER_SIZE)) != -1) {
          stream=streamAppend(stream,buffer,read);
        }
 else         break;
      }
 catch (      SocketTimeoutException timeout) {
      }
    }
    if (stream != null && stream.length > 0) {
      if (streamIndexOf(stream,"String_Node_Str".getBytes()) != -1) {
        String data=new String(stream);
        String[] split=data.split(HEAD_SEPARATOR,2);
        String headers=split[0], body=(split.length > 1 ? split[1] : "String_Node_Str"), patched="String_Node_Str";
        body=mFilter.onHtmlReceived(body);
        for (        String header : headers.split("String_Node_Str")) {
          if (header.toLowerCase().contains("String_Node_Str") == false)           patched+=header + "String_Node_Str";
        }
        headers=patched;
        stream=(headers + HEAD_SEPARATOR + body).getBytes();
      }
      mWriter.write(stream);
      mWriter.flush();
    }
  }
 catch (  IOException e) {
    Log.e(TAG,e.toString());
  }
 finally {
    try {
      mWriter.flush();
      mWriter.close();
      mReader.close();
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
  }
}
Program: 54323
Project: 54323
Buggy source:
public InputDialog(String title,String message,Activity activity,InputDialogListener inputDialogListener){
  super(activity);
  mEditText=new EditText(activity);
  this.setTitle(title);
  this.setMessage(message);
  this.setView(mEditText);
  final InputDialogListener listener=inputDialogListener;
  this.setButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      listener.onInputEntered(mEditText.getText().toString());
    }
  }
);
  this.setButton2("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      dialog.dismiss();
    }
  }
);
}

Fixed version (ground truth):
public InputDialog(String title,String message,String text,Activity activity,InputDialogListener inputDialogListener){
  super(activity);
  mEditText=new EditText(activity);
  if (text != null)   mEditText.setText(text);
  this.setTitle(title);
  this.setMessage(message);
  this.setView(mEditText);
  final InputDialogListener listener=inputDialogListener;
  this.setButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      listener.onInputEntered(mEditText.getText().toString());
    }
  }
);
  this.setButton2("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      dialog.dismiss();
    }
  }
);
}
Program: 54324
Project: 54324
Buggy source:
public void stop(){
  mRunning=false;
}

Fixed version (ground truth):
public void stop(){
  Log.d(TAG,"String_Node_Str");
  try {
    mSocket.close();
  }
 catch (  IOException e) {
  }
  mRunning=false;
  mSocket=null;
}
Program: 54325
Project: 54325
Buggy source:
public void run(){
  Log.d(TAG,"String_Node_Str" + mAddress + "String_Node_Str"+ mPort);
  mRunning=true;
  while (mRunning) {
    try {
      Socket client=mSocket.accept();
      new ProxyThread(client,mFilters).start();
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
  }
  try {
    mSocket.close();
  }
 catch (  IOException e) {
    Log.e(TAG,e.toString());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    if (mSocket == null)     mSocket=new ServerSocket(mPort,BACKLOG,mAddress);
    Log.d(TAG,"String_Node_Str" + mAddress + "String_Node_Str"+ mPort);
    mRunning=true;
    while (mRunning) {
      try {
        Socket client=mSocket.accept();
        new ProxyThread(client,mFilters).start();
      }
 catch (      IOException e) {
        Log.e(TAG,e.toString());
      }
    }
    Log.d(TAG,"String_Node_Str");
    try {
      mSocket.close();
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
  }
 catch (  IOException e) {
    Log.e(TAG,e.toString());
  }
}
Program: 54326
Project: 54326
Buggy source:
public void run(){
  Log.d(TAG,"String_Node_Str" + mSocket.getLocalAddress());
  try {
    String request=readRequest(mReader);
    StringBuilder builder=new StringBuilder();
    for (    String line : request.split("String_Node_Str")) {
      if (line.startsWith("String_Node_Str") || line.startsWith("String_Node_Str")) {
        line=line.substring(0,line.indexOf(' ') + 1) + line.substring(line.indexOf('/',line.indexOf("String_Node_Str") + "String_Node_Str".length()));
      }
 else       if (line.contains("String_Node_Str"))       line=line.replace("String_Node_Str","String_Node_Str");
      if (line.contains("String_Node_Str"))       line="String_Node_Str";
 else       if (line.contains("String_Node_Str"))       line="String_Node_Str";
 else       if (line.contains(HOST_TOKEN)) {
        mServerName=line.substring(line.indexOf(HOST_TOKEN) + HOST_TOKEN.length()).trim();
        mServer=new Socket(mServerName,SERVER_PORT);
        mServerReader=new BufferedInputStream(mServer.getInputStream());
        mServerWriter=new BufferedOutputStream(mServer.getOutputStream());
      }
      builder.append(line + "String_Node_Str");
    }
    if (mServer != null) {
      mServerWriter.write(builder.toString().getBytes());
      mServerWriter.flush();
      new StreamThread(mServer,mServerReader,mWriter,new Proxy.ProxyFilter(){
        @Override public String onHtmlReceived(        String html){
          for (          Proxy.ProxyFilter filter : mFilters) {
            html=filter.onHtmlReceived(html);
          }
          return html;
        }
      }
);
    }
  }
 catch (  IOException e) {
    Log.e(TAG,e.toString());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    String request=readRequest(mReader);
    StringBuilder builder=new StringBuilder();
    for (    String line : request.split("String_Node_Str")) {
      if (line.contains("String_Node_Str"))       line="String_Node_Str";
 else       if (line.contains("String_Node_Str"))       line="String_Node_Str";
 else       if (line.contains(HOST_TOKEN)) {
        mServerName=line.substring(line.indexOf(HOST_TOKEN) + HOST_TOKEN.length()).trim();
        mServer=new Socket(mServerName,SERVER_PORT);
        mServerReader=new BufferedInputStream(mServer.getInputStream());
        mServerWriter=new BufferedOutputStream(mServer.getOutputStream());
        Log.d(TAG,mSocket.getLocalAddress() + "String_Node_Str" + mServerName);
      }
      builder.append(line + "String_Node_Str");
    }
    if (mServer != null) {
      mServerWriter.write(builder.toString().getBytes());
      mServerWriter.flush();
      new StreamThread(mServer,mServerReader,mWriter,new Proxy.ProxyFilter(){
        @Override public String onHtmlReceived(        String html){
          for (          Proxy.ProxyFilter filter : mFilters) {
            html=filter.onHtmlReceived(html);
          }
          return html;
        }
      }
);
    }
  }
 catch (  IOException e) {
    Log.e(TAG,e.toString());
  }
}
Program: 54327
Project: 54327
Buggy source:
public StreamThread(Socket socket,InputStream reader,OutputStream writer){
  this(socket,reader,writer,null);
}

Fixed version (ground truth):
public StreamThread(Socket socket,InputStream reader,OutputStream writer,Proxy.ProxyFilter filter){
  mSocket=socket;
  mReader=reader;
  mWriter=writer;
  mFilter=filter;
  try {
    mSocket.setSoTimeout(TIMEOUT);
  }
 catch (  SocketException e) {
    Log.e(TAG,e.toString());
  }
  new Thread(this).start();
}
Program: 54328
Project: 54328
Buggy source:
public void run(){
  int read=-1;
  StringBuilder builder=new StringBuilder();
  byte[] buffer=new byte[BUFFER_SIZE];
  try {
    while (true) {
      try {
        if ((read=mReader.read(buffer,0,BUFFER_SIZE)) != -1) {
          builder.append(new String(Arrays.copyOfRange(buffer,0,read)));
        }
 else         break;
      }
 catch (      SocketTimeoutException timeout) {
      }
    }
    String data=builder.toString();
    byte[] response=data.getBytes();
    if (data.toLowerCase().contains("String_Node_Str") && mFilter != null) {
      String[] split=data.split("String_Node_Str",2);
      String headers=split[0], body=(split.length > 1 ? split[1] : "String_Node_Str");
      int length=body.length(), clength=0;
      Matcher match=LENGTH_PATTERN.matcher(headers);
      body=mFilter.onHtmlReceived(body);
      if (match != null && match.find())       clength=Integer.parseInt(match.group(1));
 else       clength=length;
      if (body.length() != clength) {
        headers=headers.replaceAll("String_Node_Str","String_Node_Str" + clength);
      }
      response=(headers + "String_Node_Str" + body).getBytes();
    }
    mWriter.write(response);
    mWriter.flush();
  }
 catch (  IOException e) {
    Log.e(TAG,e.toString());
  }
 finally {
    try {
      mWriter.flush();
      mWriter.close();
      mReader.close();
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
  }
}

Fixed version (ground truth):
public void run(){
  int read=-1;
  byte[] stream=null, buffer=new byte[BUFFER_SIZE];
  try {
    while (true) {
      try {
        if ((read=mReader.read(buffer,0,BUFFER_SIZE)) != -1) {
          stream=streamAppend(stream,buffer,read);
        }
 else         break;
      }
 catch (      SocketTimeoutException timeout) {
      }
    }
    if (streamIndexOf(stream,"String_Node_Str".getBytes()) != -1) {
      String data=new String(stream);
      String[] split=data.split("String_Node_Str",2);
      String headers=split[0], body=(split.length > 1 ? split[1] : "String_Node_Str"), patched="String_Node_Str";
      body=mFilter.onHtmlReceived(body);
      for (      String header : headers.split("String_Node_Str")) {
        if (header.toLowerCase().contains("String_Node_Str") == false)         patched+=header + "String_Node_Str";
      }
      headers=patched;
      stream=(headers + "String_Node_Str" + body).getBytes();
    }
    mWriter.write(stream);
    mWriter.flush();
  }
 catch (  IOException e) {
    Log.e(TAG,e.toString());
  }
 finally {
    try {
      mWriter.flush();
      mWriter.close();
      mReader.close();
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
  }
}
Program: 54329
Project: 54329
Buggy source:
public void run(){
  try {
    if (mSocket == null)     mSocket=new ServerSocket(mPort,BACKLOG,mAddress);
    Log.d(TAG,"String_Node_Str" + mAddress + "String_Node_Str"+ mPort);
    mRunning=true;
    while (mRunning) {
      try {
        Socket client=mSocket.accept();
        new ProxyThread(client,mFilters).start();
      }
 catch (      IOException e) {
        Log.e(TAG,e.toString());
      }
    }
    Log.d(TAG,"String_Node_Str");
    try {
      mSocket.close();
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
  }
 catch (  IOException e) {
    Log.e(TAG,e.toString());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    if (mSocket == null)     mSocket=new ServerSocket(mPort,BACKLOG,mAddress);
    Log.d(TAG,"String_Node_Str" + mAddress + "String_Node_Str"+ mPort);
    mRunning=true;
    while (mRunning) {
      try {
        Socket client=mSocket.accept();
        new ProxyThread(client,mFilters).start();
      }
 catch (      IOException e) {
        Log.e(TAG,e.toString());
      }
    }
    Log.d(TAG,"String_Node_Str");
  }
 catch (  IOException e) {
    Log.e(TAG,e.toString());
  }
}
Program: 54333
Project: 54333
Buggy source:
@Override public boolean shouldOverrideUrlLoading(WebView webView,String url){
  Log.v("String_Node_Str","String_Node_Str" + url);
  if (url != null && url.startsWith("String_Node_Str")) {
    handleTwitterCallback(url);
  }
 else   if (url.equals("String_Node_Str")) {
    webView.loadUrl(requestUrl);
  }
 else {
    webView.loadUrl(url);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean shouldOverrideUrlLoading(WebView webView,String url){
  Log.v("String_Node_Str","String_Node_Str" + url);
  if (url != null && url.startsWith(OAUTH_CALLBACK)) {
    handleTwitterCallback(url);
  }
 else   if (url.equals("String_Node_Str")) {
    webView.loadUrl(requestUrl);
  }
 else {
    webView.loadUrl(url);
  }
  return true;
}
Program: 54334
Project: 54334
Buggy source:
private void loginToTwitter(){
  try {
    requestToken=twitter.getOAuthRequestToken("String_Node_Str");
  }
 catch (  TwitterException ex) {
    ex.printStackTrace();
    try {
      Looper.prepare();
    }
 catch (    Exception e) {
    }
    restartLogin();
  }
}

Fixed version (ground truth):
private void loginToTwitter(){
  try {
    requestToken=twitter.getOAuthRequestToken(OAUTH_CALLBACK);
  }
 catch (  TwitterException ex) {
    ex.printStackTrace();
    try {
      Looper.prepare();
    }
 catch (    Exception e) {
    }
    restartLogin();
  }
}
Program: 54335
Project: 54335
Buggy source:
public UserListMembersArrayAdapter(Context context,ArrayList<User> users,int listId){
  super(context,users);
  this.listId=listId;
}

Fixed version (ground truth):
public UserListMembersArrayAdapter(Context context,ArrayList<User> users,long listId){
  super(context,users);
  this.listId=listId;
}
Program: 54336
Project: 54336
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  overridePendingTransition(R.anim.activity_slide_up,R.anim.activity_slide_down);
  context=this;
  sharedPrefs=PreferenceManager.getDefaultSharedPreferences(context);
  settings=AppSettings.getInstance(this);
  listName=getIntent().getStringExtra("String_Node_Str");
  if (settings.advanceWindowed) {
    setUpWindow();
  }
  Utils.setUpPopupTheme(this,settings);
  actionBar=getActionBar();
  actionBar.setTitle(listName);
  setContentView(R.layout.list_view_activity);
  LinearLayout spinner=(LinearLayout)findViewById(R.id.list_progress);
  spinner.setVisibility(View.GONE);
  listView=(AsyncListView)findViewById(R.id.listView);
  listView.setOnScrollListener(new AbsListView.OnScrollListener(){
    @Override public void onScrollStateChanged(    AbsListView absListView,    int i){
    }
    @Override public void onScroll(    AbsListView absListView,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
      final int lastItem=firstVisibleItem + visibleItemCount;
      if (lastItem == totalItemCount) {
        if (canRefresh && bigEnough) {
          new GetUsers().execute();
        }
        canRefresh=false;
        new Handler().postDelayed(new Runnable(){
          @Override public void run(){
            canRefresh=true;
          }
        }
,4000);
      }
    }
  }
);
  listId=getIntent().getIntExtra("String_Node_Str",0);
  new GetUsers().execute();
  Utils.setActionBar(context);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  overridePendingTransition(R.anim.activity_slide_up,R.anim.activity_slide_down);
  context=this;
  sharedPrefs=PreferenceManager.getDefaultSharedPreferences(context);
  settings=AppSettings.getInstance(this);
  listName=getIntent().getStringExtra("String_Node_Str");
  if (settings.advanceWindowed) {
    setUpWindow();
  }
  Utils.setUpPopupTheme(this,settings);
  actionBar=getActionBar();
  actionBar.setTitle(listName);
  setContentView(R.layout.list_view_activity);
  LinearLayout spinner=(LinearLayout)findViewById(R.id.list_progress);
  spinner.setVisibility(View.GONE);
  listView=(AsyncListView)findViewById(R.id.listView);
  listView.setOnScrollListener(new AbsListView.OnScrollListener(){
    @Override public void onScrollStateChanged(    AbsListView absListView,    int i){
    }
    @Override public void onScroll(    AbsListView absListView,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
      final int lastItem=firstVisibleItem + visibleItemCount;
      if (lastItem == totalItemCount) {
        if (canRefresh && bigEnough) {
          new GetUsers().execute();
        }
        canRefresh=false;
        new Handler().postDelayed(new Runnable(){
          @Override public void run(){
            canRefresh=true;
          }
        }
,4000);
      }
    }
  }
);
  listId=getIntent().getLongExtra("String_Node_Str",0);
  new GetUsers().execute();
  Utils.setActionBar(context);
}
Program: 54340
Project: 54340
Buggy source:
@Override public boolean shouldOverrideUrlLoading(WebView webView,String url){
  if (url != null && url.startsWith("String_Node_Str")) {
    handleTwitterCallback(url);
  }
 else {
    webView.loadUrl(url);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean shouldOverrideUrlLoading(WebView webView,String url){
  Log.v("String_Node_Str","String_Node_Str" + url);
  if (url != null && url.startsWith("String_Node_Str")) {
    handleTwitterCallback(url);
  }
 else   if (url.equals("String_Node_Str")) {
    webView.loadUrl(requestUrl);
  }
 else {
    webView.loadUrl(url);
  }
  return true;
}
Program: 54341
Project: 54341
Buggy source:
@Override public void disableDataInsertMode(){
  this.dataImportMode=false;
}

Fixed version (ground truth):
@Override public void disableDataInsertMode(String schemaName){
  schemaImportMode.put(schemaName,Boolean.FALSE);
}
Program: 54342
Project: 54342
Buggy source:
@Override public boolean isOnDataInsertMode(){
  return dataImportMode;
}

Fixed version (ground truth):
@Override public boolean isOnDataInsertMode(String schemaName){
  Boolean importMode=schemaImportMode.get(schemaName);
  if (importMode == null) {
    return false;
  }
  return importMode;
}
Program: 54343
Project: 54343
Buggy source:
/** 
 * Configure the backend. <p>The contract specifies that any subclass must call initialize() method after properly constructing the object.
 * @param threadFactory the thread factory that will be used to create the startup and shutdownthreads
 */
public AbstractDbBackendService(@TorodbIdleService ThreadFactory threadFactory,ConfigurationT configuration,ErrorHandler errorHandler){
  super(threadFactory);
  this.configuration=configuration;
  this.errorHandler=errorHandler;
  this.dataImportMode=false;
  int connectionPoolSize=configuration.getConnectionPoolSize();
  int reservedReadPoolSize=configuration.getReservedReadPoolSize();
  Preconditions.checkState(connectionPoolSize >= MIN_CONNECTIONS_DATABASE,"String_Node_Str" + MIN_CONNECTIONS_DATABASE + "String_Node_Str");
  Preconditions.checkState(reservedReadPoolSize >= MIN_READ_CONNECTIONS_DATABASE,"String_Node_Str" + MIN_READ_CONNECTIONS_DATABASE + "String_Node_Str");
  Preconditions.checkState(connectionPoolSize - reservedReadPoolSize >= MIN_SESSION_CONNECTIONS_DATABASE,"String_Node_Str" + MIN_SESSION_CONNECTIONS_DATABASE);
}

Fixed version (ground truth):
/** 
 * Configure the backend. <p>The contract specifies that any subclass must call initialize() method after properly constructing the object.
 * @param threadFactory the thread factory that will be used to create the startup and shutdownthreads
 */
public AbstractDbBackendService(@TorodbIdleService ThreadFactory threadFactory,ConfigurationT configuration,ErrorHandler errorHandler){
  super(threadFactory);
  this.configuration=configuration;
  this.errorHandler=errorHandler;
  int connectionPoolSize=configuration.getConnectionPoolSize();
  int reservedReadPoolSize=configuration.getReservedReadPoolSize();
  Preconditions.checkState(connectionPoolSize >= MIN_CONNECTIONS_DATABASE,"String_Node_Str" + MIN_CONNECTIONS_DATABASE + "String_Node_Str");
  Preconditions.checkState(reservedReadPoolSize >= MIN_READ_CONNECTIONS_DATABASE,"String_Node_Str" + MIN_READ_CONNECTIONS_DATABASE + "String_Node_Str");
  Preconditions.checkState(connectionPoolSize - reservedReadPoolSize >= MIN_SESSION_CONNECTIONS_DATABASE,"String_Node_Str" + MIN_SESSION_CONNECTIONS_DATABASE);
}
Program: 54344
Project: 54344
Buggy source:
@Override public void enableDataInsertMode(){
  this.dataImportMode=true;
}

Fixed version (ground truth):
@Override public void enableDataInsertMode(String schemaName){
  schemaImportMode.put(schemaName,Boolean.TRUE);
}
Program: 54345
Project: 54345
Buggy source:
@Override public void addMetaIndexField(DSLContext dsl,MetaDatabase database,MetaCollection collection,MetaIndex index,MetaIndexField field){
  String statement=getAddMetaIndexFieldStatement(database.getName(),collection.getName(),index.getName(),field.getPosition(),field.getTableRef(),field.getName(),field.getOrdering());
  sqlHelper.executeUpdate(dsl,statement,Context.META_INSERT);
}

Fixed version (ground truth):
@Override public void addMetaIndexField(DSLContext dsl,MetaDatabase database,MetaCollection collection,MetaIndex index,MetaIndexField field){
  String statement=getAddMetaIndexFieldStatement(database.getName(),collection.getName(),index.getName(),field.getPosition(),field.getTableRef(),field.getFieldName(),field.getOrdering());
  sqlHelper.executeUpdate(dsl,statement,Context.META_INSERT);
}
Program: 54346
Project: 54346
Buggy source:
@Override public Stream<Function<DSLContext,String>> streamDataInsertFinishTasks(MetaSnapshot snapshot){
  return Collections.<Function<DSLContext,String>>emptySet().stream();
}

Fixed version (ground truth):
@Override public Stream<Function<DSLContext,String>> streamDataInsertFinishTasks(MetaDatabase db){
  return Collections.<Function<DSLContext,String>>emptySet().stream();
}
Program: 54348
Project: 54348
Buggy source:
@Override public void createIndex(DSLContext dsl,String indexName,String schemaName,String tableName,List<Tuple2<String,Boolean>> columnList,boolean unique) throws UserException {
  if (!dbBackend.isOnDataInsertMode()) {
    Preconditions.checkArgument(!columnList.isEmpty(),"String_Node_Str");
    String statement=getCreateIndexStatement(indexName,schemaName,tableName,columnList,unique);
    sqlHelper.executeUpdateOrThrow(dsl,statement,unique ? Context.ADD_UNIQUE_INDEX : Context.CREATE_INDEX);
  }
}

Fixed version (ground truth):
@Override public void createIndex(DSLContext dsl,String indexName,String schemaName,String tableName,List<Tuple2<String,Boolean>> columnList,boolean unique) throws UserException {
  if (!dbBackend.isOnDataInsertMode(schemaName)) {
    Preconditions.checkArgument(!columnList.isEmpty(),"String_Node_Str");
    String statement=getCreateIndexStatement(indexName,schemaName,tableName,columnList,unique);
    sqlHelper.executeUpdateOrThrow(dsl,statement,unique ? Context.ADD_UNIQUE_INDEX : Context.CREATE_INDEX);
  }
}
Program: 54349
Project: 54349
Buggy source:
@Override public Stream<Function<DSLContext,String>> streamRootDocPartTableIndexesCreation(String schemaName,String tableName,TableRef tableRef){
  List<Function<DSLContext,String>> result=new ArrayList<>(1);
  if (!dbBackend.isOnDataInsertMode()) {
    String primaryKeyStatement=getAddDocPartTablePrimaryKeyStatement(schemaName,tableName,metaDataReadInterface.getPrimaryKeyInternalFields(tableRef));
    result.add(dsl -> {
      sqlHelper.executeStatement(dsl,primaryKeyStatement,Context.ADD_UNIQUE_INDEX);
      return metaDataReadInterface.getPrimaryKeyInternalFields(tableRef).stream().map(f -> f.getName()).collect(Collectors.joining("String_Node_Str")) + "String_Node_Str";
    }
);
  }
  return result.stream();
}

Fixed version (ground truth):
@Override public Stream<Function<DSLContext,String>> streamRootDocPartTableIndexesCreation(String schemaName,String tableName,TableRef tableRef){
  List<Function<DSLContext,String>> result=new ArrayList<>(1);
  if (!dbBackend.isOnDataInsertMode(schemaName)) {
    String primaryKeyStatement=getAddDocPartTablePrimaryKeyStatement(schemaName,tableName,metaDataReadInterface.getPrimaryKeyInternalFields(tableRef));
    result.add(dsl -> {
      sqlHelper.executeStatement(dsl,primaryKeyStatement,Context.ADD_UNIQUE_INDEX);
      return metaDataReadInterface.getPrimaryKeyInternalFields(tableRef).stream().map(f -> f.getName()).collect(Collectors.joining("String_Node_Str")) + "String_Node_Str";
    }
);
  }
  return result.stream();
}
Program: 54350
Project: 54350
Buggy source:
@Override public void enableDataImportMode(MetaSnapshot snapshot) throws RollbackException {
  if (!sqlInterface.getDbBackend().isOnDataInsertMode()) {
    if (snapshot.streamMetaDatabases().findAny().isPresent()) {
      throw new IllegalStateException("String_Node_Str");
    }
    sqlInterface.getDbBackend().enableDataInsertMode();
  }
}

Fixed version (ground truth):
@Override public CompletableFuture<Empty> enableDataImportMode(MetaDatabase db) throws RollbackException {
  if (!sqlInterface.getDbBackend().isOnDataInsertMode(db)) {
    sqlInterface.getDbBackend().enableDataInsertMode(db);
  }
  return CompletableFuture.completedFuture(Empty.getInstance());
}
Program: 54351
Project: 54351
Buggy source:
@Override public void disableDataImportMode(MetaSnapshot snapshot) throws RollbackException {
  if (sqlInterface.getDbBackend().isOnDataInsertMode()) {
    sqlInterface.getDbBackend().disableDataInsertMode();
    Stream<Consumer<DSLContext>> createInternalIndexesJobs=snapshot.streamMetaDatabases().flatMap(db -> db.streamMetaCollections().flatMap(col -> col.streamContainedMetaDocParts().flatMap(docPart -> enableInternalIndexJobs(db,col,docPart))));
    Stream<Consumer<DSLContext>> createIndexesJobs=snapshot.streamMetaDatabases().flatMap(db -> db.streamMetaCollections().flatMap(col -> enableIndexJobs(db,col)));
    Stream<Consumer<DSLContext>> backendSpecificJobs=sqlInterface.getStructureInterface().streamDataInsertFinishTasks(snapshot).map(job -> {
      return (Consumer<DSLContext>)dsl -> {
        String index=job.apply(dsl);
        LOGGER.info("String_Node_Str",index);
      }
;
    }
);
    Stream<Consumer<DSLContext>> jobs=Stream.concat(createInternalIndexesJobs,createIndexesJobs);
    jobs=Stream.concat(jobs,backendSpecificJobs);
    Stream<Runnable> runnables=jobs.map(this::dslConsumerToRunnable);
    streamExecutor.executeRunnables(runnables).join();
  }
}

Fixed version (ground truth):
@Override public CompletableFuture<Empty> disableDataImportMode(MetaDatabase db) throws RollbackException {
  if (!sqlInterface.getDbBackend().isOnDataInsertMode(db)) {
    LOGGER.debug("String_Node_Str",db.getIdentifier());
    return CompletableFuture.completedFuture(Empty.getInstance());
  }
  sqlInterface.getDbBackend().disableDataInsertMode(db);
  Stream<Consumer<DSLContext>> createInternalIndexesJobs=db.streamMetaCollections().flatMap(col -> col.streamContainedMetaDocParts().flatMap(docPart -> enableInternalIndexJobs(db,col,docPart)));
  Stream<Consumer<DSLContext>> createIndexesJobs=db.streamMetaCollections().flatMap(col -> enableIndexJobs(db,col));
  Stream<Consumer<DSLContext>> backendSpecificJobs=sqlInterface.getStructureInterface().streamDataInsertFinishTasks(db).map(job -> {
    return (Consumer<DSLContext>)dsl -> {
      String index=job.apply(dsl);
      LOGGER.info("String_Node_Str",index);
    }
;
  }
);
  Stream<Consumer<DSLContext>> jobs=Stream.concat(createInternalIndexesJobs,createIndexesJobs);
  jobs=Stream.concat(jobs,backendSpecificJobs);
  Stream<Runnable> runnables=jobs.map(this::dslConsumerToRunnable);
  return streamExecutor.executeRunnables(runnables);
}
Program: 54352
Project: 54352
Buggy source:
public void disableDataInsertMode();

Fixed version (ground truth):
public default void disableDataInsertMode(MetaDatabase db){
  disableDataInsertMode(db.getIdentifier());
}
Program: 54353
Project: 54353
Buggy source:
public boolean isOnDataInsertMode();

Fixed version (ground truth):
public default boolean isOnDataInsertMode(MetaDatabase db){
  return isOnDataInsertMode(db.getIdentifier());
}
Program: 54354
Project: 54354
Buggy source:
public void enableDataInsertMode();

Fixed version (ground truth):
public default void enableDataInsertMode(MetaDatabase db){
  enableDataInsertMode(db.getIdentifier());
}
Program: 54355
Project: 54355
Buggy source:
private void copyIndexFields(MetaIndex fromMetaIndex,MetaDatabase toMetaDb,MetaCollection toMetaColl,MutableMetaIndex toMetaIndex){
  Iterator<? extends MetaIndexField> fromMetaIndexFieldIterator=fromMetaIndex.iteratorFields();
  while (fromMetaIndexFieldIterator.hasNext()) {
    MetaIndexField fromMetaIndexField=fromMetaIndexFieldIterator.next();
    MetaIndexField toMetaIndexField=toMetaIndex.addMetaIndexField(fromMetaIndexField.getTableRef(),fromMetaIndexField.getName(),fromMetaIndexField.getOrdering());
    getSqlInterface().getMetaDataWriteInterface().addMetaIndexField(getDsl(),toMetaDb,toMetaColl,toMetaIndex,toMetaIndexField);
  }
}

Fixed version (ground truth):
private void copyIndexFields(MetaIndex fromMetaIndex,MetaDatabase toMetaDb,MetaCollection toMetaColl,MutableMetaIndex toMetaIndex){
  Iterator<? extends MetaIndexField> fromMetaIndexFieldIterator=fromMetaIndex.iteratorFields();
  while (fromMetaIndexFieldIterator.hasNext()) {
    MetaIndexField fromMetaIndexField=fromMetaIndexFieldIterator.next();
    MetaIndexField toMetaIndexField=toMetaIndex.addMetaIndexField(fromMetaIndexField.getTableRef(),fromMetaIndexField.getFieldName(),fromMetaIndexField.getOrdering());
    getSqlInterface().getMetaDataWriteInterface().addMetaIndexField(getDsl(),toMetaDb,toMetaColl,toMetaIndex,toMetaIndexField);
  }
}
Program: 54356
Project: 54356
Buggy source:
/** 
 * Returns a stream of functions that, when executed, executes backend specific tasks that should be done once the data insert mode finishes and return a label that indicate the type of operation executed. For example, PostgreSQL backend would like to run analyze on the modified tables to get some stadistics.
 * @param snapshot
 * @return
 */
public Stream<Function<DSLContext,String>> streamDataInsertFinishTasks(MetaSnapshot snapshot);

Fixed version (ground truth):
/** 
 * Returns a stream of functions that, when executed, executes backend specific tasks that should be done once the data insert mode finishes and return a label that indicate the type of operation executed. <p>For example, PostgreSQL backend would like to run analyze on the modified tables to get some stadistics.
 */
public Stream<Function<DSLContext,String>> streamDataInsertFinishTasks(MetaDatabase db);
Program: 54357
Project: 54357
Buggy source:
@Override public Stream<Function<DSLContext,String>> streamDataInsertFinishTasks(MetaSnapshot snapshot){
  return snapshot.streamMetaDatabases().flatMap(db -> db.streamMetaCollections().flatMap(col -> col.streamContainedMetaDocParts().map(docPart -> createAnalyzeConsumer(db,col,docPart))));
}

Fixed version (ground truth):
@Override public Stream<Function<DSLContext,String>> streamDataInsertFinishTasks(MetaDatabase db){
  return db.streamMetaCollections().flatMap(col -> col.streamContainedMetaDocParts().map(docPart -> createAnalyzeConsumer(db,col,docPart)));
}
Program: 54358
Project: 54358
Buggy source:
public static HeartbeatInfo unmarshall(BsonDocument bson) throws TypesMismatchException, NoSuchKeyException, BadValueException {
  BsonReaderTool.checkOnlyHasFields("String_Node_Str",bson,CHECK_EMPTY_FIELD_NAME.getFieldName(),PROTOCOL_VERSION_FIELD_NAME.getFieldName(),CONFIG_VERSION_FIELD_NAME.getFieldName(),SENDER_ID_FIELD_NAME.getFieldName(),SET_NAME_FIELD_NAME.getFieldName(),SENDER_HOST_FIELD_NAME.getFieldName());
  Boolean checkEmpty=null;
  if (bson.containsKey(CHECK_EMPTY_FIELD_NAME.getFieldName())) {
    checkEmpty=BsonReaderTool.getBoolean(bson,CHECK_EMPTY_FIELD_NAME);
  }
  long protocolVersion=BsonReaderTool.getLong(bson,PROTOCOL_VERSION_FIELD_NAME);
  long configVersion=BsonReaderTool.getLong(bson,CONFIG_VERSION_FIELD_NAME);
  Long senderId=null;
  if (bson.containsKey(SENDER_ID_FIELD_NAME.getFieldName())) {
    senderId=BsonReaderTool.getLong(bson,SENDER_ID_FIELD_NAME);
  }
  String setName=BsonReaderTool.getString(bson,SET_NAME_FIELD_NAME);
  String senderHostString=BsonReaderTool.getString(bson,SENDER_HOST_FIELD_NAME,null);
  HostAndPort senderHost=senderHostString != null ? BsonReaderTool.getHostAndPort(senderHostString) : null;
  return new HeartbeatInfo(protocolVersion,configVersion,setName,senderHost,senderId,checkEmpty);
}

Fixed version (ground truth):
public static HeartbeatInfo unmarshall(BsonDocument bson) throws TypesMismatchException, NoSuchKeyException, BadValueException {
  BsonReaderTool.checkOnlyHasFields("String_Node_Str",bson,CHECK_EMPTY_FIELD_NAME.getFieldName(),PROTOCOL_VERSION_FIELD_NAME.getFieldName(),CONFIG_VERSION_FIELD_NAME.getFieldName(),SENDER_ID_FIELD_NAME.getFieldName(),SET_NAME_FIELD_NAME.getFieldName(),SENDER_HOST_FIELD_NAME.getFieldName());
  Boolean checkEmpty=null;
  if (bson.containsKey(CHECK_EMPTY_FIELD_NAME.getFieldName())) {
    checkEmpty=BsonReaderTool.getBoolean(bson,CHECK_EMPTY_FIELD_NAME);
  }
  long protocolVersion=BsonReaderTool.getLong(bson,PROTOCOL_VERSION_FIELD_NAME,0);
  long configVersion=BsonReaderTool.getLong(bson,CONFIG_VERSION_FIELD_NAME);
  Long senderId=null;
  if (bson.containsKey(SENDER_ID_FIELD_NAME.getFieldName())) {
    senderId=BsonReaderTool.getLong(bson,SENDER_ID_FIELD_NAME);
  }
  String setName=BsonReaderTool.getString(bson,SET_NAME_FIELD_NAME);
  String senderHostString=BsonReaderTool.getString(bson,SENDER_HOST_FIELD_NAME,null);
  HostAndPort senderHost=senderHostString != null ? BsonReaderTool.getHostAndPort(senderHostString) : null;
  return new HeartbeatInfo(protocolVersion,configVersion,setName,senderHost,senderId,checkEmpty);
}
Program: 54360
Project: 54360
Buggy source:
@Override public MongoDbCoreExtInt getExternalInterface(){
  return new MongoDbCoreExtInt(mongodServer);
}

Fixed version (ground truth):
@Override public MongoDbCoreExtInt getExternalInterface(){
  return new MongoDbCoreExtInt(mongodServer,commandLibrary);
}
Program: 54361
Project: 54361
Buggy source:
public MongoDbCoreBundle(MongoDbCoreConfig bundleConfig){
  super(bundleConfig);
  this.torodBundle=bundleConfig.getTorodBundle();
  Injector injector=bundleConfig.getEssentialInjector().createChildInjector(new MongodCoreModule(bundleConfig));
  mongodServer=injector.getInstance(MongodServer.class);
}

Fixed version (ground truth):
public MongoDbCoreBundle(MongoDbCoreConfig bundleConfig){
  super(bundleConfig);
  this.torodBundle=bundleConfig.getTorodBundle();
  this.commandLibrary=bundleConfig.getCommandsLibrary();
  Injector injector=bundleConfig.getEssentialInjector().createChildInjector(new MongodCoreModule(bundleConfig));
  mongodServer=injector.getInstance(MongodServer.class);
}
Program: 54362
Project: 54362
Buggy source:
public MongoDbCoreExtInt(MongodServer mongodServer){
  this.mongodServer=mongodServer;
}

Fixed version (ground truth):
public MongoDbCoreExtInt(MongodServer mongodServer,CommandLibrary commandLibrary){
  this.mongodServer=mongodServer;
  this.commandLibrary=commandLibrary;
}
Program: 54363
Project: 54363
Buggy source:
@Override public Collection<Service> getDependencies(){
  return Collections.singleton(torodBundle);
}

Fixed version (ground truth):
@Override public Collection<Service> getDependencies(){
  return Collections.singleton(coreBundle);
}
Program: 54364
Project: 54364
Buggy source:
public MongoDbWpBundle(MongoDbWpConfig config){
  super(config);
  Injector injector=Guice.createInjector(new MongoDbWpModule(config.getTorodBundle(),config.getPort()));
  this.nettyMongoServer=injector.getInstance(NettyMongoServer.class);
  this.torodBundle=config.getTorodBundle();
}

Fixed version (ground truth):
public MongoDbWpBundle(MongoDbWpConfig config){
  super(config);
  Injector injector=config.getEssentialInjector().createChildInjector(new MongoDbWpModule(config.getCoreBundle(),config.getPort()));
  this.nettyMongoServer=injector.getInstance(NettyMongoServer.class);
  this.coreBundle=config.getCoreBundle();
}
Program: 54365
Project: 54365
Buggy source:
@SuppressWarnings("String_Node_Str") public MongoDbWpConfig(TorodBundle torodBundle,int port,BundleConfig delegate){
  this.torodBundle=torodBundle;
  this.port=port;
  this.delegate=delegate;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public MongoDbWpConfig(MongoDbCoreBundle coreBundle,int port,BundleConfig delegate){
  this.coreBundle=coreBundle;
  this.port=port;
  this.delegate=delegate;
}
Program: 54366
Project: 54366
Buggy source:
public MongoDbWpConfig build(){
  return new MongoDbWpConfig(torodBundle,port,genericBundle);
}

Fixed version (ground truth):
public MongoDbWpConfig build(){
  return new MongoDbWpConfig(coreBundle,port,genericBundle);
}
Program: 54367
Project: 54367
Buggy source:
public MongoDbWpModule(TorodBundle torodBundle,int port){
  this.port=port;
}

Fixed version (ground truth):
public MongoDbWpModule(MongoDbCoreBundle coreBundle,int port){
  this.coreExtInt=coreBundle.getExternalInterface();
  this.port=port;
}
Program: 54368
Project: 54368
Buggy source:
@Override protected void configure(){
  bind(NettyMongoServer.class).in(Singleton.class);
  expose(NettyMongoServer.class);
  bind(MongoServerConfig.class).toInstance((MongoServerConfig)() -> port);
  expose(MongoServerConfig.class);
  bind(NettyStringReader.class).to(PooledNettyStringReader.class).in(Singleton.class);
  configureStringPool();
  bind(RequestIdGenerator.class).to(DefaultRequestIdGenerator.class);
  bind(ErrorHandler.class).to(ToroErrorHandler.class).in(Singleton.class);
  bind(RequestMessageByteHandler.class);
  bindMessageDecoder();
  bind(DefaultNettyBsonLowLevelReader.class).in(Singleton.class);
  bind(NettyBsonDocumentReader.class).in(Singleton.class);
  bind(OffHeapNettyBsonLowLevelReader.class).in(Singleton.class);
  bind(OffHeapValuesNettyBsonLowLevelReader.class).to(OffHeapNettyBsonLowLevelReader.class);
  bind(RequestMessageObjectHandler.class).in(Singleton.class);
  bind(ReplyMessageObjectHandler.class);
  bind(TorodbSafeRequestProcessor.class).in(Singleton.class);
  bind(ReplyMessageEncoder.class).in(Singleton.class);
  bind(MongodMetrics.class).in(Singleton.class);
  bind(NettyBsonDocumentWriter.class).in(Singleton.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  expose(NettyMongoServer.class);
  expose(MongoServerConfig.class);
  bindCore();
  bind(NettyMongoServer.class).in(Singleton.class);
  bind(MongoServerConfig.class).toInstance((MongoServerConfig)() -> port);
  bind(NettyStringReader.class).to(PooledNettyStringReader.class).in(Singleton.class);
  configureStringPool();
  bind(RequestIdGenerator.class).to(DefaultRequestIdGenerator.class);
  bind(ErrorHandler.class).to(ToroErrorHandler.class).in(Singleton.class);
  bind(RequestMessageByteHandler.class);
  bindMessageDecoder();
  bind(DefaultNettyBsonLowLevelReader.class).in(Singleton.class);
  bind(NettyBsonDocumentReader.class).in(Singleton.class);
  bind(OffHeapNettyBsonLowLevelReader.class).in(Singleton.class);
  bind(OffHeapValuesNettyBsonLowLevelReader.class).to(OffHeapNettyBsonLowLevelReader.class);
  bind(RequestMessageObjectHandler.class).in(Singleton.class);
  bind(ReplyMessageObjectHandler.class);
  bind(TorodbSafeRequestProcessor.class).in(Singleton.class);
  bind(ReplyMessageEncoder.class).in(Singleton.class);
  bind(MongodMetrics.class).in(Singleton.class);
  bind(NettyBsonDocumentWriter.class).in(Singleton.class);
  bind(ThreadFactory.class).annotatedWith(MongoWp.class).to(ThreadFactory.class);
}
Program: 54369
Project: 54369
Buggy source:
private static ServerConfig createServerConfig(Config config){
  Clock clock=Clock.systemDefaultZone();
  MetricsConfig metricsConfig=() -> true;
  Backend backendConfig=config.getBackend();
  backendConfig.setConnectionPoolConfig(config.getGeneric());
  return new ServerConfig(Guice.createInjector(new EssentialModule(metricsConfig,clock)),generalConfig -> BundleFactory.createBackendBundle(backendConfig,generalConfig),(generalConfig,torodBundle) -> createMongoDbWpBundle(config,torodBundle,generalConfig));
}

Fixed version (ground truth):
private static ServerConfig createServerConfig(Config config){
  Clock clock=Clock.systemDefaultZone();
  MetricsConfig metricsConfig=() -> true;
  Backend backendConfig=config.getBackend();
  backendConfig.setConnectionPoolConfig(config.getGeneric());
  return new ServerConfig(Guice.createInjector(new EssentialModule(metricsConfig,clock)),generalConfig -> BundleFactory.createBackendBundle(backendConfig,generalConfig),getSelfHostAndPort(config),(generalConfig,coreBundle) -> createMongoDbWpBundle(config,coreBundle,generalConfig));
}
Program: 54370
Project: 54370
Buggy source:
private static MongoDbWpBundle createMongoDbWpBundle(Config config,TorodBundle torodBundle,BundleConfig generalConfig){
  int port=config.getProtocol().getMongo().getNet().getPort();
  return new MongoDbWpBundle(new MongoDbWpConfig(torodBundle,port,generalConfig));
}

Fixed version (ground truth):
private static MongoDbWpBundle createMongoDbWpBundle(Config config,MongoDbCoreBundle coreBundle,BundleConfig generalConfig){
  int port=config.getProtocol().getMongo().getNet().getPort();
  return new MongoDbWpBundle(new MongoDbWpConfig(coreBundle,port,generalConfig));
}
Program: 54371
Project: 54371
Buggy source:
public BiFunction<BundleConfig,TorodBundle,MongoDbWpBundle> getMongoDbWpBundleGenerator(){
  return mongoDbWpBundleGenerator;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public BiFunction<BundleConfig,MongoDbCoreBundle,MongoDbWpBundle> getMongoDbWpBundleGenerator(){
  return mongoDbWpBundleGenerator;
}
Program: 54372
Project: 54372
Buggy source:
public ServerConfig(Injector essentialInjector,Function<BundleConfig,BackendBundle> backendBundleGenerator,BiFunction<BundleConfig,TorodBundle,MongoDbWpBundle> wpBundleGenerator){
  this.essentialInjector=essentialInjector;
  this.backendBundleGenerator=backendBundleGenerator;
  this.mongoDbWpBundleGenerator=wpBundleGenerator;
}

Fixed version (ground truth):
public ServerConfig(Injector essentialInjector,Function<BundleConfig,BackendBundle> backendBundleGenerator,HostAndPort selfHostAndPort,BiFunction<BundleConfig,MongoDbCoreBundle,MongoDbWpBundle> mongoDbWpBundleGenerator){
  this.essentialInjector=essentialInjector;
  this.backendBundleGenerator=backendBundleGenerator;
  this.selfHostAndPort=selfHostAndPort;
  this.mongoDbWpBundleGenerator=mongoDbWpBundleGenerator;
}
Program: 54373
Project: 54373
Buggy source:
@Override protected void startUp() throws Exception {
  LOGGER.info("String_Node_Str");
  shutdowner.startAsync();
  shutdowner.awaitRunning();
  BackendBundle backendBundle=config.getBackendBundleGenerator().apply(generalBundleConfig);
  startBundle(backendBundle);
  TorodBundle torodBundle=createTorodBundle(backendBundle);
  startBundle(torodBundle);
  MongoDbWpBundle mongodbWpBundle=config.getMongoDbWpBundleGenerator().apply(generalBundleConfig,torodBundle);
  startBundle(mongodbWpBundle);
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
@Override protected void startUp() throws Exception {
  LOGGER.info("String_Node_Str");
  shutdowner.startAsync();
  shutdowner.awaitRunning();
  BackendBundle backendBundle=config.getBackendBundleGenerator().apply(generalBundleConfig);
  startBundle(backendBundle);
  TorodBundle torodBundle=createTorodBundle(backendBundle);
  startBundle(torodBundle);
  MongoDbCoreBundle mongoDbCoreBundle=createMongoDbCoreBundle(torodBundle);
  startBundle(mongoDbCoreBundle);
  MongoDbWpBundle mongodbWpBundle=config.getMongoDbWpBundleGenerator().apply(generalBundleConfig,mongoDbCoreBundle);
  startBundle(mongodbWpBundle);
  LOGGER.info("String_Node_Str");
}