nus-yam/ex-repair huggingface dataset:
Program: 54263
Project: 54263
Buggy source:
@Override public void onPortFound(String port,String protocol){
  final String openPort=port;
  final String portProto=protocol;
  PortScanner.this.runOnUiThread(new Runnable(){
    @Override public void run(){
      String proto=System.getProtocolByPort(openPort), entry=openPort;
      if (proto != null)       entry=openPort + "String_Node_Str" + proto+ "String_Node_Str";
 else       entry=portProto + "String_Node_Str" + openPort;
      mPortList.add(entry);
      mListAdapter.notifyDataSetChanged();
      System.addOpenPort(Integer.parseInt(openPort),Network.Protocol.fromString(portProto));
    }
  }
);
}

Fixed version (ground truth):
@Override public void onPortFound(String port,String protocol){
  final int portNumber=Integer.parseInt(port);
  final String portProtocol=protocol;
  final String resolvedProtocol=System.getProtocolByPort(port);
  System.addOpenPort(portNumber,Network.Protocol.fromString(protocol));
  PortScanner.this.runOnUiThread(new Runnable(){
    @Override public void run(){
      String entry;
      if (resolvedProtocol != null)       entry=portNumber + "String_Node_Str" + resolvedProtocol+ "String_Node_Str";
 else       entry=portProtocol + "String_Node_Str" + portNumber;
      if (!mPortList.contains(entry)) {
        mPortList.add(entry);
        mListAdapter.notifyDataSetChanged();
      }
    }
  }
);
}
Program: 54264
Project: 54264
Buggy source:
@Override public void run(){
  String proto=System.getProtocolByPort(openPort), entry=openPort;
  if (proto != null)   entry=openPort + "String_Node_Str" + proto+ "String_Node_Str";
 else   entry=portProto + "String_Node_Str" + openPort;
  mPortList.add(entry);
  mListAdapter.notifyDataSetChanged();
  System.addOpenPort(Integer.parseInt(openPort),Network.Protocol.fromString(portProto));
}

Fixed version (ground truth):
@Override public void run(){
  String entry;
  if (resolvedProtocol != null)   entry=portNumber + "String_Node_Str" + resolvedProtocol+ "String_Node_Str";
 else   entry=portProtocol + "String_Node_Str" + portNumber;
  if (!mPortList.contains(entry)) {
    mPortList.add(entry);
    mListAdapter.notifyDataSetChanged();
  }
}
Program: 54265
Project: 54265
Buggy source:
private void setStartedState(){
  mPortList.clear();
  System.getNMap().synScan(System.getCurrentTarget(),mScanReceiver,mCustomPorts).start();
  mRunning=true;
}

Fixed version (ground truth):
private void setStartedState(){
  createPortList();
  System.getNMap().synScan(System.getCurrentTarget(),mScanReceiver,mCustomPorts).start();
  mRunning=true;
}
Program: 54266
Project: 54266
Buggy source:
public void run(){
  try {
    String line=null;
    Logger.debug("String_Node_Str" + mFIFOPath + "String_Node_Str"+ mFIFONum+ "String_Node_Str");
    while (!(new File(mFIFOPath).exists()))     Thread.sleep(200);
    Logger.debug("String_Node_Str");
    mReader=new BufferedReader(new FileReader(mFIFOPath));
    Logger.debug("String_Node_Str" + mFIFOPath + "String_Node_Str");
    while (true) {
      if (mReader.ready()) {
        Logger.debug("String_Node_Str");
        if ((line=mReader.readLine()) == null) {
          Logger.debug("String_Node_Str");
          continue;
        }
      }
 else {
        Logger.debug("String_Node_Str");
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
        }
        continue;
      }
      if (!line.isEmpty()) {
        Logger.debug("String_Node_Str" + line);
        if (line.startsWith(mToken)) {
          mExitCode=Integer.parseInt(line.substring(mToken.length()));
          if (mReceiver != null)           mReceiver.onEnd(mExitCode);
          break;
        }
 else         if (mReceiver != null) {
          mReceiver.onNewLine(line);
        }
      }
 else       Logger.debug("String_Node_Str");
    }
  }
 catch (  IOException e) {
    System.errorLogging(e);
  }
catch (  InterruptedException e) {
    System.errorLogging(e);
  }
 finally {
    try {
      if (mReader != null)       mReader.close();
synchronized (mFIFOS) {
        mFIFOS.remove(mFIFOS.indexOf(mFIFONum));
      }
    }
 catch (    IOException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  return;
}
Program: 54269
Project: 54269
Buggy source:
public ArrayList<File> filter(File[] file_list,boolean onlyDirs,boolean showHidden){
  ArrayList<File> files=new ArrayList<File>();
  for (  File file : file_list) {
    if (onlyDirs && !file.isDirectory())     continue;
    if (!showHidden && file.isHidden())     continue;
    files.add(file);
  }
  Collections.sort(files);
  return files;
}

Fixed version (ground truth):
public ArrayList<File> filter(File[] file_list,boolean onlyDirs,boolean showHidden){
  ArrayList<File> files=new ArrayList<File>();
  if (file_list != null) {
    for (    File file : file_list) {
      if (onlyDirs && !file.isDirectory())       continue;
      if (!showHidden && file.isHidden())       continue;
      files.add(file);
    }
    Collections.sort(files);
  }
  return files;
}
Program: 54270
Project: 54270
Buggy source:
@Override public void run(){
  new ErrorDialog("String_Node_Str",error,Hijacker.this).show();
  setStoppedState();
}

Fixed version (ground truth):
@Override public void run(){
  if (Hijacker.this.isFinishing() == false) {
    new ErrorDialog("String_Node_Str",error,Hijacker.this).show();
    setStoppedState();
  }
}
Program: 54271
Project: 54271
Buggy source:
private void setSpoofErrorState(final String error){
  Hijacker.this.runOnUiThread(new Runnable(){
    @Override public void run(){
      new ErrorDialog("String_Node_Str",error,Hijacker.this).show();
      setStoppedState();
    }
  }
);
}

Fixed version (ground truth):
private void setSpoofErrorState(final String error){
  Hijacker.this.runOnUiThread(new Runnable(){
    @Override public void run(){
      if (Hijacker.this.isFinishing() == false) {
        new ErrorDialog("String_Node_Str",error,Hijacker.this).show();
        setStoppedState();
      }
    }
  }
);
}
Program: 54272
Project: 54272
Buggy source:
public void onNewLine(String line){
  Matcher matcher=null;
  line=line.trim();
  if ((matcher=ATTEMPT_PATTERN.matcher(line)) != null && matcher.find()) {
    String login=matcher.group(1), password=matcher.group(2), progress=matcher.group(3), total=matcher.group(4);
    onNewAttempt(login,password,Integer.parseInt(progress),Integer.parseInt(total));
  }
 else   if ((matcher=ERROR_PATTERN.matcher(line)) != null && matcher.find())   onError(matcher.group(1));
 else   if ((matcher=FATAL_PATTERN.matcher(line)) != null && matcher.find())   onFatal(matcher.group(1));
 else   if ((matcher=ACCOUNT_PATTERN.matcher(line)) != null && matcher.find())   onAccountFound(matcher.group(1),matcher.group(2));
}

Fixed version (ground truth):
public void onNewLine(String line){
  Matcher matcher=null;
  line=line.trim();
  if ((matcher=ATTEMPT_PATTERN.matcher(line)) != null && matcher.find()) {
    String login=matcher.group(1), password=matcher.group(2), progress=matcher.group(3), total=matcher.group(4);
    int iprogress, itotal;
    try {
      iprogress=Integer.parseInt(progress);
      itotal=Integer.parseInt(total);
    }
 catch (    Exception e) {
      iprogress=0;
      itotal=Integer.MAX_VALUE;
    }
    onNewAttempt(login,password,iprogress,itotal);
  }
 else   if ((matcher=ERROR_PATTERN.matcher(line)) != null && matcher.find())   onError(matcher.group(1));
 else   if ((matcher=FATAL_PATTERN.matcher(line)) != null && matcher.find())   onFatal(matcher.group(1));
 else   if ((matcher=ACCOUNT_PATTERN.matcher(line)) != null && matcher.find())   onAccountFound(matcher.group(1),matcher.group(2));
}
Program: 54277
Project: 54277
Buggy source:
@Override protected void onListItemClick(ListView l,View v,int position,long id){
  super.onListItemClick(l,v,position,id);
  final ScanResult result=mAdapter.getItem(position);
  if (result != null) {
    final Keygen keygen=mWifiMatcher.getKeygen(result);
    if (keygen != null && (result.capabilities.contains("String_Node_Str") || result.capabilities.contains("String_Node_Str"))) {
      mKeyList.clear();
      new WifiCrackDialog("String_Node_Str","String_Node_Str",this,new WifiCrackDialogListener(){
        @Override public void onManualConnect(        String key){
          mCurrentNetworkId=performConnection(result,key);
          if (mCurrentNetworkId != -1)           mConnectionReceiver.register(WifiScannerActivity.this);
 else           mConnectionReceiver.unregister();
        }
        @Override public void onCrack(){
          performCracking(keygen,result);
        }
      }
).show();
    }
 else {
      if (result.capabilities.contains("String_Node_Str") || result.capabilities.contains("String_Node_Str")) {
        new InputDialog("String_Node_Str","String_Node_Str",null,true,true,this,new InputDialogListener(){
          @Override public void onInputEntered(          String input){
            mCurrentNetworkId=performConnection(result,input);
            if (mCurrentNetworkId != -1)             mConnectionReceiver.register(WifiScannerActivity.this);
 else             mConnectionReceiver.unregister();
          }
        }
).show();
      }
 else       performConnection(result,null);
    }
  }
}

Fixed version (ground truth):
@Override protected void onListItemClick(ListView l,View v,int position,long id){
  super.onListItemClick(l,v,position,id);
  final ScanResult result=mAdapter.getItem(position);
  if (result != null) {
    final Keygen keygen=mWifiMatcher.getKeygen(result);
    if (keygen != null && (result.capabilities.contains("String_Node_Str") || result.capabilities.contains("String_Node_Str"))) {
      mKeyList.clear();
      new WifiCrackDialog(result.SSID,"String_Node_Str",this,new WifiCrackDialogListener(){
        @Override public void onManualConnect(        String key){
          mCurrentNetworkId=performConnection(result,key);
          if (mCurrentNetworkId != -1)           mConnectionReceiver.register(WifiScannerActivity.this);
 else           mConnectionReceiver.unregister();
        }
        @Override public void onCrack(){
          performCracking(keygen,result);
        }
      }
).show();
    }
 else {
      if (result.capabilities.contains("String_Node_Str") || result.capabilities.contains("String_Node_Str")) {
        new InputDialog(result.SSID,"String_Node_Str",null,true,true,this,new InputDialogListener(){
          @Override public void onInputEntered(          String input){
            mCurrentNetworkId=performConnection(result,input);
            if (mCurrentNetworkId != -1)             mConnectionReceiver.register(WifiScannerActivity.this);
 else             mConnectionReceiver.unregister();
          }
        }
).show();
      }
 else       performConnection(result,null);
    }
  }
}
Program: 54278
Project: 54278
Buggy source:
@Override public void run(){
  Log.d(TAG,"String_Node_Str");
  mStopped=false;
  int i, nhosts=0;
  IP4Address current=null;
  try {
    mNetwork=System.getNetwork();
    nhosts=mNetwork.getNumberOfAddresses();
  }
 catch (  Exception e) {
    System.errorLogging(TAG,e);
  }
  while (mStopped == false && mNetwork != null && nhosts > 0) {
    try {
      for (i=1, current=IP4Address.next(mNetwork.getStartAddress()); current != null && i <= nhosts; current=IP4Address.next(current), i++) {
        InetAddress address=current.toInetAddress();
        DatagramSocket socket=new DatagramSocket();
        DatagramPacket packet=new DatagramPacket(NETBIOS_REQUEST,NETBIOS_REQUEST.length,address,NETBIOS_UDP_PORT);
        socket.setSoTimeout(200);
        socket.send(packet);
        new NBResolver(address,socket).start();
      }
      Thread.sleep(1000);
    }
 catch (    Exception e) {
      System.errorLogging(TAG,e);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  Log.d(TAG,"String_Node_Str");
  mStopped=false;
  int i, nhosts=0;
  IP4Address current=null;
  try {
    mNetwork=System.getNetwork();
    nhosts=mNetwork.getNumberOfAddresses();
  }
 catch (  Exception e) {
    System.errorLogging(TAG,e);
  }
  while (mStopped == false && mNetwork != null && nhosts > 0) {
    try {
      for (i=1, current=IP4Address.next(mNetwork.getStartAddress()); current != null && i <= nhosts; current=IP4Address.next(current), i++) {
        if (current.equals(mNetwork.getGatewayAddress()) == false && current.equals(mNetwork.getLocalAddress()) == false) {
          InetAddress address=current.toInetAddress();
          DatagramSocket socket=new DatagramSocket();
          DatagramPacket packet=new DatagramPacket(NETBIOS_REQUEST,NETBIOS_REQUEST.length,address,NETBIOS_UDP_PORT);
          socket.setSoTimeout(200);
          socket.send(packet);
          new NBResolver(address,socket).start();
        }
      }
      Thread.sleep(1000);
    }
 catch (    Exception e) {
      System.errorLogging(TAG,e);
    }
  }
}
Program: 54280
Project: 54280
Buggy source:
@Override public void onChoice(int choice){
  if (choice == 0) {
    mCurrentActivity=activity;
    startActivityForResult(mScriptPicker,SELECT_SCRIPT);
  }
 else {
    new InputDialog("String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str",true,false,MITM.this,new InputDialogListener(){
      @Override public void onInputEntered(      String input){
        final String js=input.trim();
        if (js.isEmpty() == false || js.startsWith("String_Node_Str") == false) {
          activity.setVisibility(View.VISIBLE);
          Toast.makeText(MITM.this,"String_Node_Str",Toast.LENGTH_LONG).show();
          mSpoofSession=new SpoofSession();
          mSpoofSession.start(new OnSessionReadyListener(){
            @Override public void onSessionReady(){
              System.getProxy().setFilter(new Proxy.ProxyFilter(){
                @Override public String onDataReceived(                String headers,                String data){
                  return data.replaceAll("String_Node_Str",js + "String_Node_Str");
                }
              }
);
            }
          }
);
        }
 else         new ErrorDialog("String_Node_Str","String_Node_Str",MITM.this).show();
      }
    }
).show();
  }
}

Fixed version (ground truth):
@Override public void onChoice(int choice){
  if (choice == 0) {
    try {
      mCurrentActivity=activity;
      startActivityForResult(mScriptPicker,SELECT_SCRIPT);
    }
 catch (    ActivityNotFoundException e) {
      new ErrorDialog("String_Node_Str","String_Node_Str",MITM.this).show();
    }
  }
 else {
    new InputDialog("String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str",true,false,MITM.this,new InputDialogListener(){
      @Override public void onInputEntered(      String input){
        final String js=input.trim();
        if (js.isEmpty() == false || js.startsWith("String_Node_Str") == false) {
          activity.setVisibility(View.VISIBLE);
          Toast.makeText(MITM.this,"String_Node_Str",Toast.LENGTH_LONG).show();
          mSpoofSession=new SpoofSession();
          mSpoofSession.start(new OnSessionReadyListener(){
            @Override public void onSessionReady(){
              System.getProxy().setFilter(new Proxy.ProxyFilter(){
                @Override public String onDataReceived(                String headers,                String data){
                  return data.replaceAll("String_Node_Str",js + "String_Node_Str");
                }
              }
);
            }
          }
);
        }
 else         new ErrorDialog("String_Node_Str","String_Node_Str",MITM.this).show();
      }
    }
).show();
  }
}
Program: 54282
Project: 54282
Buggy source:
public void onProgressChanged(WebView view,int progress){
  getSupportActionBar().setSubtitle(HijackerWebView.this.mWebView.getUrl());
  setSupportProgressBarIndeterminateVisibility(true);
  int mmprogress=(Window.PROGRESS_END - Window.PROGRESS_START) / 100 * progress;
  setSupportProgress(mmprogress);
  if (progress == 100)   setSupportProgressBarIndeterminateVisibility(false);
}

Fixed version (ground truth):
public void onProgressChanged(WebView view,int progress){
  if (mWebView != null)   getSupportActionBar().setSubtitle(mWebView.getUrl());
  setSupportProgressBarIndeterminateVisibility(true);
  int mmprogress=(Window.PROGRESS_END - Window.PROGRESS_START) / 100 * progress;
  setSupportProgress(mmprogress);
  if (progress == 100)   setSupportProgressBarIndeterminateVisibility(false);
}
Program: 54283
Project: 54283
Buggy source:
@Override public void onBackPressed(){
  if (mWebView != null && mWebView.canGoBack())   mWebView.goBack();
 else {
    super.onBackPressed();
    overridePendingTransition(R.anim.slide_in_left,R.anim.slide_out_left);
  }
}

Fixed version (ground truth):
@Override public void onBackPressed(){
  if (mWebView != null && mWebView.canGoBack())   mWebView.goBack();
 else {
    if (mWebView != null)     mWebView.stopLoading();
    super.onBackPressed();
    overridePendingTransition(R.anim.slide_in_left,R.anim.slide_out_left);
  }
}
Program: 54284
Project: 54284
Buggy source:
public InetAddress getGatewayAddress(){
  try {
    return InetAddress.getByName((mInfo.gateway & 0xFF) + "String_Node_Str" + ((mInfo.gateway >> 8) & 0xFF)+ "String_Node_Str"+ ((mInfo.gateway >> 16) & 0xFF)+ "String_Node_Str"+ ((mInfo.gateway >> 24) & 0xFF));
  }
 catch (  UnknownHostException e) {
    System.errorLogging(TAG,e);
  }
  return null;
}

Fixed version (ground truth):
public InetAddress getGatewayAddress(){
  return mGateway.toInetAddress();
}
Program: 54285
Project: 54285
Buggy source:
public InetAddress getLocalAddress(){
  try {
    return InetAddress.getByName(getLocalAddressAsString());
  }
 catch (  UnknownHostException e) {
    System.errorLogging(TAG,e);
  }
  return null;
}

Fixed version (ground truth):
public InetAddress getLocalAddress(){
  return mLocal.toInetAddress();
}
Program: 54286
Project: 54286
Buggy source:
public boolean isInternal(String ip){
  try {
    byte[] gateway=getGatewayAddress().getAddress();
    byte[] address=InetAddress.getByName(ip).getAddress();
    byte[] mask=getNetmaskAddress().getAddress();
    for (int i=0; i < gateway.length; i++)     if ((gateway[i] & mask[i]) != (address[i] & mask[i]))     return false;
    return true;
  }
 catch (  UnknownHostException e) {
    System.errorLogging(TAG,e);
  }
  return false;
}

Fixed version (ground truth):
public boolean isInternal(String ip){
  try {
    byte[] gateway=mGateway.toByteArray();
    byte[] address=InetAddress.getByName(ip).getAddress();
    byte[] mask=mNetmask.toByteArray();
    for (int i=0; i < gateway.length; i++)     if ((gateway[i] & mask[i]) != (address[i] & mask[i]))     return false;
    return true;
  }
 catch (  UnknownHostException e) {
    System.errorLogging(TAG,e);
  }
  return false;
}
Program: 54287
Project: 54287
Buggy source:
public String getLocalAddressAsString(){
  return (mInfo.ipAddress & 0xFF) + "String_Node_Str" + ((mInfo.ipAddress >> 8) & 0xFF)+ "String_Node_Str"+ ((mInfo.ipAddress >> 16) & 0xFF)+ "String_Node_Str"+ ((mInfo.ipAddress >> 24) & 0xFF);
}

Fixed version (ground truth):
public String getLocalAddressAsString(){
  return mLocal.toString();
}
Program: 54288
Project: 54288
Buggy source:
public InetAddress getNetmaskAddress(){
  try {
    return InetAddress.getByName((mInfo.netmask & 0xFF) + "String_Node_Str" + ((mInfo.netmask >> 8) & 0xFF)+ "String_Node_Str"+ ((mInfo.netmask >> 16) & 0xFF)+ "String_Node_Str"+ ((mInfo.netmask >> 24) & 0xFF));
  }
 catch (  UnknownHostException e) {
    System.errorLogging(TAG,e);
  }
  return null;
}

Fixed version (ground truth):
public InetAddress getNetmaskAddress(){
  return mNetmask.toInetAddress();
}
Program: 54289
Project: 54289
Buggy source:
public Network(Context context) throws NoRouteToHostException, SocketException {
  mWifiManager=(WifiManager)context.getSystemService(Context.WIFI_SERVICE);
  mConnectivityManager=(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
  mInfo=mWifiManager.getDhcpInfo();
  mWifiInfo=mWifiManager.getConnectionInfo();
  if (isConnected() == false)   throw new NoRouteToHostException("String_Node_Str");
 else {
    try {
      mInterface=NetworkInterface.getByInetAddress(getLocalAddress());
    }
 catch (    SocketException e) {
      System.errorLogging(TAG,e);
      Enumeration<NetworkInterface> interfaces=NetworkInterface.getNetworkInterfaces();
      InetAddress ifaceAddress=getLocalAddress();
      while (interfaces != null && mInterface == null && interfaces.hasMoreElements()) {
        NetworkInterface iface=interfaces.nextElement();
        Enumeration<InetAddress> inetAddresses=iface.getInetAddresses();
        while (inetAddresses.hasMoreElements()) {
          InetAddress address=inetAddresses.nextElement();
          if (address.equals(ifaceAddress)) {
            mInterface=iface;
            break;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public Network(Context context) throws NoRouteToHostException, SocketException, UnknownHostException {
  mWifiManager=(WifiManager)context.getSystemService(Context.WIFI_SERVICE);
  mConnectivityManager=(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
  mInfo=mWifiManager.getDhcpInfo();
  mWifiInfo=mWifiManager.getConnectionInfo();
  mGateway=new IP4Address(mInfo.gateway);
  mNetmask=new IP4Address(mInfo.netmask);
  mLocal=new IP4Address(mInfo.ipAddress);
  if (isConnected() == false)   throw new NoRouteToHostException("String_Node_Str");
 else {
    try {
      mInterface=NetworkInterface.getByInetAddress(getLocalAddress());
    }
 catch (    SocketException e) {
      System.errorLogging(TAG,e);
      Enumeration<NetworkInterface> interfaces=NetworkInterface.getNetworkInterfaces();
      InetAddress ifaceAddress=getLocalAddress();
      while (interfaces != null && mInterface == null && interfaces.hasMoreElements()) {
        NetworkInterface iface=interfaces.nextElement();
        Enumeration<InetAddress> inetAddresses=iface.getInetAddresses();
        while (inetAddresses.hasMoreElements()) {
          InetAddress address=inetAddresses.nextElement();
          if (address.equals(ifaceAddress)) {
            mInterface=iface;
            break;
          }
        }
      }
    }
  }
}
Program: 54290
Project: 54290
Buggy source:
public String getNetworkRepresentation(){
  return getNetworkMasked() + "String_Node_Str" + countBits(mInfo.netmask);
}

Fixed version (ground truth):
public String getNetworkRepresentation(){
  return getNetworkMasked() + "String_Node_Str" + mNetmask.countBits();
}
Program: 54292
Project: 54292
Buggy source:
public FatalDialog(String title,String message,final Activity activity){
  super(activity);
  this.setTitle(title);
  this.setMessage(message);
  this.setCancelable(false);
  this.setButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      activity.finish();
      System.exit(0xFF);
    }
  }
);
}

Fixed version (ground truth):
public FatalDialog(String title,String message,final Activity activity){
  this(title,message,false,activity);
}
Program: 54293
Project: 54293
Buggy source:
public boolean isUpdateAvailable(){
  try {
    if (mInstalledVersion != null) {
      if (mRemoteVersion == null) {
        StrictMode.ThreadPolicy policy=new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);
        URL url=new URL(REMOTE_VERSION_FILE);
        HttpsURLConnection connection=(HttpsURLConnection)url.openConnection();
        BufferedReader reader=new BufferedReader(new InputStreamReader(connection.getInputStream()));
        String line=null, buffer="String_Node_Str";
        while ((line=reader.readLine()) != null) {
          buffer+=line + "String_Node_Str";
        }
        reader.close();
        mRemoteVersion=buffer.trim();
      }
      double installedVersionCode=getVersionCode(mInstalledVersion), remoteVersionCode=getVersionCode(mRemoteVersion);
      if (remoteVersionCode > installedVersionCode)       return true;
    }
  }
 catch (  Exception e) {
    System.errorLogging(TAG,e);
  }
  return false;
}

Fixed version (ground truth):
public boolean isUpdateAvailable(){
  try {
    if (mInstalledVersion != null) {
      if (mRemoteVersion == null) {
        URL url=new URL(REMOTE_VERSION_FILE);
        HttpsURLConnection connection=(HttpsURLConnection)url.openConnection();
        BufferedReader reader=new BufferedReader(new InputStreamReader(connection.getInputStream()));
        String line=null, buffer="String_Node_Str";
        while ((line=reader.readLine()) != null) {
          buffer+=line + "String_Node_Str";
        }
        reader.close();
        mRemoteVersion=buffer.trim();
      }
      double installedVersionCode=getVersionCode(mInstalledVersion), remoteVersionCode=getVersionCode(mRemoteVersion);
      if (remoteVersionCode > installedVersionCode)       return true;
    }
  }
 catch (  Exception e) {
    System.errorLogging(TAG,e);
  }
  return false;
}
Program: 54294
Project: 54294
Buggy source:
@Override public int onStartCommand(Intent intent,int flags,int startId){
  super.onStartCommand(intent,flags,startId);
  Log.d(TAG,"String_Node_Str");
  if (System.getUpdateManager().isUpdateAvailable()) {
    Intent update=new Intent(UPDATE_AVAILABLE);
    update.putExtra(AVAILABLE_VERSION,System.getUpdateManager().getRemoteVersion());
    sendBroadcast(update);
  }
  Log.d(TAG,"String_Node_Str");
  return START_NOT_STICKY;
}

Fixed version (ground truth):
@Override public int onStartCommand(Intent intent,int flags,int startId){
  super.onStartCommand(intent,flags,startId);
  new Thread(new Runnable(){
    @Override public void run(){
      Log.d(TAG,"String_Node_Str");
      if (System.getUpdateManager().isUpdateAvailable()) {
        Intent update=new Intent(UPDATE_AVAILABLE);
        update.putExtra(AVAILABLE_VERSION,System.getUpdateManager().getRemoteVersion());
        sendBroadcast(update);
      }
      Log.d(TAG,"String_Node_Str");
    }
  }
).start();
  return START_NOT_STICKY;
}
Program: 54295
Project: 54295
Buggy source:
public InetAddress getLocalAddress(){
  try {
    return InetAddress.getByName((mInfo.ipAddress & 0xFF) + "String_Node_Str" + ((mInfo.ipAddress >> 8) & 0xFF)+ "String_Node_Str"+ ((mInfo.ipAddress >> 16) & 0xFF)+ "String_Node_Str"+ ((mInfo.ipAddress >> 24) & 0xFF));
  }
 catch (  UnknownHostException e) {
    System.errorLogging(TAG,e);
  }
  return null;
}

Fixed version (ground truth):
public InetAddress getLocalAddress(){
  try {
    return InetAddress.getByName(getLocalAddressAsString());
  }
 catch (  UnknownHostException e) {
    System.errorLogging(TAG,e);
  }
  return null;
}
Program: 54298
Project: 54298
Buggy source:
public void portRedirect(int from,int to){
  Log.d(TAG,"String_Node_Str" + from + "String_Node_Str"+ to);
  try {
    super.run("String_Node_Str");
    super.run("String_Node_Str");
    super.run("String_Node_Str" + from + "String_Node_Str"+ to);
  }
 catch (  Exception e) {
    System.errorLogging(TAG,e);
  }
}

Fixed version (ground truth):
public void portRedirect(int from,int to){
  Log.d(TAG,"String_Node_Str" + from + "String_Node_Str"+ to);
  try {
    super.run("String_Node_Str");
    super.run("String_Node_Str");
    super.run("String_Node_Str");
    super.run("String_Node_Str");
    super.run("String_Node_Str" + from + "String_Node_Str"+ System.getNetwork().getLocalAddressAsString()+ "String_Node_Str"+ to);
  }
 catch (  Exception e) {
    System.errorLogging(TAG,e);
  }
}
Program: 54299
Project: 54299
Buggy source:
public void undoPortRedirect(int from,int to){
  Log.d(TAG,"String_Node_Str");
  try {
    super.run("String_Node_Str" + from + "String_Node_Str"+ to);
    super.run("String_Node_Str");
  }
 catch (  Exception e) {
    System.errorLogging(TAG,e);
  }
}

Fixed version (ground truth):
public void undoPortRedirect(int from,int to){
  Log.d(TAG,"String_Node_Str");
  try {
    super.run("String_Node_Str" + from + "String_Node_Str"+ System.getNetwork().getLocalAddressAsString()+ "String_Node_Str"+ to);
    super.run("String_Node_Str");
  }
 catch (  Exception e) {
    System.errorLogging(TAG,e);
  }
}
Program: 54301
Project: 54301
Buggy source:
public static byte[] parseMacAddress(String macAddress){
  if (macAddress != null && macAddress.equals("String_Node_Str") == false) {
    String[] bytes=macAddress.split("String_Node_Str");
    byte[] parsed=new byte[bytes.length];
    for (int x=0; x < bytes.length; x++) {
      BigInteger temp=new BigInteger(bytes[x],16);
      byte[] raw=temp.toByteArray();
      parsed[x]=raw[raw.length - 1];
    }
    return parsed;
  }
  return null;
}

Fixed version (ground truth):
public static byte[] parseMacAddress(String macAddress){
  if (macAddress != null && macAddress.equals("String_Node_Str") == false && macAddress.isEmpty() == false) {
    String[] bytes=macAddress.split("String_Node_Str");
    byte[] parsed=new byte[bytes.length];
    for (int x=0; x < bytes.length; x++) {
      BigInteger temp=new BigInteger(bytes[x],16);
      byte[] raw=temp.toByteArray();
      parsed[x]=raw[raw.length - 1];
    }
    return parsed;
  }
  return null;
}
Program: 54302
Project: 54302
Buggy source:
private void sendNotification(String message){
  NotificationManager manager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
  Notification notification=new Notification(R.drawable.dsploit_icon_48,message,java.lang.System.currentTimeMillis());
  Context context=getApplicationContext();
  notification.flags|=Notification.FLAG_AUTO_CANCEL;
  notification.contentIntent=PendingIntent.getActivity(context,0,new Intent(),PendingIntent.FLAG_UPDATE_CURRENT);
  notification.setLatestEventInfo(context,"String_Node_Str",message,null);
  manager.cancel(mNotificationId);
  manager.notify(++mNotificationId,notification);
}

Fixed version (ground truth):
private void sendNotification(String message){
  NotificationManager manager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
  Notification notification=new Notification(R.drawable.dsploit_icon_48,message,java.lang.System.currentTimeMillis());
  Context context=getApplicationContext();
  PendingIntent pending=PendingIntent.getActivity(context,0,new Intent(),PendingIntent.FLAG_UPDATE_CURRENT);
  notification.flags|=Notification.FLAG_AUTO_CANCEL;
  notification.setLatestEventInfo(context,"String_Node_Str",message,pending);
  manager.cancel(mNotificationId);
  manager.notify(++mNotificationId,notification);
}
Program: 54303
Project: 54303
Buggy source:
private static double getVersionCode(String version){
  String[] padded=new String[3], parts=version.split("String_Node_Str");
  String item="String_Node_Str", digit="String_Node_Str";
  double code=0, coeff=0;
  int i, j;
  Arrays.fill(padded,0,3,"String_Node_Str");
  for (i=0; i < Math.min(3,parts.length); i++) {
    padded[i]=parts[i];
  }
  for (i=padded.length - 1; i >= 0; i--) {
    item=padded[i];
    coeff=Math.pow(10,padded.length - i);
    for (j=0; j < item.length(); j++) {
      digit="String_Node_Str" + item.charAt(j);
      if (digit.matches("String_Node_Str"))       code+=(Integer.parseInt(digit) + 1) * coeff;
 else       if (digit.matches("String_Node_Str"))       code-=((VERSION_CHAR_MAP.indexOf(digit.toLowerCase()) + 1) / 100.0);
 else       code+=coeff;
    }
  }
  return code;
}

Fixed version (ground truth):
private static double getVersionCode(String version){
  String[] padded=new String[3], parts=version.split("String_Node_Str");
  String item="String_Node_Str", digit="String_Node_Str", letter="String_Node_Str";
  double code=0, coeff=0;
  int i, j;
  char c;
  Arrays.fill(padded,0,3,"String_Node_Str");
  for (i=0; i < Math.min(3,parts.length); i++) {
    padded[i]=parts[i];
  }
  for (i=padded.length - 1; i >= 0; i--) {
    item=padded[i];
    coeff=Math.pow(10,padded.length - i);
    if (item.matches("String_Node_Str")) {
      digit="String_Node_Str";
      letter="String_Node_Str";
      for (j=0; j < item.length(); j++) {
        c=item.charAt(j);
        if (c >= '0' && c <= '9')         digit+=c;
 else         letter+=c;
      }
      code+=((Integer.parseInt(digit) + 1) * coeff) - ((VERSION_CHAR_MAP.indexOf(letter.toLowerCase()) + 1) / 100.0);
    }
 else     if (item.matches("String_Node_Str"))     code+=(Integer.parseInt(item) + 1) * coeff;
 else     code+=coeff;
  }
  return code;
}
Program: 54304
Project: 54304
Buggy source:
public static String getProtocolByPort(String port){
  return mPorts.containsKey(port) ? mPorts.get(port) : null;
}

Fixed version (ground truth):
public static String getProtocolByPort(String port){
  preloadServices();
  return mPorts.containsKey(port) ? mPorts.get(port) : null;
}
Program: 54305
Project: 54305
Buggy source:
public static void init(Context context) throws Exception {
  mContext=context;
  try {
    mUpdateManager=new UpdateManager(mContext);
    mPlugins=new ArrayList<Plugin>();
    mTargets=new ArrayList<Target>();
    mTargets.add(new Target(System.getNetwork()));
    mTargets.add(new Target(System.getNetwork().getGatewayAddress(),System.getNetwork().getGatewayHardware()));
    mTargets.add(new Target(System.getNetwork().getLoacalAddress(),System.getNetwork().getLocalHardware()));
    mNmap=new NMap(mContext);
    mEttercap=new Ettercap(mContext);
    mIptables=new IPTables();
    mHydra=new Hydra(mContext);
    mTcpdump=new TcpDump(mContext);
    mServices=new HashMap<String,String>();
    mPorts=new HashMap<String,String>();
    FileInputStream fstream=new FileInputStream(mContext.getFilesDir().getAbsolutePath() + "String_Node_Str");
    DataInputStream in=new DataInputStream(fstream);
    BufferedReader reader=new BufferedReader(new InputStreamReader(in));
    String line;
    Matcher matcher;
    while ((line=reader.readLine()) != null) {
      line=line.trim();
      if ((matcher=SERVICE_PARSER.matcher(line)) != null && matcher.find()) {
        String proto=matcher.group(1), port=matcher.group(2);
        mServices.put(proto,port);
        mPorts.put(port,proto);
      }
    }
    in.close();
    mVendors=new HashMap<String,String>();
    fstream=new FileInputStream(mContext.getFilesDir().getAbsolutePath() + "String_Node_Str");
    in=new DataInputStream(fstream);
    reader=new BufferedReader(new InputStreamReader(in));
    while ((line=reader.readLine()) != null) {
      line=line.trim();
      if (line.startsWith("String_Node_Str") == false && line.isEmpty() == false) {
        String[] tokens=line.split("String_Node_Str",2);
        if (tokens.length == 2)         mVendors.put(tokens[0],tokens[1]);
      }
    }
    in.close();
    mStoragePath=Environment.getExternalStorageDirectory().toString();
    mSessionName="String_Node_Str" + java.lang.System.currentTimeMillis();
    mInitialized=true;
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString());
    throw e;
  }
}

Fixed version (ground truth):
public static void init(Context context) throws Exception {
  mContext=context;
  try {
    mUpdateManager=new UpdateManager(mContext);
    mPlugins=new ArrayList<Plugin>();
    mTargets=new ArrayList<Target>();
    mTargets.add(new Target(System.getNetwork()));
    mTargets.add(new Target(System.getNetwork().getGatewayAddress(),System.getNetwork().getGatewayHardware()));
    mTargets.add(new Target(System.getNetwork().getLoacalAddress(),System.getNetwork().getLocalHardware()));
    mNmap=new NMap(mContext);
    mEttercap=new Ettercap(mContext);
    mIptables=new IPTables();
    mHydra=new Hydra(mContext);
    mTcpdump=new TcpDump(mContext);
    mStoragePath=Environment.getExternalStorageDirectory().toString();
    mSessionName="String_Node_Str" + java.lang.System.currentTimeMillis();
    mInitialized=true;
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString());
    throw e;
  }
}
Program: 54306
Project: 54306
Buggy source:
public static String getMacVendor(byte[] mac){
  if (mac != null && mac.length >= 3)   return mVendors.get(String.format("String_Node_Str",mac[0],mac[1],mac[2]));
 else   return null;
}

Fixed version (ground truth):
public static String getMacVendor(byte[] mac){
  preloadVendors();
  if (mac != null && mac.length >= 3)   return mVendors.get(String.format("String_Node_Str",mac[0],mac[1],mac[2]));
 else   return null;
}
Program: 54307
Project: 54307
Buggy source:
public static int getPortByProtocol(String protocol){
  return mServices.containsKey(protocol) ? Integer.parseInt(mServices.get(protocol)) : 0;
}

Fixed version (ground truth):
public static int getPortByProtocol(String protocol){
  preloadServices();
  return mServices.containsKey(protocol) ? Integer.parseInt(mServices.get(protocol)) : 0;
}
Program: 54308
Project: 54308
Buggy source:
public void run(){
  int read=-1, size=0, max=Integer.parseInt(System.getSettings().getString("String_Node_Str","String_Node_Str"));
  byte[] chunk=new byte[CHUNK_SIZE];
  try {
    while ((read=mReader.read(chunk,0,CHUNK_SIZE)) > 0) {
      mBuffer.append(chunk,read);
      size+=read;
      if (size >= max)       throw new RuntimeException("String_Node_Str");
    }
    if (mBuffer.isEmpty() == false) {
      if (mBuffer.indexOf(CONTENT_TEXT_HTML) != -1) {
        String data=mBuffer.toString();
        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;
        mBuffer.setData((headers + HEAD_SEPARATOR + body).getBytes());
      }
      mWriter.write(mBuffer.getData());
      mWriter.flush();
    }
  }
 catch (  Exception 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, size=0, max=Integer.parseInt(System.getSettings().getString("String_Node_Str","String_Node_Str"));
  byte[] chunk=new byte[CHUNK_SIZE];
  try {
    while ((read=mReader.read(chunk,0,CHUNK_SIZE)) > 0) {
      mBuffer.append(chunk,read);
      size+=read;
      if (size >= max)       throw new RuntimeException("String_Node_Str");
    }
    if (mBuffer.isEmpty() == false) {
      if (mBuffer.indexOf(CONTENT_TEXT_HTML) != -1) {
        String data=mBuffer.toString();
        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;
        mBuffer.setData((headers + HEAD_SEPARATOR + body).getBytes());
      }
      mWriter.write(mBuffer.getData());
      mWriter.flush();
    }
  }
 catch (  OutOfMemoryError ome) {
    Log.e(TAG,ome.toString());
  }
catch (  Exception e) {
    Log.e(TAG,e.toString());
  }
 finally {
    try {
      mWriter.flush();
      mWriter.close();
      mReader.close();
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
  }
}
Program: 54309
Project: 54309
Buggy source:
public void run(){
  int read=-1;
  byte[] chunk=new byte[CHUNK_SIZE];
  try {
    while ((read=mReader.read(chunk,0,CHUNK_SIZE)) > 0) {
      mBuffer.append(chunk,read);
    }
    if (mBuffer.isEmpty() == false) {
      if (mBuffer.indexOf(CONTENT_TEXT_HTML) != -1) {
        String data=mBuffer.toString();
        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;
        mBuffer.setData((headers + HEAD_SEPARATOR + body).getBytes());
      }
      mWriter.write(mBuffer.getData());
      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, size=0;
  byte[] chunk=new byte[CHUNK_SIZE];
  try {
    while ((read=mReader.read(chunk,0,CHUNK_SIZE)) > 0) {
      mBuffer.append(chunk,read);
      size+=read;
      if (size >= MAX_BUFFER_SIZE)       throw new RuntimeException("String_Node_Str");
    }
    if (mBuffer.isEmpty() == false) {
      if (mBuffer.indexOf(CONTENT_TEXT_HTML) != -1) {
        String data=mBuffer.toString();
        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;
        mBuffer.setData((headers + HEAD_SEPARATOR + body).getBytes());
      }
      mWriter.write(mBuffer.getData());
      mWriter.flush();
    }
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString());
  }
 finally {
    try {
      mWriter.flush();
      mWriter.close();
      mReader.close();
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
  }
}
Program: 54310
Project: 54310
Buggy source:
@Override public void onCreate(){
  ACRA.init(this);
  super.onCreate();
}

Fixed version (ground truth):
@Override public void onCreate(){
  ACRA.init(this);
  try {
    System.init(this);
    System.registerPlugin(new PortScanner());
    System.registerPlugin(new Inspector());
    System.registerPlugin(new ExploitFinder());
    System.registerPlugin(new LoginCracker());
    System.registerPlugin(new MITM());
    System.registerPlugin(new PacketForger());
  }
 catch (  Exception e) {
    System.setLastError(e.toString());
    Log.e("String_Node_Str",e.toString());
  }
  super.onCreate();
}
Program: 54312
Project: 54312
Buggy source:
public static Proxy getProxy(){
  try {
    if (mProxy == null)     mProxy=new Proxy(getNetwork().getLoacalAddress(),HTTP_PROXY_PORT);
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString());
  }
  return mProxy;
}

Fixed version (ground truth):
public static Proxy getProxy(){
  try {
    if (mProxy == null)     mProxy=new Proxy(getNetwork().getLocalAddress(),HTTP_PROXY_PORT);
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString());
  }
  return mProxy;
}
Program: 54313
Project: 54313
Buggy source:
public static Server getServer(){
  try {
    if (mServer == null)     mServer=new Server(getNetwork().getLoacalAddress(),HTTP_SERVER_PORT);
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString());
  }
  return mServer;
}

Fixed version (ground truth):
public static Server getServer(){
  try {
    if (mServer == null)     mServer=new Server(getNetwork().getLocalAddress(),HTTP_SERVER_PORT);
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString());
  }
  return mServer;
}
Program: 54314
Project: 54314
Buggy source:
public static void init(Context context) throws Exception {
  mContext=context;
  try {
    mUpdateManager=new UpdateManager(mContext);
    mPlugins=new ArrayList<Plugin>();
    mTargets=new ArrayList<Target>();
    mTargets.add(new Target(System.getNetwork()));
    mTargets.add(new Target(System.getNetwork().getGatewayAddress(),System.getNetwork().getGatewayHardware()));
    mTargets.add(new Target(System.getNetwork().getLoacalAddress(),System.getNetwork().getLocalHardware()));
    mNmap=new NMap(mContext);
    mEttercap=new Ettercap(mContext);
    mIptables=new IPTables();
    mHydra=new Hydra(mContext);
    mTcpdump=new TcpDump(mContext);
    mStoragePath=Environment.getExternalStorageDirectory().toString();
    mSessionName="String_Node_Str" + java.lang.System.currentTimeMillis();
    mInitialized=true;
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString());
    throw e;
  }
}

Fixed version (ground truth):
public static void init(Context context) throws Exception {
  mContext=context;
  try {
    mUpdateManager=new UpdateManager(mContext);
    mPlugins=new ArrayList<Plugin>();
    mTargets=new ArrayList<Target>();
    mTargets.add(new Target(System.getNetwork()));
    mTargets.add(new Target(System.getNetwork().getGatewayAddress(),System.getNetwork().getGatewayHardware()));
    mTargets.add(new Target(System.getNetwork().getLocalAddress(),System.getNetwork().getLocalHardware()));
    mNmap=new NMap(mContext);
    mEttercap=new Ettercap(mContext);
    mIptables=new IPTables();
    mHydra=new Hydra(mContext);
    mTcpdump=new TcpDump(mContext);
    mStoragePath=Environment.getExternalStorageDirectory().toString();
    mSessionName="String_Node_Str" + java.lang.System.currentTimeMillis();
    mInitialized=true;
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString());
    throw e;
  }
}
Program: 54315
Project: 54315
Buggy source:
public static void reset() throws NoRouteToHostException, SocketException {
  mTargets.clear();
  mTargets.add(new Target(System.getNetwork()));
  mTargets.add(new Target(System.getNetwork().getGatewayAddress(),System.getNetwork().getGatewayHardware()));
  mTargets.add(new Target(System.getNetwork().getLoacalAddress(),System.getNetwork().getLocalHardware()));
  mCurrentTarget=0;
}

Fixed version (ground truth):
public static void reset() throws NoRouteToHostException, SocketException {
  mTargets.clear();
  mTargets.add(new Target(System.getNetwork()));
  mTargets.add(new Target(System.getNetwork().getGatewayAddress(),System.getNetwork().getGatewayHardware()));
  mTargets.add(new Target(System.getNetwork().getLocalAddress(),System.getNetwork().getLocalHardware()));
  mCurrentTarget=0;
}
Program: 54316
Project: 54316
Buggy source:
public Network(Context context) throws NoRouteToHostException, SocketException {
  mWifiManager=(WifiManager)context.getSystemService(Context.WIFI_SERVICE);
  mConnectivityManager=(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
  mInfo=mWifiManager.getDhcpInfo();
  mWifiInfo=mWifiManager.getConnectionInfo();
  if (isConnected() == false)   throw new NoRouteToHostException("String_Node_Str");
 else   mInterface=NetworkInterface.getByInetAddress(getLoacalAddress());
}

Fixed version (ground truth):
public Network(Context context) throws NoRouteToHostException, SocketException {
  mWifiManager=(WifiManager)context.getSystemService(Context.WIFI_SERVICE);
  mConnectivityManager=(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
  mInfo=mWifiManager.getDhcpInfo();
  mWifiInfo=mWifiManager.getConnectionInfo();
  if (isConnected() == false)   throw new NoRouteToHostException("String_Node_Str");
 else   mInterface=NetworkInterface.getByInetAddress(getLocalAddress());
}