Program: 49466
Project: 49466
Buggy source:
private Collection<Address> getPossibleAddresses(){
  final Collection<String> possibleMembers=getMembers();
  final Set<Address> possibleAddresses=new HashSet<Address>();
  final NetworkConfig networkConfig=config.getNetworkConfig();
  for (  String possibleMember : possibleMembers) {
    try {
      final AddressHolder addressHolder=AddressUtil.getAddressHolder(possibleMember);
      final boolean portIsDefined=addressHolder.port != -1 || !networkConfig.isPortAutoIncrement();
      final int count=portIsDefined ? 1 : MAX_PORT_TRIES;
      final int port=addressHolder.port != -1 ? addressHolder.port : networkConfig.getPort();
      AddressMatcher addressMatcher=null;
      try {
        addressMatcher=AddressUtil.getAddressMatcher(addressHolder.address);
      }
 catch (      InvalidAddressException ignore) {
      }
      if (addressMatcher != null) {
        final Collection<String> matchedAddresses;
        if (addressMatcher.isIPv4()) {
          matchedAddresses=AddressUtil.getMatchingIpv4Addresses(addressMatcher);
        }
 else {
          matchedAddresses=Collections.singleton(addressHolder.address);
        }
        for (        String matchedAddress : matchedAddresses) {
          addPossibleAddresses(possibleAddresses,matchedAddress,null,port,count);
        }
      }
 else {
        final String host=addressHolder.address;
        final Interfaces interfaces=networkConfig.getInterfaces();
        if (interfaces.isEnabled()) {
          final InetAddress[] inetAddresses=InetAddress.getAllByName(host);
          if (inetAddresses.length > 1) {
            for (            InetAddress inetAddress : inetAddresses) {
              if (AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces())) {
                addPossibleAddresses(possibleAddresses,null,inetAddress,port,count);
              }
            }
          }
 else {
            final InetAddress inetAddress=inetAddresses[0];
            if (AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces())) {
              addPossibleAddresses(possibleAddresses,host,null,port,count);
            }
          }
        }
 else {
          addPossibleAddresses(possibleAddresses,host,null,port,count);
        }
      }
    }
 catch (    UnknownHostException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
  possibleAddresses.addAll(networkConfig.getJoin().getTcpIpConfig().getAddresses());
  return possibleAddresses;
}

Fixed version (ground truth):
private Collection<Address> getPossibleAddresses(){
  final Collection<String> possibleMembers=getMembers();
  final Set<Address> possibleAddresses=new HashSet<Address>();
  final NetworkConfig networkConfig=config.getNetworkConfig();
  for (  String possibleMember : possibleMembers) {
    try {
      final AddressHolder addressHolder=AddressUtil.getAddressHolder(possibleMember);
      final boolean portIsDefined=addressHolder.port != -1 || !networkConfig.isPortAutoIncrement();
      final int count=portIsDefined ? 1 : MAX_PORT_TRIES;
      final int port=addressHolder.port != -1 ? addressHolder.port : networkConfig.getPort();
      AddressMatcher addressMatcher=null;
      try {
        addressMatcher=AddressUtil.getAddressMatcher(addressHolder.address);
      }
 catch (      InvalidAddressException ignore) {
      }
      if (addressMatcher != null) {
        final Collection<String> matchedAddresses;
        if (addressMatcher.isIPv4()) {
          matchedAddresses=AddressUtil.getMatchingIpv4Addresses(addressMatcher);
        }
 else {
          matchedAddresses=Collections.singleton(addressHolder.address);
        }
        for (        String matchedAddress : matchedAddresses) {
          addPossibleAddresses(possibleAddresses,null,InetAddress.getByName(matchedAddress),port,count);
        }
      }
 else {
        final String host=addressHolder.address;
        final Interfaces interfaces=networkConfig.getInterfaces();
        if (interfaces.isEnabled()) {
          final InetAddress[] inetAddresses=InetAddress.getAllByName(host);
          if (inetAddresses.length > 1) {
            for (            InetAddress inetAddress : inetAddresses) {
              if (AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces())) {
                addPossibleAddresses(possibleAddresses,null,inetAddress,port,count);
              }
            }
          }
 else {
            final InetAddress inetAddress=inetAddresses[0];
            if (AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces())) {
              addPossibleAddresses(possibleAddresses,host,null,port,count);
            }
          }
        }
 else {
          addPossibleAddresses(possibleAddresses,host,null,port,count);
        }
      }
    }
 catch (    UnknownHostException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
  possibleAddresses.addAll(networkConfig.getJoin().getTcpIpConfig().getAddresses());
  return possibleAddresses;
}