Program: 45353
Project: 45353
Buggy source:
public DIFManager(String rina,String addr,String DNSAddress){
  ipAddr=addr;
  rinaName=rina;
  InetIPC ipc=new InetIPC(rinaName);
  try {
    Socket dns=new Socket(DNSAddress,DNS_PORT);
    String IDDAdress="String_Node_Str";
    boolean success2=false;
    while (!success2) {
      dns.getOutputStream().write(Message.newDNS_UPDATE_REQ(rinaName));
      Message response=Message.readFromSocket(dns);
      if (response.errorCode == 0) {
        success2=true;
        IDDAdress=response.text1;
        if (IDDAdress == null || IDDAdress.equals("String_Node_Str")) {
          System.out.println("String_Node_Str");
          System.exit(0);
        }
      }
    }
    Socket s=new Socket(IDDAdress,IDD_PORT);
    boolean success=false;
    while (!success) {
      s.getOutputStream().write(Message.newCDAP_IDD_SERVADD_REQ(rinaName,ipAddr));
      Message response=Message.readFromSocket(s);
      if (response.errorCode == 0)       success=true;
    }
    InetDIFServerSocket idss=ipc.newServerSocket(Constants.DIF_MANAGER_PORT);
    while (true) {
      InetDIFSocket ids=idss.accept();
      Message req=Message.parseMessage(ids.read());
      if (req.type == Message.CDAP_CONNECT_REQ) {
        int auth=authenticate(req.text1,req.text2);
        ids.write(Message.newCDAP_CONNECT_RSP(auth));
        if (auth == 0) {
          internalData.addMember(new Member(ids.getDestName(),new DIF("String_Node_Str"),ids.getDestAddr()));
          boolean received=false;
          while (!received) {
            byte[] update=Message.newCDAP_UPDATE_RIB_REQ(internalData.getMemberList());
            ids.write(update);
            if (Message.parseMessage(ids.read()).errorCode == 0)             received=true;
          }
          for (          Member b : internalData.getMemberList()) {
            InetDIFSocket cli_sock=ipc.openNewSocket(b.getName());
            received=false;
            while (!received) {
              byte[] update=Message.newCDAP_UPDATE_RIB_REQ(internalData.getMemberList());
              cli_sock.write(update);
              if (Message.parseMessage(cli_sock.read()).errorCode == 0)               received=true;
            }
          }
        }
      }
      ids.close();
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public DIFManager(String rina){
  rinaName=Constants.DIF_MANAGER_NAME;
  DIFName=rina;
  userPasswordPairs=new Hashtable<String,String>();
  internalData=new ResourceInformationBase();
  userPasswordPairs.put(Constants.username,Constants.password);
  InetIPC ipc=new InetIPC(rinaName);
  try {
    Socket dns=new Socket(Constants.DNS_IP,Constants.DNS_PORT);
    String IDDAdress="String_Node_Str";
    boolean success2=false;
    while (!success2) {
      dns.getOutputStream().write(Message.newDNS_UPDATE_REQ(rinaName));
      Message response=Message.readFromSocket(dns);
      System.out.println("String_Node_Str");
      if (response.errorCode == 0) {
        System.out.println("String_Node_Str");
        success2=true;
        IDDAdress=response.text1;
        System.out.println("String_Node_Str" + IDDAdress);
        if (IDDAdress == null || IDDAdress.equals("String_Node_Str")) {
          System.out.println("String_Node_Str");
          System.exit(0);
        }
      }
    }
    System.out.println("String_Node_Str" + IDDAdress);
    Socket s=new Socket(IDDAdress,Constants.IDD_PORT);
    boolean success=false;
    while (!success) {
      s.getOutputStream().write(Message.newCDAP_IDD_UPDATE_REQ(DIFName,rinaName));
      Message response=Message.readFromSocket(s);
      if (response.errorCode == 0)       success=true;
    }
    InetDIFServerSocket idss=ipc.newServerSocket(Constants.DIF_MANAGER_PORT);
    while (true) {
      InetDIFSocket ids=idss.accept();
      Message req=Message.parseMessage(ids.read());
      if (req.type == Message.CDAP_CONNECT_REQ) {
        int auth=authenticate(req.text1,req.text2);
        ids.write(Message.newCDAP_CONNECT_RSP(auth));
        if (auth == 0) {
          internalData.addMember(new Member(ids.getDestName(),new DIF("String_Node_Str"),ids.getDestAddr()));
          boolean received=false;
          while (!received) {
            byte[] update=Message.newCDAP_UPDATE_RIB_REQ(internalData.getMemberList());
            ids.write(update);
            if (Message.parseMessage(ids.read()).errorCode == 0)             received=true;
          }
          for (          Member b : internalData.getMemberList()) {
            InetDIFSocket cli_sock=ipc.openNewSocket(b.getName());
            received=false;
            while (!received) {
              byte[] update=Message.newCDAP_UPDATE_RIB_REQ(internalData.getMemberList());
              cli_sock.write(update);
              if (Message.parseMessage(cli_sock.read()).errorCode == 0)               received=true;
            }
          }
        }
      }
      ids.close();
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}