Source:
<code>public ProtocolVersion highestCommon(Collection<Node> nodes) { if (nodes == null || nodes.isEmpty()) { throw new IllegalArgumentException("Expected at least one node"); } SortedSet<CoreProtocolVersion> candidates = new TreeSet<>(); for (CoreProtocolVersion version : CoreProtocolVersion.values()) { if (!version.isBeta()) { candidates.add(version); } } for (Node node : nodes) { CassandraVersion cassandraVersion = node.getCassandraVersion(); if (cassandraVersion == null) { LOG.warn( "[{}] Node reports null Cassandra version, " + "ignoring it from optimal protocol version computation", logPrefix, node.getConnectAddress()); continue; } cassandraVersion = cassandraVersion.nextStable(); if (cassandraVersion.compareTo(CASSANDRA_210) < 0) { <START> throw new IllegalArgumentException( <END> String.format( "Node %s reports Cassandra version %s, " + "but the driver only supports 2.1.0 and above", node.getConnectAddress(), cassandraVersion)); } LOG.debug( "[{}] Node reports Cassandra version {}", logPrefix, node.getConnectAddress(), cassandraVersion); if (cassandraVersion.compareTo(CASSANDRA_220) < 0 && candidates.remove(CoreProtocolVersion.V4)) { LOG.debug("[{}] Excluding protocol V4", logPrefix); } } if (candidates.isEmpty()) { throw new IllegalArgumentException( String.format( "Could not determine a common protocol version, " + "enable DEBUG logs for '%s' for more details", LOG.getName())); } else { return candidates.last(); } }</code><technical_language>create a specific exception type for this case? In previous driver UnsupportedProtocolVersionException for this case</technical_language>

Target:
public ProtocolVersion highestCommon(Collection<Node> nodes) { if (nodes == null || nodes.isEmpty()) { throw new IllegalArgumentException("Expected at least one node"); } SortedSet<CoreProtocolVersion> candidates = new TreeSet<>(); for (CoreProtocolVersion version : CoreProtocolVersion.values()) { if (!version.isBeta()) { candidates.add(version); } } for (Node node : nodes) { CassandraVersion cassandraVersion = node.getCassandraVersion(); if (cassandraVersion == null) { LOG.warn( "[{}] Node reports null Cassandra version, " + "ignoring it from optimal protocol version computation", logPrefix, node.getConnectAddress()); continue; } cassandraVersion = cassandraVersion.nextStable(); if (cassandraVersion.compareTo(CASSANDRA_210) < 0) { throw new UnsupportedProtocolVersionException( node.getConnectAddress(), String.format( "Node %s reports Cassandra version %s, " + "but the driver only supports 2.1.0 and above", node.getConnectAddress(), cassandraVersion), ImmutableList.of(CoreProtocolVersion.V3, CoreProtocolVersion.V4)); } LOG.debug( "[{}] Node reports Cassandra version {}", logPrefix, node.getConnectAddress(), cassandraVersion); if (cassandraVersion.compareTo(CASSANDRA_220) < 0 && candidates.remove(CoreProtocolVersion.V4)) { LOG.debug("[{}] Excluding protocol V4", logPrefix); } } if (candidates.isEmpty()) { throw new UnsupportedProtocolVersionException( null, String.format( "Could not determine a common protocol version, " + "enable DEBUG logs for '%s' for more details", LOG.getName()), ImmutableList.of(CoreProtocolVersion.V3, CoreProtocolVersion.V4)); } else { return candidates.last(); } }