nus-yam/ex-repair huggingface dataset:
Program: 8333
Project: 8333
Buggy source:
private void debugLifeCycleMethods(CtClass classToTransform,CtMethod[] methods) throws CannotCompileException, AfterBurnerImpossibleException, NotFoundException {
  for (  CtMethod lifeCycleHook : methods) {
    String methodName=lifeCycleHook.getName();
    if (methodName.startsWith("String_Node_Str")) {
      log.info("String_Node_Str" + methodName);
      try {
        afterBurner.afterOverrideMethod(classToTransform,methodName,"String_Node_Str" + methodName + "String_Node_Str");
      }
 catch (      Exception e) {
        log.info("String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
private void debugLifeCycleMethods(CtClass classToTransform,CtMethod[] methods) throws CannotCompileException, AfterBurnerImpossibleException, NotFoundException {
  for (  CtMethod lifeCycleHook : methods) {
    String methodName=lifeCycleHook.getName();
    if (methodName.startsWith("String_Node_Str")) {
      log.info("String_Node_Str" + methodName);
      try {
        String body=String.format("String_Node_Str",classToTransform.getSimpleName(),methodName);
        afterBurner.afterOverrideMethod(classToTransform,methodName,body);
      }
 catch (      Exception e) {
        log.info("String_Node_Str",e);
      }
    }
  }
}
Program: 8334
Project: 8334
Buggy source:
public BluetoothListPreference(final Context context,final AttributeSet attrs){
  super(context,attrs);
  if (D)   Log.d(TAG,"String_Node_Str");
  CharSequence[] entries=new CharSequence[1];
  CharSequence[] values=new CharSequence[1];
  final BluetoothAdapter adapter=BluetoothAdapter.getDefaultAdapter();
  Set<BluetoothDevice> devices=adapter.getBondedDevices();
  if (devices.size() > 0) {
    entries=new CharSequence[devices.size()];
    values=new CharSequence[devices.size()];
    int i=0;
    for (    BluetoothDevice device : devices) {
      entries[i]=device.getName();
      values[i]=device.getAddress();
      i++;
    }
  }
 else {
    entries[0]=context.getResources().getString(R.string.msg_btlist_empty);
    values[0]="String_Node_Str";
  }
  setEntries(entries);
  setEntryValues(values);
}

Fixed version (ground truth):
public BluetoothListPreference(final Context context,final AttributeSet attrs){
  super(context,attrs);
  if (D)   Log.d(TAG,"String_Node_Str");
  CharSequence[] entries=new CharSequence[1];
  CharSequence[] values=new CharSequence[1];
  Set<BluetoothDevice> devices=null;
  final BluetoothAdapter adapter=BluetoothAdapter.getDefaultAdapter();
  if (adapter != null) {
    devices=adapter.getBondedDevices();
    if (devices.size() > 0) {
      entries=new CharSequence[devices.size()];
      values=new CharSequence[devices.size()];
      int i=0;
      for (      BluetoothDevice device : devices) {
        entries[i]=device.getName();
        values[i]=device.getAddress();
        i++;
      }
    }
  }
  if (devices == null || devices.size() <= 0) {
    entries[0]=context.getResources().getString(R.string.msg_error_no_bluetooth);
    values[0]="String_Node_Str";
  }
  setEntries(entries);
  setEntryValues(values);
}
Program: 8335
Project: 8335
Buggy source:
/** 
 * This method connects a network.
 * @param callbackContext        A Cordova callback context
 * @param data                JSON Array, with [0] being SSID to connect
 * @return    true if network connected, false if failed
 */
private boolean connectNetwork(CallbackContext callbackContext,JSONArray data){
  Log.d(TAG,"String_Node_Str");
  if (!validateData(data)) {
    callbackContext.error("String_Node_Str");
    Log.d(TAG,"String_Node_Str");
    return false;
  }
  String ssidToConnect="String_Node_Str";
  try {
    ssidToConnect=data.getString(0);
  }
 catch (  Exception e) {
    callbackContext.error(e.getMessage());
    Log.d(TAG,e.getMessage());
    return false;
  }
  int networkIdToConnect=ssidToNetworkId(ssidToConnect);
  if (networkIdToConnect > 0) {
    wifiManager.disableNetwork(networkIdToConnect);
    wifiManager.enableNetwork(networkIdToConnect,true);
    callbackContext.success("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str" + ssidToConnect + "String_Node_Str");
    Log.d(TAG,"String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method connects a network.
 * @param callbackContext        A Cordova callback context
 * @param data                JSON Array, with [0] being SSID to connect
 * @return    true if network connected, false if failed
 */
private boolean connectNetwork(CallbackContext callbackContext,JSONArray data){
  Log.d(TAG,"String_Node_Str");
  if (!validateData(data)) {
    callbackContext.error("String_Node_Str");
    Log.d(TAG,"String_Node_Str");
    return false;
  }
  String ssidToConnect="String_Node_Str";
  try {
    ssidToConnect=data.getString(0);
  }
 catch (  Exception e) {
    callbackContext.error(e.getMessage());
    Log.d(TAG,e.getMessage());
    return false;
  }
  int networkIdToConnect=ssidToNetworkId(ssidToConnect);
  if (networkIdToConnect >= 0) {
    wifiManager.disableNetwork(networkIdToConnect);
    wifiManager.enableNetwork(networkIdToConnect,true);
    callbackContext.success("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str" + ssidToConnect + "String_Node_Str");
    Log.d(TAG,"String_Node_Str");
    return false;
  }
}
Program: 8336
Project: 8336
Buggy source:
/** 
 * This method connects a network.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to connect
 * @return	true if network connected, false if failed
 */
private boolean connectNetwork(CallbackContext callbackContext,JSONArray data){
  if (!validateData(data)) {
    return false;
  }
  String ssidToConnect;
  try {
    ssidToConnect=data.getString(0);
  }
 catch (  Exception e) {
    callbackContext.error(e.getMessage());
  }
  int networkIdToConnect=ssidToNetworkId(ssidToConnect);
  if (networkIdToConnect > 0) {
    wifiManager.enableNetwork(networkIdToConnect,true);
    callbackContext.success("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method connects a network.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to connect
 * @return	true if network connected, false if failed
 */
private boolean connectNetwork(CallbackContext callbackContext,JSONArray data){
  if (!validateData(data)) {
    return false;
  }
  String ssidToConnect="String_Node_Str";
  try {
    ssidToConnect=data.getString(0);
  }
 catch (  Exception e) {
    callbackContext.error(e.getMessage());
  }
  int networkIdToConnect=ssidToNetworkId(ssidToConnect);
  if (networkIdToConnect > 0) {
    wifiManager.enableNetwork(networkIdToConnect,true);
    callbackContext.success("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return false;
  }
}
Program: 8337
Project: 8337
Buggy source:
/** 
 * This method removes a network from the list of configured networks.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to remove
 * @return	true if network removed, false if failed
 */
private boolean removeNetwork(CallbackContext callbackContext,JSONArray data){
  if (!validateData(data)) {
    return false;
  }
  String ssidToDisconnect=data.getString(0);
  int networkIdToRemove=ssidToNetworkId(ssidToDisconnect);
  if (networkIdToRemove > 0) {
    wifiManager.removeNetwork(networkIdToRemove);
    wifiManager.saveConfiguration();
    callbackContext.success("String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method removes a network from the list of configured networks.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to remove
 * @return	true if network removed, false if failed
 */
private boolean removeNetwork(CallbackContext callbackContext,JSONArray data){
  if (!validateData(data)) {
    return false;
  }
  try {
    String ssidToDisconnect=data.getString(0);
    int networkIdToRemove=ssidToNetworkId(ssidToDisconnect);
    if (networkIdToRemove > 0) {
      wifiManager.removeNetwork(networkIdToRemove);
      wifiManager.saveConfiguration();
      callbackContext.success("String_Node_Str");
      return true;
    }
 else {
      callbackContext.error("String_Node_Str");
      return false;
    }
  }
 catch (  Exception e) {
    callbackContext.error(e.getMessage());
  }
}
Program: 8338
Project: 8338
Buggy source:
private boolean validateData(JSONArray data){
  try {
    if (data == null || data.get(0) == null) {
      callbackContext.error("String_Node_Str");
      return false;
    }
    return true;
  }
 catch (  Exception e) {
    callbackContext.error(e.getMessage());
  }
}

Fixed version (ground truth):
private boolean validateData(JSONArray data){
  try {
    if (data == null || data.get(0) == null) {
      callbackContext.error("String_Node_Str");
      return false;
    }
    return true;
  }
 catch (  Exception e) {
    callbackContext.error(e.getMessage());
  }
  return false;
}
Program: 8339
Project: 8339
Buggy source:
/** 
 * This method takes a given String, searches the current list of configured WiFi networks, and returns the networkId for the netowrk if the SSID matches. If not, it returns -1.
 */
private int ssidToNetworkId(String ssid){
  List<WifiConfiguration> currentNetworks=wifiManager.getConfiguredNetworks();
  int numberOfNetworks=currentNetworks.size();
  int networkId;
  WifiConfiguration test;
  for (int i=0; i < numberOfNetworks; i++) {
    test=currentNetworks.get(i);
    if (test.SSID.equals(ssid)) {
      networkId=test.networkId;
    }
  }
  return networkId;
}

Fixed version (ground truth):
/** 
 * This method takes a given String, searches the current list of configured WiFi networks, and returns the networkId for the netowrk if the SSID matches. If not, it returns -1.
 */
private int ssidToNetworkId(String ssid){
  List<WifiConfiguration> currentNetworks=wifiManager.getConfiguredNetworks();
  int numberOfNetworks=currentNetworks.size();
  int networkId=-1;
  WifiConfiguration test;
  for (int i=0; i < numberOfNetworks; i++) {
    test=currentNetworks.get(i);
    if (test.SSID.equals(ssid)) {
      networkId=test.networkId;
    }
  }
  return networkId;
}
Program: 8340
Project: 8340
Buggy source:
/** 
 * This method removes a network from the list of configured networks.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to remove
 * @return	true if network removed, false if failed
 */
private boolean removeNetwork(CallbackContext callbackContext,JSONArray data){
  Log.d(TAG,"String_Node_Str");
  if (!validateData(data)) {
    callbackContext.error("String_Node_Str");
    Log.d(TAG,"String_Node_Str");
    return false;
  }
  try {
    String ssidToDisconnect=data.getString(0);
    int networkIdToRemove=ssidToNetworkId(ssidToDisconnect);
    if (networkIdToRemove > 0) {
      wifiManager.removeNetwork(networkIdToRemove);
      wifiManager.saveConfiguration();
      callbackContext.success("String_Node_Str");
      return true;
    }
 else {
      callbackContext.error("String_Node_Str");
      Log.d(TAG,"String_Node_Str");
      return false;
    }
  }
 catch (  Exception e) {
    callbackContext.error(e.getMessage());
    Log.d(TAG,e.getMessage());
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method removes a network from the list of configured networks.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to remove
 * @return	true if network removed, false if failed
 */
private boolean removeNetwork(CallbackContext callbackContext,JSONArray data){
  Log.d(TAG,"String_Node_Str");
  if (!validateData(data)) {
    callbackContext.error("String_Node_Str");
    Log.d(TAG,"String_Node_Str");
    return false;
  }
  try {
    String ssidToDisconnect=data.getString(0);
    int networkIdToRemove=ssidToNetworkId(ssidToDisconnect);
    if (networkIdToRemove >= 0) {
      wifiManager.removeNetwork(networkIdToRemove);
      wifiManager.saveConfiguration();
      callbackContext.success("String_Node_Str");
      return true;
    }
 else {
      callbackContext.error("String_Node_Str");
      Log.d(TAG,"String_Node_Str");
      return false;
    }
  }
 catch (  Exception e) {
    callbackContext.error(e.getMessage());
    Log.d(TAG,e.getMessage());
    return false;
  }
}
Program: 8341
Project: 8341
Buggy source:
/** 
 * This method disconnects a network.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to connect
 * @return	true if network disconnected, false if failed
 */
private boolean disconnectNetwork(CallbackContext callbackContext,JSONArray data){
  if (!validateData(data)) {
    return false;
  }
  String ssidToDisconnect=data.get(0);
  int networkIdToDisconnect=ssidToNetworkId(ssidToDisconnect);
  if (networkIdToDisconnect > 0) {
    wifiManager.disableNetwork(networkIdToDisconnect);
    callbackContext.success("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method disconnects a network.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to connect
 * @return	true if network disconnected, false if failed
 */
private boolean disconnectNetwork(CallbackContext callbackContext,JSONArray data){
  if (!validateData(data)) {
    return false;
  }
  String ssidToDisconnect=data.getString(0);
  int networkIdToDisconnect=ssidToNetworkId(ssidToDisconnect);
  if (networkIdToDisconnect > 0) {
    wifiManager.disableNetwork(networkIdToDisconnect);
    callbackContext.success("String_Node_Str" + ssidToDisconnect + "String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str" + ssidToDisconnect + "String_Node_Str");
    return false;
  }
}
Program: 8342
Project: 8342
Buggy source:
/** 
 * This methods adds a network to the list of available WiFi networks. If the network already exists, then it updates it.
 * @params callbackContext 	A Cordova callback context.
 * @params data				JSON Array with [0] == SSID, [1] == password
 * @return true	if add successful, false if add fails
 */
private boolean addNetwork(CallbackContext callbackContext,JSONArray data){
  WifiConfiguration wifi=new WifiConfiguration();
  String authType=data.getString(2);
  if (authType.equals("String_Node_Str")) {
  }
 else   if (authType.equals("String_Node_Str")) {
    callbackContext.error("String_Node_Str");
    return false;
  }
 else {
    log.d(TAG,"String_Node_Str");
    callbackContext.error("String_Node_Str" + authType);
    return false;
  }
  wifi.SSID=data.getString(0);
  wifi.preSharedKey=data.getString(1);
  wifi.status=WifiConfiguration.Status.ENABLED;
  wifi.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
  wifi.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
  wifi.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
  wifi.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
  wifi.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
  wifi.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
  wifiManager.addNetwork();
  wifiManager.saveConfiguration();
  return true;
}

Fixed version (ground truth):
/** 
 * This methods adds a network to the list of available WiFi networks. If the network already exists, then it updates it.
 * @params callbackContext 	A Cordova callback context.
 * @params data				JSON Array with [0] == SSID, [1] == password
 * @return true	if add successful, false if add fails
 */
private boolean addNetwork(CallbackContext callbackContext,JSONArray data){
  WifiConfiguration wifi=new WifiConfiguration();
  String authType=data.getString(2);
  if (authType.equals("String_Node_Str")) {
  }
 else   if (authType.equals("String_Node_Str")) {
    callbackContext.error("String_Node_Str");
    return false;
  }
 else {
    callbackContext.error("String_Node_Str" + authType);
    return false;
  }
  wifi.SSID=data.getString(0);
  wifi.preSharedKey=data.getString(1);
  wifi.status=WifiConfiguration.Status.ENABLED;
  wifi.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
  wifi.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
  wifi.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
  wifi.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
  wifi.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
  wifi.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
  wifiManager.addNetwork(wifi);
  wifiManager.saveConfiguration();
  return true;
}
Program: 8343
Project: 8343
Buggy source:
/** 
 * This method connects a network.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to connect
 * @return	true if network connected, false if failed
 */
private boolean connectNetwork(CallbackContext callbackContext,JSONArray data){
  if (!validateData(data)) {
    return false;
  }
  String ssidToConnect=data.get(0);
  int networkIdToConnect=ssidToNetworkId(ssidToConnect);
  if (networkIdToConnect > 0) {
    wifiManager.enableNetwork(networkIdToConnect,true);
    callbackContext.success("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method connects a network.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to connect
 * @return	true if network connected, false if failed
 */
private boolean connectNetwork(CallbackContext callbackContext,JSONArray data){
  if (!validateData(data)) {
    return false;
  }
  String ssidToConnect=data.geString(0);
  int networkIdToConnect=ssidToNetworkId(ssidToConnect);
  if (networkIdToConnect > 0) {
    wifiManager.enableNetwork(networkIdToConnect,true);
    callbackContext.success("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str" + ssidToConnect + "String_Node_Str");
    return false;
  }
}
Program: 8344
Project: 8344
Buggy source:
/** 
 * This method removes a network from the list of configured networks.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to remove
 * @return	true if network removed, false if failed
 */
private boolean removeNetwork(CallbackContext callbackContext,JSONArray data){
  if (!validateData(data)) {
    return false;
  }
  String ssidToDisconnect=data.get(0);
  int networkIdToRemove=ssidToNetworkId(ssidToDisconnect);
  if (networkIdToRemove > 0) {
    wifiManager.removeNetwork(networkIdToRemove);
    wifiManager.saveConfiguration();
    callbackContext.success("String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method removes a network from the list of configured networks.
 * @param callbackContext		A Cordova callback context
 * @param data				JSON Array, with [0] being SSID to remove
 * @return	true if network removed, false if failed
 */
private boolean removeNetwork(CallbackContext callbackContext,JSONArray data){
  if (!validateData(data)) {
    return false;
  }
  String ssidToDisconnect=data.getString(0);
  int networkIdToRemove=ssidToNetworkId(ssidToDisconnect);
  if (networkIdToRemove > 0) {
    wifiManager.removeNetwork(networkIdToRemove);
    wifiManager.saveConfiguration();
    callbackContext.success("String_Node_Str");
    return true;
  }
 else {
    callbackContext.error("String_Node_Str");
    return false;
  }
}
Program: 8345
Project: 8345
Buggy source:
@override public void initialize(CordovaInterface cordova,CordovaWebView webView){
  super.initialize(cordova,webView);
  this.wifiManager=(WifiManager)cordova.getActivity().getSystemService(Context.WIFI_SERVICE);
}

Fixed version (ground truth):
@Override public void initialize(CordovaInterface cordova,CordovaWebView webView){
  super.initialize(cordova,webView);
  this.wifiManager=(WifiManager)cordova.getActivity().getSystemService(Context.WIFI_SERVICE);
}
Program: 8346
Project: 8346
Buggy source:
@override public boolean execute(String action,JSONArray data,CallbackContext callbackContext) throws JSONException {
  this.callbackContext=callbackContext;
  if (!wifiManager.isWifiEnabled()) {
    callbackContext.error("String_Node_Str");
    return false;
  }
  if (action.equals(ADD_NETWORK)) {
    return this.addNetwork(callbackContext,data);
  }
 else   if (action.equals(REMOVE_NETWORK)) {
    return this.removeNetwork(callbackContext,data);
  }
 else   if (action.equals(CONNECT_NETWORK)) {
    return this.connectNetwork(callbackContext,data);
  }
 else   if (action.equals(DISCONNECT_NETOWRK)) {
    return this.disconnectNetwork(callbackContext,data);
  }
 else   if (action.equals(LIST_NETWORKS)) {
    return this.listNetworks(callbackContext,data);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean execute(String action,JSONArray data,CallbackContext callbackContext) throws JSONException {
  this.callbackContext=callbackContext;
  if (!wifiManager.isWifiEnabled()) {
    callbackContext.error("String_Node_Str");
    return false;
  }
  if (action.equals(ADD_NETWORK)) {
    return this.addNetwork(callbackContext,data);
  }
 else   if (action.equals(REMOVE_NETWORK)) {
    return this.removeNetwork(callbackContext,data);
  }
 else   if (action.equals(CONNECT_NETWORK)) {
    return this.connectNetwork(callbackContext,data);
  }
 else   if (action.equals(DISCONNECT_NETWORK)) {
    return this.disconnectNetwork(callbackContext,data);
  }
 else   if (action.equals(LIST_NETWORKS)) {
    return this.listNetworks(callbackContext);
  }
  callbackContext.error("String_Node_Str" + action);
  return false;
}
Program: 8347
Project: 8347
Buggy source:
/** 
 * A method that helps in closing off the current session.
 */
public void closeSession(){
  logger.entering();
  if (isStarted() && (Grid.getTestSession() != null)) {
    new SauceLabsHelper().embedSauceLabsJobUrlToTestReport();
    try {
      Grid.driver().quit();
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str" + e.getMessage(),e);
    }
  }
  Grid.getThreadLocalWebDriver().set(null);
  Grid.getThreadLocalTestSession().set(null);
  Grid.getThreadLocalException().set(null);
  this.isSessionStarted=false;
  logger.exiting();
}

Fixed version (ground truth):
/** 
 * A method that helps in closing off the current session.
 */
public void closeSession(){
  logger.entering();
  if (isStarted() && (Grid.getTestSession() != null)) {
    new SauceLabsHelper().embedSauceLabsJobUrlToTestReport();
    try {
      Grid.driver().quit();
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str" + e.getMessage(),e);
    }
  }
  Grid.getThreadLocalWebDriver().set(null);
  Grid.getThreadLocalTestSession().set(null);
  this.isSessionStarted=false;
  logger.exiting();
}
Program: 8348
Project: 8348
Buggy source:
@Override public final void closeSession(){
  logger.entering();
  Grid.getThreadLocalWebDriver().set(null);
  Grid.getThreadLocalTestSession().set(null);
  Grid.getThreadLocalException().set(null);
  setStarted(false);
  logger.exiting();
}

Fixed version (ground truth):
@Override public final void closeSession(){
  logger.entering();
  Grid.getThreadLocalWebDriver().set(null);
  Grid.getThreadLocalTestSession().set(null);
  setStarted(false);
  logger.exiting();
}
Program: 8349
Project: 8349
Buggy source:
private boolean isPriorityUnique(IInvokedMethod method){
  Set<Integer> check=new HashSet<Integer>();
  int length=method.getTestMethod().getTestClass().getTestMethods().length;
  for (int i=0; i < length; i++) {
    check.add(method.getTestMethod().getTestClass().getTestMethods()[i].getPriority());
    if (check.size() != i + 1) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean isPriorityUnique(IInvokedMethod method){
  Set<Integer> check=new HashSet<Integer>();
  int length=method.getTestMethod().getTestClass().getTestMethods().length;
  int expectedSize=0;
  for (int i=0; i < length; i++) {
    if (!method.getTestMethod().getTestClass().getTestMethods()[i].getEnabled()) {
      continue;
    }
    check.add(method.getTestMethod().getTestClass().getTestMethods()[i].getPriority());
    expectedSize+=1;
    if (check.size() != expectedSize) {
      return false;
    }
  }
  return true;
}
Program: 8350
Project: 8350
Buggy source:
private boolean isHighPriority(IInvokedMethod method){
  int high=method.getTestMethod().getPriority();
  for (  ITestNGMethod test : method.getTestMethod().getTestClass().getTestMethods()) {
    if (test.getPriority() > high) {
      return false;
    }
  }
  Test t=method.getTestMethod().getConstructorOrMethod().getMethod().getAnnotation(Test.class);
  if (!(t.dataProvider().isEmpty())) {
    int currentInvocationCount=method.getTestMethod().getCurrentInvocationCount();
    int parameterInvocationCount=method.getTestMethod().getParameterInvocationCount();
    return (currentInvocationCount == parameterInvocationCount);
  }
  return true;
}

Fixed version (ground truth):
private boolean isHighPriority(IInvokedMethod method){
  if (!isAnnotatedWithTest(method)) {
    return true;
  }
  int high=method.getTestMethod().getPriority();
  for (  ITestNGMethod test : method.getTestMethod().getTestClass().getTestMethods()) {
    if (test.getEnabled() && test.getPriority() > high) {
      return false;
    }
  }
  Test t=method.getTestMethod().getConstructorOrMethod().getMethod().getAnnotation(Test.class);
  if (!(t.dataProvider().isEmpty())) {
    int currentInvocationCount=method.getTestMethod().getCurrentInvocationCount();
    int parameterInvocationCount=method.getTestMethod().getParameterInvocationCount();
    return (currentInvocationCount == parameterInvocationCount);
  }
  return true;
}
Program: 8352
Project: 8352
Buggy source:
private boolean isLowPriority(IInvokedMethod method){
  int low=method.getTestMethod().getPriority();
  for (  ITestNGMethod test : method.getTestMethod().getTestClass().getTestMethods()) {
    if (test.getPriority() < low) {
      return false;
    }
  }
  Test t=method.getTestMethod().getConstructorOrMethod().getMethod().getAnnotation(Test.class);
  int currentInvocationCount=method.getTestMethod().getCurrentInvocationCount();
  if (!t.dataProvider().isEmpty()) {
    return currentInvocationCount == 0;
  }
  return true;
}

Fixed version (ground truth):
private boolean isLowPriority(IInvokedMethod method){
  int low=method.getTestMethod().getPriority();
  for (  ITestNGMethod test : method.getTestMethod().getTestClass().getTestMethods()) {
    if (!isAnnotatedWithTest(test.getConstructorOrMethod().getMethod())) {
      throw new IllegalStateException("String_Node_Str");
    }
    if (test.getEnabled() && test.getPriority() < low) {
      return false;
    }
  }
  Test t=method.getTestMethod().getConstructorOrMethod().getMethod().getAnnotation(Test.class);
  int currentInvocationCount=method.getTestMethod().getCurrentInvocationCount();
  if (!t.dataProvider().isEmpty()) {
    return currentInvocationCount == 0;
  }
  return true;
}
Program: 8353
Project: 8353
Buggy source:
/** 
 * @return A non-null {@link RemoteWebDriver} object which can be used with {@link MobileTest} and/or{@link WebTest} annotated tests. Throws an {@link IllegalStateException} when there is no{@link RemoteWebDriver} session active such as when called outside of a {@link MobileTest} or{@link WebTest} flow.
 */
public static RemoteWebDriver driver(){
  Exception exception=threadLocalException.get();
  if (exception != null) {
    if (exception instanceof RuntimeException) {
      throw (RuntimeException)exception;
    }
    throw new RuntimeException(exception.getMessage(),exception);
  }
  AbstractTestSession testSession=getTestSession();
  if (!testSession.isStarted()) {
    testSession.startSession();
  }
  RemoteWebDriver rwd=threadLocalWebDriver.get();
  if (rwd == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  return rwd;
}

Fixed version (ground truth):
/** 
 * @return A non-null {@link RemoteWebDriver} object which can be used with {@link MobileTest} and/or{@link WebTest} annotated tests. Throws an {@link IllegalStateException} when there is no{@link RemoteWebDriver} session active such as when called outside of a {@link MobileTest} or{@link WebTest} flow.
 */
public static RemoteWebDriver driver(){
  AbstractTestSession testSession=getTestSession();
  if (testSession == null) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
  if (!testSession.isStarted()) {
    testSession.startSession();
  }
  RemoteWebDriver rwd=threadLocalWebDriver.get();
  if (rwd == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  return rwd;
}
Program: 8354
Project: 8354
Buggy source:
public static ThreadLocal<Exception> getThreadLocalException(){
  return threadLocalException;
}

Fixed version (ground truth):
@Deprecated public static ThreadLocal<Exception> getThreadLocalException(){
  return threadLocalException;
}
Program: 8355
Project: 8355
Buggy source:
/** 
 * Use this constructor when a file that is available in the classpath is to be read by the ExcelDataProvider for supporting Data Driven Tests.
 * @param fileStream the stream of the excel file to be read.
 * @throws IOException If the file cannot be located, or cannot read by the method.
 */
public ExcelReader(DataResource resource) throws IOException {
  logger.entering(resource);
  if (resource == null || StringUtils.isBlank(resource.getType())) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    if (resource.getType().toLowerCase().endsWith("String_Node_Str")) {
      workBook=new XSSFWorkbook(resource.getInputStream());
    }
 else     if (resource.getType().toLowerCase().endsWith("String_Node_Str")) {
      workBook=new HSSFWorkbook(resource.getInputStream());
    }
    IOUtils.closeQuietly(resource.getInputStream());
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
catch (  RuntimeException e) {
    throw new IOException(e);
  }
  logger.exiting();
}

Fixed version (ground truth):
/** 
 * Use this constructor when a file that is available in the classpath is to be read by the ExcelDataProvider for supporting Data Driven Tests.
 * @param resource the stream of the excel file to be read.
 * @throws IOException If the file cannot be located, or cannot read by the method.
 */
public ExcelReader(DataResource resource) throws IOException {
  logger.entering(resource);
  if (resource == null || StringUtils.isBlank(resource.getType())) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    if (resource.getType().toLowerCase().endsWith("String_Node_Str")) {
      workBook=new XSSFWorkbook(resource.getInputStream());
    }
 else     if (resource.getType().toLowerCase().endsWith("String_Node_Str")) {
      workBook=new HSSFWorkbook(resource.getInputStream());
    }
    IOUtils.closeQuietly(resource.getInputStream());
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
catch (  RuntimeException e) {
    throw new IOException(e);
  }
  logger.exiting();
}
Program: 8356
Project: 8356
Buggy source:
@Test(groups="String_Node_Str") public void testgetJsonDataByIndexFilter() throws IOException {
  DataResource resource=new FileSystemResource(jsonPojoArrayDataFile,USER.class);
  SeLionDataProvider dataProvider=DataProviderFactory.getDataProvider(resource);
  SimpleIndexInclusionFilter filter=new SimpleIndexInclusionFilter("String_Node_Str");
  Iterator<Object[]> dataObject=dataProvider.getDataByFilter(filter);
  for (int i=0; dataObject.hasNext(); i++) {
    USER userData=(USER)dataObject.next()[0];
switch (i) {
case 0:
{
        assertTrue(userData.getName().equals("String_Node_Str"));
        assertTrue(userData.getBank().getAddress().getStreet().equals("String_Node_Str"));
        break;
      }
case 1:
{
      assertTrue(userData.getName().equals("String_Node_Str"));
      assertTrue(userData.getBank().getName().equals("String_Node_Str"));
      break;
    }
case 2:
{
    assertTrue(userData.getPhoneNumber().equals("String_Node_Str"));
    assertTrue(userData.getAreaCode()[1].getAreaCode().equals("String_Node_Str"));
    break;
  }
}
}
}

Fixed version (ground truth):
@Test(groups="String_Node_Str") public void testgetJsonDataByIndexFilter() throws IOException {
  DataResource resource=new FileSystemResource(jsonPojoArrayDataFile,USER.class);
  SeLionDataProvider dataProvider=DataProviderFactory.getDataProvider(resource);
  SimpleIndexInclusionFilter filter=new SimpleIndexInclusionFilter("String_Node_Str");
  Iterator<Object[]> dataObject=dataProvider.getDataByFilter(filter);
  for (int i=0; dataObject.hasNext(); i++) {
    USER userData=(USER)dataObject.next()[0];
switch (i) {
case 0:
{
        assertTrue(userData.getName().equals("String_Node_Str"));
        assertTrue(userData.getBank().getAddress().getStreet().equals("String_Node_Str"));
        break;
      }
case 1:
{
      assertTrue(userData.getName().equals("String_Node_Str"));
      assertTrue(userData.getBank().getName().equals("String_Node_Str"));
      break;
    }
case 2:
{
    assertTrue(userData.getPhoneNumber().equals("String_Node_Str"));
    assertTrue(userData.getAreaCode()[1].getAreaCode().equals("String_Node_Str"));
    break;
  }
default :
{
  fail("String_Node_Str");
}
}
}
}
Program: 8357
Project: 8357
Buggy source:
public AREA_CODE[] getAreaCode(){
  return areaCode;
}

Fixed version (ground truth):
public AREA_CODE[] getAreaCode(){
  return (areaCode == null) ? null : Arrays.copyOf(areaCode,areaCode.length);
}
Program: 8358
Project: 8358
Buggy source:
@Override protected void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  LOGGER.entering();
  Map<String,String> requestParams=ServletHelper.getParameters(req);
  if (!CONFIGURED_TOKEN_VALUE.equals(requestParams.get(TOKEN_PARAMETER))) {
    ServletHelper.respondAsJsonWithHttpStatus(resp,new NodeResponseBody().setFailed(),HttpServletResponse.SC_FORBIDDEN);
    LOGGER.exiting();
    return;
  }
  ServletHelper.respondAsJsonWithHttpStatus(resp,new NodeResponseBody().setSuccess(),HttpServletResponse.SC_OK);
  LOGGER.warning("String_Node_Str");
  try {
    shutdownHandler.shutdownProcesses();
  }
 catch (  ProcessHandlerException e) {
    LOGGER.log(Level.SEVERE,e.getMessage(),e);
  }
 finally {
    new Thread(new Runnable(){
      @Override public void run(){
        try {
          Thread.sleep(2000);
        }
 catch (        InterruptedException e) {
          System.exit(0);
        }
        System.exit(0);
      }
    }
,"String_Node_Str").start();
  }
  LOGGER.exiting();
}

Fixed version (ground truth):
@Override protected void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  LOGGER.entering();
  Map<String,String> requestParams=ServletHelper.getParameters(req);
  if (!CONFIGURED_TOKEN_VALUE.equals(requestParams.get(TOKEN_PARAMETER))) {
    ServletHelper.respondAsJsonWithHttpStatus(resp,new NodeResponseBody().setFailed(),HttpServletResponse.SC_FORBIDDEN);
    LOGGER.exiting();
    return;
  }
  LOGGER.warning("String_Node_Str");
  try {
    shutdownHandler.shutdownProcesses();
  }
 catch (  ProcessHandlerException e) {
    LOGGER.log(Level.SEVERE,e.getMessage(),e);
  }
 finally {
    ServletHelper.respondAsJsonWithHttpStatus(resp,new NodeResponseBody().setSuccess(),HttpServletResponse.SC_OK);
    new Thread(new Runnable(){
      @Override public void run(){
        try {
          Thread.sleep(2000);
        }
 catch (        InterruptedException e) {
          System.exit(0);
        }
        System.exit(0);
      }
    }
,"String_Node_Str").start();
  }
  LOGGER.exiting();
}
Program: 8359
Project: 8359
Buggy source:
/** 
 * Forcefully shuts the node down by calling   {@link NodeForceRestartServlet}
 */
public synchronized void forceNodeShutdown(){
  LOGGER.entering();
  stopNodeRecycleThread();
  if (!canForceShutdown) {
    LOGGER.exiting();
    return;
  }
  for (  TestSlot slot : getTestSlots()) {
    if (slot.getSession() != null) {
      totalSessionsCompleted++;
      proxyLogger.info("String_Node_Str" + totalSessionsCompleted + "String_Node_Str"+ slot.getSession().toString()+ "String_Node_Str");
      getRegistry().forceRelease(slot,SessionTerminationReason.TIMEOUT);
    }
  }
  List<NameValuePair> nvps=new ArrayList<>();
  nvps.add(new BasicNameValuePair(NodeForceRestartServlet.TOKEN_PARAMETER,NodeForceRestartServlet.CONFIGURED_TOKEN_VALUE));
  HttpResponse response=sendToNodeServlet(NodeForceRestartServlet.class,nvps);
  if (response == null) {
    proxyLogger.warning("String_Node_Str" + getId() + "String_Node_Str");
    LOGGER.exiting(false);
    return;
  }
  final int responseStatusCode=response.getStatusLine().getStatusCode();
  if (responseStatusCode != HttpStatus.SC_OK) {
    proxyLogger.info("String_Node_Str" + getId() + "String_Node_Str"+ responseStatusCode);
    LOGGER.exiting(false);
    return;
  }
  proxyLogger.info("String_Node_Str" + getId() + "String_Node_Str");
  getRegistry().removeIfPresent(this);
  LOGGER.exiting();
}

Fixed version (ground truth):
/** 
 * Forcefully shuts the node down by calling   {@link NodeForceRestartServlet}
 */
public synchronized void forceNodeShutdown(){
  LOGGER.entering();
  stopNodeRecycleThread();
  if (!canForceShutdown) {
    LOGGER.exiting();
    return;
  }
  for (  TestSlot slot : getTestSlots()) {
    if (slot.getSession() != null) {
      totalSessionsCompleted++;
      proxyLogger.info("String_Node_Str" + totalSessionsCompleted + "String_Node_Str"+ slot.getSession().toString()+ "String_Node_Str");
      getRegistry().forceRelease(slot,SessionTerminationReason.TIMEOUT);
    }
  }
  List<NameValuePair> nvps=new ArrayList<>();
  nvps.add(new BasicNameValuePair(NodeForceRestartServlet.TOKEN_PARAMETER,NodeForceRestartServlet.CONFIGURED_TOKEN_VALUE));
  HttpResponse response=sendToNodeServlet(NodeForceRestartServlet.class,nvps);
  if (response == null) {
    proxyLogger.warning("String_Node_Str" + getId() + "String_Node_Str");
    LOGGER.exiting(false);
    return;
  }
  final int responseStatusCode=response.getStatusLine().getStatusCode();
  if (responseStatusCode != HttpStatus.SC_OK) {
    proxyLogger.info("String_Node_Str" + getId() + "String_Node_Str"+ responseStatusCode);
    LOGGER.exiting(false);
    return;
  }
  proxyLogger.info("String_Node_Str" + getId() + "String_Node_Str");
  LOGGER.exiting();
}
Program: 8360
Project: 8360
Buggy source:
private void readConfigFileContents() throws IOException {
  LOGGER.entering();
  InputStream stream=null;
  if (StringUtils.isBlank(configFile)) {
    LOGGER.fine("String_Node_Str");
    stream=this.getClass().getResourceAsStream(SeLionGridConstants.SELION_CONFIG_FILE_RESOURCE);
  }
 else {
    File config=new File(configFile);
    String path=config.getAbsolutePath();
    checkArgument(config.exists(),path + "String_Node_Str");
    checkArgument(config.isFile(),path + "String_Node_Str");
    LOGGER.fine("String_Node_Str" + configFile);
    stream=new FileInputStream(config);
  }
  BufferedReader br=new BufferedReader(new InputStreamReader(stream));
  StringBuilder builder=new StringBuilder();
  String line=null;
  try {
    while ((line=br.readLine()) != null) {
      builder.append(line);
    }
  }
  finally {
    IOUtils.closeQuietly(br);
  }
  try {
    configuration=new JsonParser().parse(builder.toString()).getAsJsonObject();
  }
 catch (  JsonSyntaxException e) {
    throw new ConfigParserException(e);
  }
  LOGGER.exiting();
}

Fixed version (ground truth):
private static void readConfigFileContents() throws IOException {
  LOGGER.entering();
  InputStream stream=null;
  if (StringUtils.isBlank(configFile)) {
    LOGGER.fine("String_Node_Str");
    stream=ConfigParser.class.getResourceAsStream(SeLionGridConstants.SELION_CONFIG_FILE_RESOURCE);
  }
 else {
    File config=new File(configFile);
    String path=config.getAbsolutePath();
    checkArgument(config.exists(),path + "String_Node_Str");
    checkArgument(config.isFile(),path + "String_Node_Str");
    LOGGER.fine("String_Node_Str" + configFile);
    stream=new FileInputStream(config);
  }
  BufferedReader br=new BufferedReader(new InputStreamReader(stream));
  StringBuilder builder=new StringBuilder();
  String line=null;
  try {
    while ((line=br.readLine()) != null) {
      builder.append(line);
    }
  }
  finally {
    IOUtils.closeQuietly(br);
  }
  try {
    configuration=new JsonParser().parse(builder.toString()).getAsJsonObject();
  }
 catch (  JsonSyntaxException e) {
    throw new ConfigParserException(e);
  }
  LOGGER.exiting();
}
Program: 8361
Project: 8361
Buggy source:
private ConfigParser(){
  try {
    readConfigFileContents();
  }
 catch (  IOException e) {
    throw new ConfigParserException(e);
  }
}

Fixed version (ground truth):
private ConfigParser(){
}
Program: 8362
Project: 8362
Buggy source:
@Override public String toString(){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  builder.append(configuration.toString());
  builder.append("String_Node_Str");
  builder.append(configFile);
  builder.append("String_Node_Str");
  return builder.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  builder.append(configuration == null ? null : configuration.toString());
  builder.append("String_Node_Str");
  builder.append(configFile);
  builder.append("String_Node_Str");
  return builder.toString();
}
Program: 8363
Project: 8363
Buggy source:
/** 
 * @return A {@link ConfigParser} object that can be used to retrieve values from the Configuration object asrepresented by the JSON file passed via the JVM argument <b>SeLionConfig</b>
 */
public static ConfigParser parse(){
  LOGGER.exiting(parser.toString());
  return parser;
}

Fixed version (ground truth):
/** 
 * @return A {@link ConfigParser} object that can be used to retrieve values from the Configuration object asrepresented by the JSON file passed via the JVM argument <b>SeLionConfig</b>
 */
public static ConfigParser parse(){
  LOGGER.entering();
  if (configuration == null) {
    try {
      readConfigFileContents();
    }
 catch (    IOException e) {
      throw new ConfigParserException(e);
    }
  }
  LOGGER.exiting(parser.toString());
  return parser;
}
Program: 8364
Project: 8364
Buggy source:
/** 
 * Set the config file
 * @param file the SeLion Grid config file to use
 */
public static void setConfigFile(String file){
  LOGGER.entering(file);
  configFile=file;
}

Fixed version (ground truth):
/** 
 * Set the config file
 * @param file the SeLion Grid config file to use
 */
public static ConfigParser setConfigFile(String file){
  LOGGER.entering(file);
  if (configuration == null) {
    configFile=file;
  }
  LOGGER.exiting(parser.toString());
  return parser;
}
Program: 8365
Project: 8365
Buggy source:
@BeforeClass public void before() throws Exception {
  mockStatic(ConfigParser.class);
  doCallRealMethod().when(ConfigParser.class,"String_Node_Str",Mockito.anyString());
  when(ConfigParser.parse()).thenCallRealMethod();
  ConfigParser.setConfigFile(new File(ConfigParserTest.class.getResource("String_Node_Str").getPath()).getAbsolutePath());
}

Fixed version (ground truth):
@BeforeClass public void before() throws Exception {
  mockStatic(ConfigParser.class);
  doCallRealMethod().when(ConfigParser.class,"String_Node_Str",Mockito.anyString());
  when(ConfigParser.parse()).thenCallRealMethod();
  doCallRealMethod().when(ConfigParser.class,"String_Node_Str");
  ConfigParser.setConfigFile(new File(ConfigParserTest.class.getResource("String_Node_Str").getPath()).getAbsolutePath());
}
Program: 8366
Project: 8366
Buggy source:
/** 
 * Gracefully shuts the node down by;<br> <br> 1. Stops accepting new sessions<br> 2. Waits for sessions to complete<br> 3. Calls   {@link #forceNodeShutdown}<br>
 */
public synchronized void requestNodeShutdown(){
  LOGGER.entering();
  forceShutDown=true;
  startNodeRecycleThread();
  LOGGER.exiting();
}

Fixed version (ground truth):
/** 
 * Gracefully shuts the node down by;<br> <br> 1. Stops accepting new sessions<br> 2. Waits for sessions to complete<br> 3. Calls   {@link #forceNodeShutdown}<br>
 */
public void requestNodeShutdown(){
  LOGGER.entering();
  forceShutDown=true;
  startNodeRecycleThread();
  LOGGER.exiting();
}
Program: 8367
Project: 8367
Buggy source:
@Override public TestSession getNewSession(Map<String,Object> requestedCapability){
  LOGGER.entering();
  TestSession session;
synchronized (this) {
    if (totalSessionsStarted >= maxSessionsAllowed || forceShutDown) {
      proxyLogger.fine("String_Node_Str" + (totalSessionsStarted >= maxSessionsAllowed) + "String_Node_Str"+ getId());
      proxyLogger.fine("String_Node_Str" + (forceShutDown) + "String_Node_Str"+ getId());
      LOGGER.exiting(null);
      return null;
    }
    session=super.getNewSession(requestedCapability);
    if (session != null) {
      totalSessionsStarted++;
      if (totalSessionsStarted >= maxSessionsAllowed) {
        startNodeRecycleThread();
      }
      proxyLogger.fine("String_Node_Str" + totalSessionsStarted + "String_Node_Str"+ session.toString()+ "String_Node_Str");
    }
    LOGGER.exiting((session != null) ? session.toString() : null);
    return session;
  }
}

Fixed version (ground truth):
@Override public TestSession getNewSession(Map<String,Object> requestedCapability){
  LOGGER.entering();
  if (totalSessionsStarted >= maxSessionsAllowed || forceShutDown) {
    return logSessionInfo();
  }
  try {
    accessLock.lock();
    if (totalSessionsStarted >= maxSessionsAllowed || forceShutDown) {
      return logSessionInfo();
    }
    TestSession session=super.getNewSession(requestedCapability);
    if (session != null) {
      totalSessionsStarted++;
      if (totalSessionsStarted >= maxSessionsAllowed) {
        startNodeRecycleThread();
      }
      proxyLogger.fine("String_Node_Str" + totalSessionsStarted + "String_Node_Str"+ session.toString()+ "String_Node_Str");
    }
    LOGGER.exiting((session != null) ? session.toString() : null);
    return session;
  }
  finally {
    accessLock.unlock();
  }
}