Program: 49592
Project: 49592
Buggy source:
private Collection<Address> getPossibleAddresses(){
  final Collection<String> possibleMembers=getMembers();
  final Set<Address> setPossibleAddresses=new HashSet<Address>();
  final Address thisAddress=node.address;
  for (  String host : possibleMembers) {
    try {
      final AddressHolder addressHolder=AddressUtil.getAddressHolder(host);
      final boolean portIsDefined=addressHolder.port != -1 || !config.isPortAutoIncrement();
      final int maxAddressTries=portIsDefined ? 1 : MAX_ADDRESS_TRIES;
      final int port=addressHolder.port != -1 ? addressHolder.port : config.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) {
          for (int i=0; i < maxAddressTries; i++) {
            final Address addressProper=new Address(matchedAddress,port + i);
            if (!addressProper.equals(thisAddress)) {
              setPossibleAddresses.add(addressProper);
            }
          }
        }
      }
 else {
        final InetAddress[] allAddresses=InetAddress.getAllByName(addressHolder.address);
        for (        final InetAddress inetAddress : allAddresses) {
          boolean matchingAddress=true;
          Interfaces interfaces=config.getNetworkConfig().getInterfaces();
          if (interfaces.isEnabled()) {
            matchingAddress=AddressPicker.matchAddress(inetAddress.getHostAddress(),interfaces.getInterfaces());
          }
          if (matchingAddress) {
            for (int i=0; i < maxAddressTries; i++) {
              final Address addressProper=new Address(inetAddress,port + i);
              if (!addressProper.equals(thisAddress)) {
                setPossibleAddresses.add(addressProper);
              }
            }
          }
        }
      }
    }
 catch (    UnknownHostException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
  setPossibleAddresses.addAll(config.getNetworkConfig().getJoin().getTcpIpConfig().getAddresses());
  return setPossibleAddresses;
}

Fixed version (ground truth):
private Collection<Address> getPossibleAddresses(){
  final Collection<String> possibleMembers=getMembers();
  final Set<Address> setPossibleAddresses=new HashSet<Address>();
  final Address thisAddress=node.address;
  for (  String host : possibleMembers) {
    try {
      final AddressHolder addressHolder=AddressUtil.getAddressHolder(host);
      final boolean portIsDefined=addressHolder.port != -1 || !config.isPortAutoIncrement();
      final int maxAddressTries=portIsDefined ? 1 : MAX_ADDRESS_TRIES;
      final int port=addressHolder.port != -1 ? addressHolder.port : config.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) {
          for (int i=0; i < maxAddressTries; i++) {
            final Address addressProper=new Address(matchedAddress,port + i);
            if (!addressProper.equals(thisAddress)) {
              setPossibleAddresses.add(addressProper);
            }
          }
        }
      }
 else {
        final InetAddress[] allAddresses=InetAddress.getAllByName(addressHolder.address);
        for (        final InetAddress inetAddress : allAddresses) {
          boolean matchingAddress=true;
          Interfaces interfaces=config.getNetworkConfig().getInterfaces();
          if (interfaces.isEnabled()) {
            matchingAddress=AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces());
          }
          if (matchingAddress) {
            for (int i=0; i < maxAddressTries; i++) {
              final Address addressProper=new Address(inetAddress,port + i);
              if (!addressProper.equals(thisAddress)) {
                setPossibleAddresses.add(addressProper);
              }
            }
          }
        }
      }
    }
 catch (    UnknownHostException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
  setPossibleAddresses.addAll(config.getNetworkConfig().getJoin().getTcpIpConfig().getAddresses());
  return setPossibleAddresses;
}