Source:
<code>private int addRemoteCandidates( List<CandidatePacketExtension> candidates, boolean iceAgentStateIsRunning) { Collections.sort(candidates); int generation = iceAgent.getGeneration(); int remoteCandidateCount = 0; for (CandidatePacketExtension candidate : candidates) { if (candidate.getGeneration() != generation) continue; String address = candidate.getIP(); boolean needsResolution = !IPAddressUtil.isIPv4LiteralAddress(address) && !IPAddressUtil.isIPv6LiteralAddress(address); if (needsResolution && !Config.resolveRemoteCandidates()) { logger.debug(() -> "Ignoring remote candidate with non-literal address: " + address); continue; } Component component = iceStream.getComponent(candidate.getComponent()); String relAddr; int relPort; TransportAddress relatedAddress = null; if ((relAddr = candidate.getRelAddr()) != null && (relPort = candidate.getRelPort()) != -1) { boolean relAddrNeedsResolution = !IPAddressUtil.isIPv4LiteralAddress(relAddr) && !IPAddressUtil.isIPv6LiteralAddress(relAddr); if (relAddrNeedsResolution && !Config.resolveRemoteCandidates()) { logger.debug(() -> "Ignoring remote candidate with non-literal related address: " + address); <START> continue; <END> } relatedAddress = new TransportAddress( relAddr, relPort, Transport.parse(candidate.getProtocol())); } RemoteCandidate relatedCandidate = component.findRemoteCandidate(relatedAddress); RemoteCandidate remoteCandidate = new RemoteCandidate( new TransportAddress( candidate.getIP(), candidate.getPort(), Transport.parse(candidate.getProtocol())), component, org.ice4j.ice.CandidateType.parse( candidate.getType().toString()), candidate.getFoundation(), candidate.getPriority(), relatedCandidate); if (!TransportUtils.canReach(component, remoteCandidate)) { continue; } if (iceAgentStateIsRunning) { component.addUpdateRemoteCandidates(remoteCandidate); } else { component.addRemoteCandidate(remoteCandidate); } remoteCandidateCount++; } return remoteCandidateCount; }</code><technical_language>sense completely ignore a candidate a non-literal related address, opposed passing null for parameter? surprised if remote candidates' related addresses all. (That said, surprised a candidate IP literal for candidate, a hostname for related, this matter much.)</technical_language>

Target:
private int addRemoteCandidates( List<CandidatePacketExtension> candidates, boolean iceAgentStateIsRunning) { Collections.sort(candidates); int generation = iceAgent.getGeneration(); int remoteCandidateCount = 0; for (CandidatePacketExtension candidate : candidates) { if (candidate.getGeneration() != generation) continue; String address = candidate.getIP(); boolean needsResolution = !IPAddressUtil.isIPv4LiteralAddress(address) && !IPAddressUtil.isIPv6LiteralAddress(address); if (needsResolution && !Config.resolveRemoteCandidates()) { logger.debug(() -> "Ignoring remote candidate with non-literal address: " + address); continue; } Component component = iceStream.getComponent(candidate.getComponent()); RemoteCandidate remoteCandidate = new RemoteCandidate( new TransportAddress( candidate.getIP(), candidate.getPort(), Transport.parse(candidate.getProtocol())), component, org.ice4j.ice.CandidateType.parse( candidate.getType().toString()), candidate.getFoundation(), candidate.getPriority(), null); if (!TransportUtils.canReach(component, remoteCandidate)) { continue; } if (iceAgentStateIsRunning) { component.addUpdateRemoteCandidates(remoteCandidate); } else { component.addRemoteCandidate(remoteCandidate); } remoteCandidateCount++; } return remoteCandidateCount; }