nus-yam/ex-repair huggingface dataset:
Program: 5082
Project: 5082
Buggy source:
/** 
 * Initialize the connection by doing the handshake.  Subclasses of connection should override this method and call super.initialize() in the first line of the override.
 */
public void initialize() throws IOException {
  SettingsManager settingsManager=SettingsManager.instance();
  String expectString;
  if (isOutgoing()) {
    _socket=new Socket(_host,_port);
    expectString=settingsManager.getConnectString();
  }
 else {
    expectString=settingsManager.getConnectStringRemainder();
  }
  if (_shutdownCalled) {
    _socket.close();
    throw new IOException();
  }
  try {
    _in=new BufferedInputStream(_socket.getInputStream());
    _out=new BufferedOutputStream(_socket.getOutputStream());
    sendString(expectString + "String_Node_Str");
    expectString(settingsManager.getConnectOkString() + "String_Node_Str");
  }
 catch (  IOException e) {
    _socket.close();
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Initialize the connection by doing the handshake.  Subclasses of connection should override this method and call super.initialize() in the first line of the override.
 */
public void initialize() throws IOException {
  SettingsManager settingsManager=SettingsManager.instance();
  String expectString;
  if (isOutgoing()) {
    _socket=new Socket(_host,_port);
    expectString=settingsManager.getConnectString();
  }
 else {
    expectString=settingsManager.getConnectStringRemainder();
  }
  if (_closed) {
    _socket.close();
    throw new IOException();
  }
  try {
    _in=new BufferedInputStream(_socket.getInputStream());
    _out=new BufferedOutputStream(_socket.getOutputStream());
    sendString(expectString + "String_Node_Str");
    expectString(settingsManager.getConnectOkString() + "String_Node_Str");
  }
 catch (  IOException e) {
    _socket.close();
    throw e;
  }
}
Program: 5083
Project: 5083
Buggy source:
/** 
 * Sends a message.
 * @requires this is fully constructed
 * @modifies the network underlying this
 * @effects send m on the network.  Throws IOException if problemsarise.  This is thread-safe.
 */
public void send(Message m) throws IOException {
synchronized (_out) {
    m.write(_out);
    _out.flush();
    _sent++;
  }
}

Fixed version (ground truth):
/** 
 * Sends a message.
 * @requires this is fully constructed
 * @modifies the network underlying this
 * @effects send m on the network.  Throws IOException if problemsarise.  This is thread-safe and guaranteed not to block.
 */
public void send(Message m) throws IOException {
  if (_closed)   throw new IOException();
synchronized (_outputQueueLock) {
    _sent++;
    if (_outputQueue.isFull()) {
      _sentDropped++;
      if (disposeable(m))       return;
      int i;
      for (i=_outputQueue.getSize() - 1; i >= 0; i--) {
        Message mi=(Message)_outputQueue.get(i);
        if (disposeable(mi))         break;
      }
      if (i >= 0)       _outputQueue.set(i,m);
 else       _outputQueue.addFirst(m);
    }
 else {
      _outputQueue.addFirst(m);
      if (_outputQueue.getSize() >= BATCH_SIZE)       _outputQueueLock.notify();
    }
  }
}
Program: 5084
Project: 5084
Buggy source:
/** 
 * Searches the given host for all its files.  Results are given to the GUI via handleQuery.  Returns null if the host couldn't be reached.  Blocks until the connection is established and the query is sent.
 */
public byte[] browse(String host,int port){
  Connection c=null;
  for (Iterator iter=manager.connections(); iter.hasNext(); ) {
    Connection c2=(Connection)iter.next();
    String ip=c2.getInetAddress().getHostAddress();
    if (ip.equals(host) && c2.getOrigPort() == port) {
      c=c2;
      break;
    }
  }
  if (c == null) {
    try {
      c=connectToHost(host,port);
    }
 catch (    IOException e) {
      return null;
    }
  }
  QueryRequest qr=new QueryRequest((byte)1,0,"String_Node_Str");
  manager.fromMe(qr);
  try {
    c.send(qr);
  }
 catch (  IOException e) {
    return null;
  }
  if (manager.getNumConnections() > manager.getKeepAlive()) {
    ManagedConnection worst=null;
    long files=Long.MAX_VALUE;
    for (Iterator iter=manager.connections(); iter.hasNext(); ) {
      ManagedConnection c2=(ManagedConnection)iter.next();
      if (c2 == c)       continue;
      long n=c2.getNumFiles();
      if (n < files) {
        worst=c2;
        files=n;
      }
    }
    if (worst != null)     manager.remove(worst);
  }
  return qr.getGUID();
}

Fixed version (ground truth):
/** 
 * Searches the given host for all its files.  Results are given to the GUI via handleQuery.  Returns null if the host couldn't be reached.  Blocks until the connection is established and the query is sent.
 */
public byte[] browse(String host,int port){
  Connection c=null;
  for (Iterator iter=manager.initializedConnections(); iter.hasNext(); ) {
    Connection c2=(Connection)iter.next();
    String ip=c2.getInetAddress().getHostAddress();
    if (ip.equals(host) && c2.getOrigPort() == port) {
      c=c2;
      break;
    }
  }
  if (c == null) {
    try {
      c=connectToHost(host,port);
    }
 catch (    IOException e) {
      return null;
    }
  }
  QueryRequest qr=new QueryRequest((byte)1,0,"String_Node_Str");
  manager.fromMe(qr);
  try {
    c.send(qr);
  }
 catch (  IOException e) {
    return null;
  }
  if (manager.getNumConnections() > manager.getKeepAlive()) {
    ManagedConnection worst=null;
    long files=Long.MAX_VALUE;
    for (Iterator iter=manager.connections(); iter.hasNext(); ) {
      ManagedConnection c2=(ManagedConnection)iter.next();
      if (c2 == c)       continue;
      long n=c2.getNumFiles();
      if (n < files) {
        worst=c2;
        files=n;
      }
    }
    if (worst != null)     manager.remove(worst);
  }
  return qr.getGUID();
}
Program: 5085
Project: 5085
Buggy source:
/** 
 * This method is called when a reply is received for a QueryRequest originating on this Connection.  So, just adjust the hops and send it back.  If the sending fails, the calls fails silently. Note that we delegate the sending to the MessageRouter so that it can properly set up a routing for PushRequest sent in reply to the QueryReply.  PushRequests are odd this way; they are QueryReplyReplies
 */
public void handleQueryReply(QueryReply queryReply,ManagedConnection receivingConnection,MessageRouter router,ActivityCallback callback){
  queryReply.hop();
  try {
    router.sendQueryReply(queryReply,this,receivingConnection);
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * This method is called when a reply is received for a QueryRequest originating on this Connection.  So, just adjust the hops and send it back.  If the sending fails, the calls fails silently.
 */
public void handleQueryReply(QueryReply queryReply,ManagedConnection receivingConnection,MessageRouter router,ActivityCallback callback){
  queryReply.hop();
  send(queryReply);
}
Program: 5086
Project: 5086
Buggy source:
/** 
 * Uses the query route table to route a query reply.  If an appropriate route doesn't exist, records the error statistics.  On sucessful routing, the QueryReply count is incremented.
 */
public void routeQueryReply(QueryReply queryReply,ManagedConnection receivingConnection){
  QueryReplyHandler replyHandler=(QueryReplyHandler)_queryRouteTable.getReplyHandler(queryReply.getGUID());
  if (replyHandler != null) {
    _numQueryReplies++;
    replyHandler.handleQueryReply(queryReply,receivingConnection,this,_callback);
  }
 else {
    _numRouteErrors++;
    receivingConnection.countDroppedMessage();
  }
}

Fixed version (ground truth):
/** 
 * Uses the query route table to route a query reply.  If an appropriate route doesn't exist, records the error statistics.  On sucessful routing, the QueryReply count is incremented, and a routing is created for subsequent PushRequests
 */
public void routeQueryReply(QueryReply queryReply,ManagedConnection receivingConnection){
  QueryReplyHandler replyHandler=(QueryReplyHandler)_queryRouteTable.getReplyHandler(queryReply.getGUID());
  if (replyHandler != null) {
    _numQueryReplies++;
    _pushRouteTable.routeReply(queryReply.getClientGUID(),receivingConnection);
    replyHandler.handleQueryReply(queryReply,receivingConnection,this,_callback);
  }
 else {
    _numRouteErrors++;
    receivingConnection.countDroppedMessage();
  }
}
Program: 5087
Project: 5087
Buggy source:
/** 
 * Sends the query reply to the designated connection, setting up the routing to the designated PushRequestHandler.
 */
public void sendQueryReply(QueryReply queryReply,ManagedConnection connection,PushRequestHandler replyHandler) throws IOException {
  _pushRouteTable.routeReply(queryReply.getClientGUID(),replyHandler);
  connection.send(queryReply);
}

Fixed version (ground truth):
/** 
 * Sends the query reply to the designated connection, setting up the routing to the MessageRouter's PushRequestHandler.
 */
public void sendQueryReply(QueryReply queryReply,ManagedConnection connection) throws IOException {
  _pushRouteTable.routeReply(queryReply.getClientGUID(),_pushRequestHandler);
  connection.send(queryReply);
}
Program: 5088
Project: 5088
Buggy source:
/** 
 * Creates a host catcher whose maybe set contains the hosts in the given file.  (The likelys set is empty.)  If filename does not exist, then no error message is printed and this is initially empty.  The file is expected to contain a sequence of lines in the format "<host>:port\n".  Lines not in this format are silently ignored.  manager is as described above.  
 */
public HostCatcher(ConnectionManager manager,String filename){
  this.manager=manager;
  BufferedReader in=null;
  try {
    in=new BufferedReader(new FileReader(filename));
  }
 catch (  FileNotFoundException e) {
    error(ActivityCallback.ERROR_10);
    return;
  }
  while (true) {
    String line=null;
    try {
      line=in.readLine();
    }
 catch (    IOException e) {
      return;
    }
    if (line == null)     break;
    int index=line.indexOf(':');
    if (index == -1) {
      continue;
    }
    String host=line.substring(0,index);
    int port=0;
    try {
      port=Integer.parseInt(line.substring(index + 1));
    }
 catch (    NumberFormatException e) {
      continue;
    }
catch (    ArrayIndexOutOfBoundsException e) {
      continue;
    }
    Endpoint e=new Endpoint(host,port);
    if (!set.contains(e)) {
      queue.add(0,e);
      set.add(e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a host catcher whose maybe set contains the hosts in the given file.  (The likelys set is empty.)  If filename does not exist, then no error message is printed and this is initially empty.  The file is expected to contain a sequence of lines in the format "<host>:port\n".  Lines not in this format are silently ignored.  manager is as described above.  
 */
public HostCatcher(ConnectionManager manager,String filename){
  this.manager=manager;
  BufferedReader in=null;
  try {
    in=new BufferedReader(new FileReader(filename));
  }
 catch (  FileNotFoundException e) {
    error(ActivityCallback.ERROR_10);
    return;
  }
  while (true) {
    String line=null;
    try {
      line=in.readLine();
    }
 catch (    IOException e) {
      return;
    }
    if (line == null)     break;
    int index=line.indexOf(':');
    if (index == -1) {
      continue;
    }
    String host=line.substring(0,index);
    int port=0;
    try {
      port=Integer.parseInt(line.substring(index + 1));
    }
 catch (    NumberFormatException e) {
      continue;
    }
catch (    ArrayIndexOutOfBoundsException e) {
      continue;
    }
    Endpoint e=new Endpoint(host,port);
    if ((!set.contains(e)) && (!isMe(host,port))) {
      queue.add(0,e);
      set.add(e);
    }
  }
}
Program: 5090
Project: 5090
Buggy source:
/** 
 * @modifies this
 * @effects may choose to add hosts listed in m to this
 */
public void spy(Message m){
  if (!(m instanceof PingReply))   return;
  PingReply pr=(PingReply)m;
  Endpoint e=new Endpoint(pr.getIP(),pr.getPort(),pr.getFiles(),pr.getKbytes());
  if (manager != null && manager.isConnected(e))   return;
synchronized (this) {
    if (!(set.contains(e))) {
      set.add(e);
      queue.add(e);
      this.notify();
    }
  }
  addKnownHost(e);
}

Fixed version (ground truth):
/** 
 * @modifies this
 * @effects may choose to add hosts listed in m to this
 */
public void spy(Message m){
  if (!(m instanceof PingReply))   return;
  PingReply pr=(PingReply)m;
  Endpoint e=new Endpoint(pr.getIP(),pr.getPort(),pr.getFiles(),pr.getKbytes());
  if (manager != null && manager.isConnected(e))   return;
  if (isMe(e.getHostname(),e.getPort()))   return;
synchronized (this) {
    if (!(set.contains(e))) {
      set.add(e);
      queue.add(e);
      this.notify();
    }
  }
  addKnownHost(e);
}
Program: 5091
Project: 5091
Buggy source:
/** 
 * Connect to remote host (establish outgoing connection). Blocks until connection established.
 */
public void connectToHost(Connection c) throws IOException {
  try {
    manager.tryingToConnect(c,false);
    c.connect();
    c.setManager(manager);
    manager.add(c);
    PingRequest pr=new PingRequest(SettingsManager.instance().getTTL());
    manager.fromMe(pr);
    c.send(pr);
    Thread tc=new Thread(c);
    tc.setDaemon(true);
    tc.start();
  }
 catch (  IOException e) {
    manager.failedToConnect(c);
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Connect to remote host (establish outgoing connection). Blocks until connection established. If establishing c would connect us to the listening socket, the connection is not established.
 */
public void connectToHost(Connection c) throws IOException {
  try {
    byte[] cIP=InetAddress.getByName(c.getOrigHost()).getAddress();
    if (Arrays.equals(cIP,LOCALHOST)) {
      if (c.getOrigPort() == manager.getListeningPort())       throw new IOException();
    }
 else {
      byte[] managerIP=manager.getAddress();
      if (Arrays.equals(cIP,managerIP) && c.getOrigPort() == manager.getListeningPort())       throw new IOException();
    }
    manager.tryingToConnect(c,false);
    c.connect();
    c.setManager(manager);
    manager.add(c);
    PingRequest pr=new PingRequest(SettingsManager.instance().getTTL());
    manager.fromMe(pr);
    c.send(pr);
    Thread tc=new Thread(c);
    tc.setDaemon(true);
    tc.start();
  }
 catch (  IOException e) {
    manager.failedToConnect(c);
    throw e;
  }
}
Program: 5092
Project: 5092
Buggy source:
public void run(){
  if (_mode == 1) {
    if (_state != QUEUED)     _callback.addDownload(this);
    initOne();
  }
 else   if (_mode == 2) {
    if (_state != QUEUED)     _callback.addDownload(this);
    initTwo();
  }
 else   if (_mode == 3) {
    initThree();
  }
 else   return;
  if (_state == CONNECTED) {
    doDownload();
    _callback.removeDownload(this);
  }
}

Fixed version (ground truth):
public void run(){
  if (_mode == 1) {
    if (_state != QUEUED)     _callback.addDownload(this);
    initOne();
  }
 else   if (_mode == 2) {
    if (_state != QUEUED)     _callback.addDownload(this);
    initTwo();
  }
 else   if (_mode == 3) {
    initThree();
  }
 else   Assert.that(false,"String_Node_Str");
  if (_state == CONNECTED) {
    doDownload();
    _callback.removeDownload(this);
  }
 else   if (_state == ERROR) {
    _callback.removeDownload(this);
  }
}
Program: 5093
Project: 5093
Buggy source:
public void run(){
  if (_mode == 1) {
    if (_state != QUEUED)     _callback.addDownload(this);
    initOne();
  }
 else   if (_mode == 2) {
    if (_state != QUEUED)     _callback.addDownload(this);
    initTwo();
  }
 else   if (_mode == 3) {
    initThree();
  }
 else   return;
  if (_state == CONNECTED) {
    doDownload();
    _callback.removeDownload(this);
  }
}

Fixed version (ground truth):
public void run(){
  if (_mode == 1) {
    if (_state != QUEUED)     _callback.addDownload(this);
    initOne();
  }
 else   if (_mode == 2) {
    if (_state != QUEUED)     _callback.addDownload(this);
    initTwo();
  }
 else   if (_mode == 3) {
    initThree();
  }
 else   Assert.that(false,"String_Node_Str");
  if (_state == CONNECTED) {
    doDownload();
    _callback.removeDownload(this);
  }
 else   if (_state == ERROR) {
    _callback.removeDownload(this);
  }
}
Program: 5094
Project: 5094
Buggy source:
public synchronized void addDirectory(String dir_name){
  File myFile=new File(dir_name);
  if (!myFile.exists())   return;
  File[] file_list=myFile.listFiles();
  int n=file_list.length;
  for (int i=0; i < n; i++) {
    if (file_list[i].isDirectory())     addDirectory(file_list[i].getAbsolutePath());
 else     addFile(file_list[i].getAbsolutePath());
  }
}

Fixed version (ground truth):
public synchronized void addDirectory(String dir_name){
  File myFile=new File(dir_name);
  if (!myFile.exists())   return;
  File[] file_list=listFiles(myFile);
  int n=file_list.length;
  for (int i=0; i < n; i++) {
    if (file_list[i].isDirectory())     addDirectory(file_list[i].getAbsolutePath());
 else     addFile(file_list[i].getAbsolutePath());
  }
}
Program: 5096
Project: 5096
Buggy source:
public void initThree(){
  SettingsManager set=SettingsManager.instance();
  _downloadDir=set.getSaveDirectory();
  String pathname=_downloadDir + _filename;
  File myFile=new File(pathname);
  if (!myFile.exists()) {
    _state=ERROR;
    return;
  }
  URLConnection conn;
  String furl="String_Node_Str" + String.valueOf(_index) + "String_Node_Str"+ _filename;
  long start=myFile.length() + 1;
  String startRange=java.lang.String.valueOf(start);
  try {
    URL url=new URL(_protocol,_host,_port,furl);
    conn=url.openConnection();
    conn.setRequestProperty("String_Node_Str","String_Node_Str" + startRange + "String_Node_Str");
    conn.connect();
    _istream=conn.getInputStream();
    _br=new ByteReader(_istream);
  }
 catch (  Exception e) {
    _state=ERROR;
    return;
  }
  _resume=true;
  _state=CONNECTED;
}

Fixed version (ground truth):
public void initThree(){
  SettingsManager set=SettingsManager.instance();
  _downloadDir=set.getSaveDirectory();
  String pathname=_downloadDir + _filename;
  File myFile=new File(pathname);
  if (!myFile.exists()) {
    _state=ERROR;
    return;
  }
  URLConnection conn;
  String furl="String_Node_Str" + String.valueOf(_index) + "String_Node_Str"+ _filename;
  long start=myFile.length();
  String startRange=java.lang.String.valueOf(start);
  try {
    URL url=new URL(_protocol,_host,_port,furl);
    conn=url.openConnection();
    conn.setRequestProperty("String_Node_Str","String_Node_Str" + startRange + "String_Node_Str");
    conn.connect();
    _istream=conn.getInputStream();
    _br=new ByteReader(_istream);
  }
 catch (  Exception e) {
    _state=ERROR;
    return;
  }
  _resume=true;
  _state=CONNECTED;
}
Program: 5097
Project: 5097
Buggy source:
public void doUpload() throws IOException {
  writeHeader();
  int c=-1;
  int available=0;
  byte[] buf=new byte[1024];
  int skip=0;
  if (_uploadBegin != 0)   skip=_uploadBegin - 1;
  _fis.skip(skip);
  while (true) {
    try {
      if ((_uploadEnd != 0) && (_uploadEnd == _amountRead))       break;
      c=_fis.read(buf);
    }
 catch (    IOException e) {
      throw e;
    }
    if (c == -1)     break;
    try {
      _ostream.write(buf,0,c);
    }
 catch (    IOException e) {
      throw e;
    }
    _amountRead+=c;
  }
  try {
    _ostream.close();
  }
 catch (  IOException e) {
    throw e;
  }
  _state=COMPLETE;
}

Fixed version (ground truth):
public void doUpload() throws IOException {
  writeHeader();
  int c=-1;
  int available=0;
  byte[] buf=new byte[1024];
  _fis.skip(_uploadBegin);
  while (true) {
    try {
      if ((_uploadEnd != 0) && (_uploadEnd == _amountRead))       break;
      c=_fis.read(buf);
    }
 catch (    IOException e) {
      throw e;
    }
    if (c == -1)     break;
    try {
      _ostream.write(buf,0,c);
    }
 catch (    IOException e) {
      throw e;
    }
    _amountRead+=c;
  }
  try {
    _ostream.close();
  }
 catch (  IOException e) {
    throw e;
  }
  _state=COMPLETE;
}
Program: 5098
Project: 5098
Buggy source:
public void initThree(){
  SettingsManager set=SettingsManager.instance();
  _downloadDir=set.getSaveDirectory();
  String pathname=_downloadDir + _filename;
  File myFile=new File(pathname);
  if (!myFile.exists()) {
    _state=ERROR;
    return;
  }
  URLConnection conn;
  String furl="String_Node_Str" + String.valueOf(_index) + "String_Node_Str"+ _filename;
  long start=myFile.length() + 1;
  String startRange=java.lang.String.valueOf(start);
  try {
    URL url=new URL(_protocol,_host,_port,furl);
    conn=url.openConnection();
    conn.setRequestProperty("String_Node_Str","String_Node_Str" + startRange + "String_Node_Str");
    conn.connect();
    _istream=conn.getInputStream();
    _br=new ByteReader(_istream);
  }
 catch (  Exception e) {
    _state=ERROR;
    return;
  }
  _resume=true;
  _state=CONNECTED;
}

Fixed version (ground truth):
public void initThree(){
  SettingsManager set=SettingsManager.instance();
  _downloadDir=set.getSaveDirectory();
  String pathname=_downloadDir + _filename;
  File myFile=new File(pathname);
  if (!myFile.exists()) {
    _state=ERROR;
    return;
  }
  URLConnection conn;
  String furl="String_Node_Str" + String.valueOf(_index) + "String_Node_Str"+ _filename;
  long start=myFile.length();
  String startRange=java.lang.String.valueOf(start);
  try {
    URL url=new URL(_protocol,_host,_port,furl);
    conn=url.openConnection();
    conn.setRequestProperty("String_Node_Str","String_Node_Str" + startRange + "String_Node_Str");
    conn.connect();
    _istream=conn.getInputStream();
    _br=new ByteReader(_istream);
  }
 catch (  Exception e) {
    _state=ERROR;
    return;
  }
  _resume=true;
  _state=CONNECTED;
}
Program: 5099
Project: 5099
Buggy source:
public void doUpload() throws IOException {
  writeHeader();
  int c=-1;
  int available=0;
  byte[] buf=new byte[1024];
  int skip=0;
  if (_uploadBegin != 0)   skip=_uploadBegin - 1;
  _fis.skip(skip);
  while (true) {
    try {
      if ((_uploadEnd != 0) && (_uploadEnd == _amountRead))       break;
      c=_fis.read(buf);
    }
 catch (    IOException e) {
      throw e;
    }
    if (c == -1)     break;
    try {
      _ostream.write(buf,0,c);
    }
 catch (    IOException e) {
      throw e;
    }
    _amountRead+=c;
  }
  try {
    _ostream.close();
  }
 catch (  IOException e) {
    throw e;
  }
  _state=COMPLETE;
}

Fixed version (ground truth):
public void doUpload() throws IOException {
  writeHeader();
  int c=-1;
  int available=0;
  byte[] buf=new byte[1024];
  _fis.skip(_uploadBegin);
  while (true) {
    try {
      if ((_uploadEnd != 0) && (_uploadEnd == _amountRead))       break;
      c=_fis.read(buf);
    }
 catch (    IOException e) {
      throw e;
    }
    if (c == -1)     break;
    try {
      _ostream.write(buf,0,c);
    }
 catch (    IOException e) {
      throw e;
    }
    _amountRead+=c;
  }
  try {
    _ostream.close();
  }
 catch (  IOException e) {
    throw e;
  }
  _state=COMPLETE;
}
Program: 5100
Project: 5100
Buggy source:
public void readHeader(){
  String str="String_Node_Str";
  boolean foundLength=false;
  boolean foundRangeInitial=false;
  boolean foundRangeFinal=false;
  while (!str.equals("String_Node_Str")) {
    str=_br.readLine();
    if (str.indexOf("String_Node_Str") != -1) {
      String sub;
      try {
        sub=str.substring(15);
      }
 catch (      IndexOutOfBoundsException e) {
        _state=ERROR;
        return;
      }
      sub=sub.trim();
      try {
        _sizeOfFile=java.lang.Integer.parseInt(sub);
      }
 catch (      NumberFormatException e) {
        _state=ERROR;
        return;
      }
      foundLength=true;
      ;
    }
    if (str.indexOf("String_Node_Str") != -1) {
      _resume=true;
    }
  }
  if (!foundLength) {
    _state=ERROR;
  }
}

Fixed version (ground truth):
public void readHeader(){
  String str="String_Node_Str";
  boolean foundLength=false;
  boolean foundRangeInitial=false;
  boolean foundRangeFinal=false;
  while (true) {
    try {
      str=_br.readLine();
    }
 catch (    IOException e) {
      _state=ERROR;
      return;
    }
    if (str == null || str.equals("String_Node_Str"))     break;
    if (str.indexOf("String_Node_Str") != -1) {
      String sub;
      try {
        sub=str.substring(15);
      }
 catch (      IndexOutOfBoundsException e) {
        _state=ERROR;
        return;
      }
      sub=sub.trim();
      try {
        _sizeOfFile=java.lang.Integer.parseInt(sub);
      }
 catch (      NumberFormatException e) {
        _state=ERROR;
        return;
      }
      foundLength=true;
      ;
    }
    if (str.indexOf("String_Node_Str") != -1) {
      _resume=true;
    }
  }
  if (!foundLength) {
    _state=ERROR;
  }
}
Program: 5101
Project: 5101
Buggy source:
public boolean equals(Object o){
  if (!(o instanceof PushRequestedFile))   return false;
  PushRequestedFile prf=(PushRequestedFile)o;
  return Arrays.equals(clientGUID,prf.clientGUID) && filename.equals(prf.filename) && Arrays.equals(ip,prf.ip)&& index == prf.index;
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (!(o instanceof PushRequestedFile))   return false;
  PushRequestedFile prf=(PushRequestedFile)o;
  return Arrays.equals(clientGUID,prf.clientGUID) && filename.equals(prf.filename) && index == prf.index;
}
Program: 5102
Project: 5102
Buggy source:
public void readHeader(){
  String str="String_Node_Str";
  boolean foundLength=false;
  boolean foundRangeInitial=false;
  boolean foundRangeFinal=false;
  while (!str.equals("String_Node_Str")) {
    str=_br.readLine();
    if (str.indexOf("String_Node_Str") != -1) {
      String sub;
      try {
        sub=str.substring(15);
      }
 catch (      IndexOutOfBoundsException e) {
        _state=ERROR;
        return;
      }
      sub=sub.trim();
      try {
        _sizeOfFile=java.lang.Integer.parseInt(sub);
      }
 catch (      NumberFormatException e) {
        _state=ERROR;
        return;
      }
      foundLength=true;
      ;
    }
    if (str.indexOf("String_Node_Str") != -1) {
      _resume=true;
    }
  }
  if (!foundLength) {
    _state=ERROR;
  }
}

Fixed version (ground truth):
public void readHeader(){
  String str="String_Node_Str";
  boolean foundLength=false;
  boolean foundRangeInitial=false;
  boolean foundRangeFinal=false;
  while (true) {
    try {
      str=_br.readLine();
    }
 catch (    IOException e) {
      _state=ERROR;
      return;
    }
    if (str == null || str.equals("String_Node_Str"))     break;
    if (str.indexOf("String_Node_Str") != -1) {
      String sub;
      try {
        sub=str.substring(15);
      }
 catch (      IndexOutOfBoundsException e) {
        _state=ERROR;
        return;
      }
      sub=sub.trim();
      try {
        _sizeOfFile=java.lang.Integer.parseInt(sub);
      }
 catch (      NumberFormatException e) {
        _state=ERROR;
        return;
      }
      foundLength=true;
      ;
    }
    if (str.indexOf("String_Node_Str") != -1) {
      _resume=true;
    }
  }
  if (!foundLength) {
    _state=ERROR;
  }
}
Program: 5103
Project: 5103
Buggy source:
public boolean equals(Object o){
  if (!(o instanceof PushRequestedFile))   return false;
  PushRequestedFile prf=(PushRequestedFile)o;
  return Arrays.equals(clientGUID,prf.clientGUID) && filename.equals(prf.filename) && Arrays.equals(ip,prf.ip)&& index == prf.index;
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (!(o instanceof PushRequestedFile))   return false;
  PushRequestedFile prf=(PushRequestedFile)o;
  return Arrays.equals(clientGUID,prf.clientGUID) && filename.equals(prf.filename) && index == prf.index;
}
Program: 5104
Project: 5104
Buggy source:
public void readHeader(){
  String str=null;
  int flag=0;
  while (true) {
    str=_br.readLine();
    if (str.indexOf("String_Node_Str") != -1) {
      String sub;
      try {
        sub=str.substring(15);
      }
 catch (      ArrayIndexOutOfBoundsException e) {
        _state=ERROR;
        return;
      }
      sub.trim();
      try {
        _sizeOfFile=java.lang.Integer.parseInt(sub);
      }
 catch (      NumberFormatException e) {
        _state=ERROR;
        return;
      }
      flag=1;
      str=_br.readLine();
      break;
    }
  }
  if (flag == 0) {
    _state=ERROR;
  }
}

Fixed version (ground truth):
public void readHeader(){
  String str=null;
  int flag=0;
  while (true) {
    str=_br.readLine();
    if (str.indexOf("String_Node_Str") != -1) {
      String sub;
      try {
        sub=str.substring(15);
      }
 catch (      ArrayIndexOutOfBoundsException e) {
        _state=ERROR;
        return;
      }
      sub=sub.trim();
      try {
        _sizeOfFile=java.lang.Integer.parseInt(sub);
      }
 catch (      NumberFormatException e) {
        _state=ERROR;
        return;
      }
      flag=1;
      str=_br.readLine();
      break;
    }
  }
  if (flag == 0) {
    _state=ERROR;
  }
}
Program: 5105
Project: 5105
Buggy source:
public void readHeader(){
  String str=null;
  int flag=0;
  while (true) {
    str=_br.readLine();
    if (str.indexOf("String_Node_Str") != -1) {
      String sub;
      try {
        sub=str.substring(15);
      }
 catch (      ArrayIndexOutOfBoundsException e) {
        _state=ERROR;
        return;
      }
      sub.trim();
      try {
        _sizeOfFile=java.lang.Integer.parseInt(sub);
      }
 catch (      NumberFormatException e) {
        _state=ERROR;
        return;
      }
      flag=1;
      str=_br.readLine();
      break;
    }
  }
  if (flag == 0) {
    _state=ERROR;
  }
}

Fixed version (ground truth):
public void readHeader(){
  String str=null;
  int flag=0;
  while (true) {
    str=_br.readLine();
    if (str.indexOf("String_Node_Str") != -1) {
      String sub;
      try {
        sub=str.substring(15);
      }
 catch (      ArrayIndexOutOfBoundsException e) {
        _state=ERROR;
        return;
      }
      sub=sub.trim();
      try {
        _sizeOfFile=java.lang.Integer.parseInt(sub);
      }
 catch (      NumberFormatException e) {
        _state=ERROR;
        return;
      }
      flag=1;
      str=_br.readLine();
      break;
    }
  }
  if (flag == 0) {
    _state=ERROR;
  }
}
Program: 5106
Project: 5106
Buggy source:
/** 
 * Create a hex version of a GUID for compact display and storage Note that the client guid should be read in with the  Integer.parseByte(String s, int radix)  call like this in reverse
 */
public String toHexString(){
  StringBuffer buf=new StringBuffer();
  String str;
  int val;
  for (int i=0; i < SZ; i+=4) {
    val=bytes[i];
    val=(val * 256) + bytes[i + 1];
    val=(val * 256) + bytes[i + 2];
    val=(val * 256) + bytes[i + 3];
    str=Integer.toHexString(val);
    while (str.length() < 8)     str="String_Node_Str" + str;
    buf.append(str);
  }
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Create a hex version of a GUID for compact display and storage Note that the client guid should be read in with the  Integer.parseByte(String s, int radix)  call like this in reverse
 */
public String toHexString(){
  StringBuffer buf=new StringBuffer();
  String str;
  int val;
  for (int i=0; i < SZ; i++) {
    val=ByteOrder.ubyte2int(bytes[i]);
    str=Integer.toHexString(val);
    while (str.length() < 2)     str="String_Node_Str" + str;
    buf.append(str);
  }
  return buf.toString();
}
Program: 5107
Project: 5107
Buggy source:
/** 
 * Create a GUID bytes from a hex string version.
 */
public static byte[] fromHexString(String sguid){
  byte bytes[]=new byte[SZ];
  for (int i=0; i < SZ; i++) {
    bytes[i]=Byte.parseByte(sguid.substring(i * 2,i * 2 + 1),16);
  }
  return bytes;
}

Fixed version (ground truth):
/** 
 * Create a GUID bytes from a hex string version. Throws IllegalArgumentException if sguid is not of the proper format.
 */
public static byte[] fromHexString(String sguid) throws IllegalArgumentException {
  byte bytes[]=new byte[SZ];
  try {
    for (int i=0; i < SZ; i++) {
      bytes[i]=(byte)Integer.parseInt(sguid.substring(i * 2,(i * 2) + 2),16);
    }
    return bytes;
  }
 catch (  NumberFormatException e) {
    throw new IllegalArgumentException();
  }
catch (  IndexOutOfBoundsException e) {
    throw new IllegalArgumentException();
  }
}
Program: 5108
Project: 5108
Buggy source:
public String readLine(){
  if (_istream == null)   return "String_Node_Str";
  String finalString="String_Node_Str";
  byte[] buf=new byte[BUFSIZE];
  int c=-1;
  int b=-1;
  int i=0;
  int numBytes=0;
  boolean endOfLine=false;
  String cr="String_Node_Str";
  byte[] creturn=cr.getBytes();
  String nl="String_Node_Str";
  byte[] nline=nl.getBytes();
  while (!endOfLine) {
    try {
      c=_istream.read();
    }
 catch (    IOException e) {
    }
    if (c == -1)     break;
    if (c == creturn[0]) {
      try {
        b=_istream.read();
      }
 catch (      IOException e) {
      }
      if (b == -1)       break;
      if (b == nline[0])       endOfLine=true;
 else {
        buf[i++]=(byte)c;
        buf[i++]=(byte)b;
        numBytes+=2;
      }
    }
 else {
      buf[i++]=(byte)c;
      numBytes++;
    }
    if (numBytes == BUFSIZE) {
      finalString+=new String(buf,0,numBytes);
      i=0;
      numBytes=0;
    }
  }
  finalString+=new String(buf,0,numBytes);
  return finalString;
}

Fixed version (ground truth):
public String readLine(){
  if (_istream == null)   return "String_Node_Str";
  String finalString="String_Node_Str";
  byte[] buf=new byte[BUFSIZE];
  int c=-1;
  int b=-1;
  int i=0;
  int numBytes=0;
  String cr="String_Node_Str";
  byte[] creturn=cr.getBytes();
  String nl="String_Node_Str";
  byte[] nline=nl.getBytes();
  while (true) {
    try {
      c=_istream.read();
    }
 catch (    IOException e) {
    }
    if (c == -1)     break;
    if (c == creturn[0]) {
      try {
        b=_istream.read();
      }
 catch (      IOException e) {
      }
      if (b == -1)       break;
      if (b == nline[0])       break;
 else {
        buf[i++]=(byte)c;
        buf[i++]=(byte)b;
        numBytes+=2;
      }
    }
 else {
      buf[i++]=(byte)c;
      numBytes++;
    }
    if (numBytes == BUFSIZE) {
      finalString+=new String(buf,0,numBytes);
      i=0;
      numBytes=0;
    }
  }
  finalString+=new String(buf,0,numBytes);
  return finalString;
}
Program: 5109
Project: 5109
Buggy source:
public void doDownload(){
  SettingsManager set=SettingsManager.instance();
  _downloadDir=set.getSaveDirectory();
  String pathname=_downloadDir + _filename;
  System.out.println(pathname);
  try {
    _fos=new FileOutputStream(pathname);
  }
 catch (  FileNotFoundException e) {
    System.out.println("String_Node_Str");
  }
catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
  readHeader();
  int c=-1;
  byte[] buf=new byte[1024];
  while (true) {
    try {
      c=_br.read(buf);
    }
 catch (    Exception e) {
      System.out.print("String_Node_Str");
    }
    if (c == -1)     break;
    try {
      _fos.write(buf,0,c);
    }
 catch (    Exception e) {
      System.out.print("String_Node_Str");
    }
    _amountRead+=c;
  }
  try {
    _br.close();
    _fos.close();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
public void doDownload(){
  SettingsManager set=SettingsManager.instance();
  _downloadDir=set.getSaveDirectory();
  String fs=System.getProperty("String_Node_Str");
  String pathname=_downloadDir + fs + _filename;
  System.out.println(pathname);
  try {
    _fos=new FileOutputStream(pathname);
  }
 catch (  FileNotFoundException e) {
    System.out.println("String_Node_Str");
  }
catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
  readHeader();
  int c=-1;
  byte[] buf=new byte[1024];
  while (true) {
    try {
      c=_br.read(buf);
    }
 catch (    Exception e) {
      System.out.print("String_Node_Str");
    }
    if (c == -1)     break;
    try {
      _fos.write(buf,0,c);
    }
 catch (    Exception e) {
      System.out.print("String_Node_Str");
    }
    _amountRead+=c;
  }
  try {
    _br.close();
    _fos.close();
  }
 catch (  IOException e) {
  }
}
Program: 5110
Project: 5110
Buggy source:
public void doDownload(){
  SettingsManager set=SettingsManager.instance();
  _downloadDir=set.getSaveDirectory();
  String pathname=_downloadDir + _filename;
  System.out.println(pathname);
  try {
    _fos=new FileOutputStream(pathname);
  }
 catch (  FileNotFoundException e) {
    System.out.println("String_Node_Str");
  }
catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
  readHeader();
  int c=-1;
  byte[] buf=new byte[1024];
  while (true) {
    try {
      c=_br.read(buf);
    }
 catch (    Exception e) {
      System.out.print("String_Node_Str");
    }
    if (c == -1)     break;
    try {
      _fos.write(buf,0,c);
    }
 catch (    Exception e) {
      System.out.print("String_Node_Str");
    }
    _amountRead+=c;
  }
  try {
    _br.close();
    _fos.close();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
public void doDownload(){
  SettingsManager set=SettingsManager.instance();
  _downloadDir=set.getSaveDirectory();
  String fs=System.getProperty("String_Node_Str");
  String pathname=_downloadDir + fs + _filename;
  System.out.println(pathname);
  try {
    _fos=new FileOutputStream(pathname);
  }
 catch (  FileNotFoundException e) {
    System.out.println("String_Node_Str");
  }
catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
  readHeader();
  int c=-1;
  byte[] buf=new byte[1024];
  while (true) {
    try {
      c=_br.read(buf);
    }
 catch (    Exception e) {
      System.out.print("String_Node_Str");
    }
    if (c == -1)     break;
    try {
      _fos.write(buf,0,c);
    }
 catch (    Exception e) {
      System.out.print("String_Node_Str");
    }
    _amountRead+=c;
  }
  try {
    _br.close();
    _fos.close();
  }
 catch (  IOException e) {
  }
}
Program: 5111
Project: 5111
Buggy source:
public int read(byte[] buf){
  int c=-1;
  if (_istream == null)   return c;
  try {
    c=_istream.read(buf);
    System.out.print(c + "String_Node_Str");
  }
 catch (  IOException e) {
  }
  return c;
}

Fixed version (ground truth):
public int read(byte[] buf){
  int c=-1;
  if (_istream == null)   return c;
  try {
    c=_istream.read(buf);
  }
 catch (  IOException e) {
  }
  return c;
}
Program: 5112
Project: 5112
Buggy source:
public String readLine(){
  if (_istream == null)   return "String_Node_Str";
  String finalString="String_Node_Str";
  byte[] buf=new byte[BUFSIZE];
  int c=-1;
  int b=-1;
  int i=0;
  int numBytes=0;
  String cr="String_Node_Str";
  byte[] creturn=cr.getBytes();
  String nl="String_Node_Str";
  byte[] nline=nl.getBytes();
  while (true) {
    try {
      c=_istream.read();
    }
 catch (    IOException e) {
    }
    if (c == -1)     break;
    if (c == creturn[0]) {
      try {
        b=_istream.read();
      }
 catch (      IOException e) {
      }
      if (b == -1)       break;
      if (b == nline[0])       break;
 else {
        buf[i++]=(byte)c;
        buf[i++]=(byte)b;
        numBytes+=2;
      }
    }
 else {
      buf[i++]=(byte)c;
      numBytes++;
    }
    if (numBytes == BUFSIZE) {
      finalString+=new String(buf,0,numBytes);
      i=0;
      numBytes=0;
    }
  }
  finalString+=new String(buf,0,numBytes);
  return finalString;
}

Fixed version (ground truth):
public String readLine(){
  if (_istream == null)   return "String_Node_Str";
  String finalString="String_Node_Str";
  byte[] buf=new byte[BUFSIZE];
  int c=-1;
  int b=-1;
  int i=0;
  int numBytes=0;
  String cr="String_Node_Str";
  byte[] creturn=cr.getBytes();
  String nl="String_Node_Str";
  byte[] nline=nl.getBytes();
  while (true) {
    try {
      c=_istream.read();
    }
 catch (    IOException e) {
    }
    if (c == -1)     break;
    if (c == creturn[0]) {
      try {
        b=_istream.read();
      }
 catch (      IOException e) {
      }
      if (b == -1)       break;
      if (b == nline[0])       break;
 else {
      }
    }
 else {
      buf[i++]=(byte)c;
      numBytes++;
    }
    if (numBytes == BUFSIZE) {
      finalString+=new String(buf,0,numBytes);
      i=0;
      numBytes=0;
    }
  }
  finalString+=new String(buf,0,numBytes);
  return finalString;
}
Program: 5113
Project: 5113
Buggy source:
public HTTPDownloader(String protocal,String host,int port,int index,String file,ConnectionManager m,byte[] guid){
  _filename=file;
  _amountRead=0;
  _sizeOfFile=-1;
  _socket=null;
  _manager=m;
  _callback=_manager.getCallback();
  _downloadDir="String_Node_Str";
  URLConnection conn;
  String furl="String_Node_Str" + String.valueOf(index) + "String_Node_Str"+ file;
  try {
    URL url=new URL(protocal,host,port,furl);
    conn=url.openConnection();
  }
 catch (  java.net.MalformedURLException e) {
    sendPushRequest(host,index,port,guid);
    _callback.error(ActivityCallback.ERROR_5);
    return;
  }
catch (  IOException e) {
    sendPushRequest(host,index,port,guid);
    _callback.error(ActivityCallback.ERROR_6);
    return;
  }
  try {
    _istream=conn.getInputStream();
    _br=new ByteReader(_istream);
  }
 catch (  NoRouteToHostException e) {
    System.out.println("String_Node_Str");
    _callback.error(ActivityCallback.ERROR_13);
    return;
  }
catch (  IOException e) {
    e.printStackTrace();
    sendPushRequest(host,index,port,guid);
    return;
  }
}

Fixed version (ground truth):
public HTTPDownloader(String protocal,String host,int port,int index,String file,ConnectionManager m,byte[] guid){
  _okay=false;
  _filename=file;
  _amountRead=0;
  _sizeOfFile=-1;
  _socket=null;
  _manager=m;
  _callback=_manager.getCallback();
  _downloadDir="String_Node_Str";
  URLConnection conn;
  String furl="String_Node_Str" + String.valueOf(index) + "String_Node_Str"+ file;
  try {
    URL url=new URL(protocal,host,port,furl);
    conn=url.openConnection();
  }
 catch (  java.net.MalformedURLException e) {
    sendPushRequest(host,index,port,guid);
    _callback.error(ActivityCallback.ERROR_5);
    return;
  }
catch (  IOException e) {
    sendPushRequest(host,index,port,guid);
    _callback.error(ActivityCallback.ERROR_6);
    return;
  }
catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
    return;
  }
  try {
    _istream=conn.getInputStream();
    _br=new ByteReader(_istream);
  }
 catch (  NoRouteToHostException e) {
    System.out.println("String_Node_Str");
    _callback.error(ActivityCallback.ERROR_13);
    return;
  }
catch (  IOException e) {
    e.printStackTrace();
    sendPushRequest(host,index,port,guid);
    return;
  }
catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
    return;
  }
  _okay=true;
}
Program: 5114
Project: 5114
Buggy source:
public void doDownload(){
  SettingsManager set=SettingsManager.instance();
  _downloadDir=set.getSaveDirectory();
  String pathname=_downloadDir + _filename;
  System.out.println(pathname);
  try {
    _fos=new FileOutputStream(pathname);
  }
 catch (  FileNotFoundException e) {
    System.out.println("String_Node_Str");
  }
catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
  readHeader();
  int c=-1;
  byte[] buf=new byte[1024];
  while (true) {
    try {
      c=_br.read(buf);
    }
 catch (    Exception e) {
      System.out.print("String_Node_Str");
    }
    if (c == -1)     break;
    try {
      _fos.write(buf,0,c);
    }
 catch (    Exception e) {
      System.out.print("String_Node_Str");
    }
    _amountRead+=c;
  }
  try {
    _br.close();
    _fos.close();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
public void doDownload(){
  SettingsManager set=SettingsManager.instance();
  _downloadDir=set.getSaveDirectory();
  String pathname=_downloadDir + _filename;
  System.out.println(pathname);
  try {
    _fos=new FileOutputStream(pathname);
  }
 catch (  FileNotFoundException e) {
    System.out.println("String_Node_Str");
  }
catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
  readHeader();
  int c=-1;
  byte[] buf=new byte[1024];
  while (true) {
    try {
      c=_br.read(buf);
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str");
      return;
    }
    if (c == -1)     break;
    try {
      _fos.write(buf,0,c);
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      e.printStackTrace();
      return;
    }
    _amountRead+=c;
    System.out.println("String_Node_Str" + _amountRead);
    System.out.println("String_Node_Str" + _sizeOfFile);
    double percent=_amountRead / _sizeOfFile;
    System.out.println("String_Node_Str" + percent);
    System.out.println("String_Node_Str");
  }
  try {
    _br.close();
    _fos.close();
  }
 catch (  IOException e) {
  }
}
Program: 5115
Project: 5115
Buggy source:
public void run(){
  _callback.addDownload(this);
  doDownload();
  _callback.removeDownload(this);
}

Fixed version (ground truth):
public void run(){
  if (_okay) {
    _callback.addDownload(this);
    doDownload();
    _callback.removeDownload(this);
  }
}
Program: 5116
Project: 5116
Buggy source:
public void readHeader(){
  String str=null;
  while (true) {
    str=_br.readLine();
    System.out.println(str);
    if (str.indexOf("String_Node_Str") != -1) {
      String sub=str.substring(15);
      sub.trim();
      _sizeOfFile=java.lang.Integer.parseInt(sub);
      str=_br.readLine();
      System.out.println(str);
      break;
    }
  }
}

Fixed version (ground truth):
public void readHeader(){
  String str=null;
  int flag=0;
  while (true) {
    str=_br.readLine();
    System.out.println(str);
    if (str.indexOf("String_Node_Str") != -1) {
      String sub=str.substring(15);
      sub.trim();
      System.out.println("String_Node_Str" + str + "String_Node_Str");
      System.out.println("String_Node_Str" + sub + "String_Node_Str");
      try {
        _sizeOfFile=java.lang.Integer.parseInt(sub);
      }
 catch (      NumberFormatException e) {
        System.out.println("String_Node_Str");
        return;
      }
      flag=1;
      str=_br.readLine();
      System.out.println(str);
      break;
    }
  }
  if (flag == 0) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
  }
}