In driver 3.x, SettableByNameData used to set all occurrences of each variable:
This has changed in driver 4.x. SettableByName and SettableById implementations only set the first occurrence of each variable:
First off, this behavioral change is not mentioned in the upgrade guide.
Secondly, this change is concerning because there is no way to set the next occurrences of a given variable, apart from the very first one. If you don't know their indices, then you are stuck.
Thirdly, I don't really understand why we changed this behavior. Granted, it's not recommended to use the same bound variable name more than once, but this is perfectly valid CQL and supported by Cassandra. Moreover, ETL tools that generate queries can rely on this feature, e.g. to load one external value into two or more columns in a table, using a single query: INSERT INTO t1 (col1, col2) VALUES (:value, :value). This was perfectly possible with driver 3, but not possible with driver 4 anymore.
I would advocate to reinstate the original behavior. If this is not possible/desired, we need at least a way to access all the indices of a given variable name, i.e. implement an allIndicesOf(String) method in AccessibleByName and ColumnDefinitions, etc. (which of course is a breaking change).