spring-projects / spring-data-cassandra

Provides support to increase developer productivity in Java when using Apache Cassandra. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-cassandra/
Apache License 2.0
373 stars 307 forks source link

Assertion does not match its error message and comments for `QueryOptions.readTimeout` method #1494

Closed seungh0 closed 3 weeks ago

seungh0 commented 3 weeks ago

Hi there, I noticed a discrepancy between the comments and error messages in the QueryOptions.ReadTimeout method and the actual behavior of the code. I suggest allowing the code to accept 0 without raising an exception to handle disabling the timeout.

https://github.com/spring-projects/spring-data-cassandra/blob/100b267bf08ba5ae4c8e870147d5575bf32e3eea/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/QueryOptions.java#L540-L556

I've also submitted a PR to address this. I would appreciate it if you could review it.

Thank you.

mp911de commented 3 weeks ago

Good catch, I think we might have more places like that one. I'm going to have a look during the merge.