Program: 103498
Project: 103498
Buggy source:
public Hop resolveAddress(Hop inputAddress){
  try {
    String transport=inputAddress.getTransport();
    String hostAddress=inputAddress.getHost();
    if (transport == null)     transport=ListeningPoint.UDP;
    InetSocketAddress host;
    if (NetworkUtils.isValidIPAddress(hostAddress)) {
      byte[] addr=null;
      addr=IPAddressUtil.textToNumericFormatV4(hostAddress);
      if (addr == null) {
        addr=IPAddressUtil.textToNumericFormatV6(hostAddress);
      }
      host=new InetSocketAddress(InetAddress.getByAddress(hostAddress,addr),inputAddress.getPort());
    }
 else     if (transport.equalsIgnoreCase(ListeningPoint.TLS)) {
      host=NetworkUtils.getSRVRecord("String_Node_Str",ListeningPoint.TCP,hostAddress);
    }
 else {
      host=NetworkUtils.getSRVRecord("String_Node_Str",transport,hostAddress);
    }
    if (host != null) {
      if (logger.isTraceEnabled())       logger.trace("String_Node_Str" + "String_Node_Str" + host.getHostName() + "String_Node_Str"+ host.getPort()+ "String_Node_Str"+ transport);
      return new HopImpl(host.getHostName(),host.getPort(),transport);
    }
  }
 catch (  Exception ex) {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + inputAddress + "String_Node_Str"+ ex.getMessage());
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str",ex);
  }
  Hop returnHop;
  if (inputAddress.getPort() != -1) {
    returnHop=inputAddress;
  }
 else {
    String transport=inputAddress.getTransport();
    returnHop=new HopImpl(inputAddress.getHost(),MessageProcessor.getDefaultPort(transport),transport);
  }
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + returnHop);
  return returnHop;
}

Fixed version (ground truth):
/** 
 * Implements the actual resolving. This is where we do the DNS queries.
 * @param inputAddress the unresolved <tt>Hop</tt> that we'd need to findan address for.
 * @return the newly created <tt>Hop</tt> containing the resolveddestination.
 */
public Hop resolveAddress(Hop inputAddress){
  try {
    String transport=inputAddress.getTransport();
    String hostAddress=inputAddress.getHost();
    if (transport == null)     transport=ListeningPoint.UDP;
    InetSocketAddress host;
    if (NetworkUtils.isValidIPAddress(hostAddress)) {
      byte[] addr=null;
      addr=NetworkUtils.strToIPv4(hostAddress);
      if (addr == null) {
        addr=NetworkUtils.strToIPv6(hostAddress);
      }
      host=new InetSocketAddress(InetAddress.getByAddress(hostAddress,addr),inputAddress.getPort());
    }
 else     if (transport.equalsIgnoreCase(ListeningPoint.TLS)) {
      host=NetworkUtils.getSRVRecord("String_Node_Str",ListeningPoint.TCP,hostAddress);
    }
 else {
      host=NetworkUtils.getSRVRecord("String_Node_Str",transport,hostAddress);
    }
    if (host != null) {
      if (logger.isTraceEnabled())       logger.trace("String_Node_Str" + "String_Node_Str" + host.getHostName() + "String_Node_Str"+ host.getPort()+ "String_Node_Str"+ transport);
      return new HopImpl(host.getHostName(),host.getPort(),transport);
    }
  }
 catch (  Exception ex) {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + inputAddress + "String_Node_Str"+ ex.getMessage());
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str",ex);
  }
  Hop returnHop;
  if (inputAddress.getPort() != -1) {
    returnHop=inputAddress;
  }
 else {
    String transport=inputAddress.getTransport();
    returnHop=new HopImpl(inputAddress.getHost(),MessageProcessor.getDefaultPort(transport),transport);
  }
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + returnHop);
  return returnHop;
}