Skip to content

Commit 631a108

Browse files
authored
JAVA-2025: Include exception message in AbstractCollectionCodec.accepts(null) (apache#1122)
Improve AbstractCollectionCodec.accepts() to explicitly null check and raise an NPE with a similar message to TypeCodec.accepts().
1 parent 91c45ed commit 631a108

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

changelog/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Changelog
22

3+
### 3.7.0 (In progress)
4+
5+
- [improvement] JAVA-2025: Include exception message in AbstractCollectionCodec.accepts(null).
6+
7+
38
### 3.6.0
49

510
- [improvement] JAVA-1394: Add request-queue-depth metric.

driver-core/.attach_pid16614

Whitespace-only changes.

driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,6 +1850,7 @@ public C parse(String value) {
18501850

18511851
@Override
18521852
public boolean accepts(Object value) {
1853+
checkNotNull(value, "Parameter value cannot be null");
18531854
if (getJavaType().getRawType().isAssignableFrom(value.getClass())) {
18541855
// runtime type ok, now check element type
18551856
Collection<?> coll = (Collection<?>) value;

0 commit comments

Comments
 (0)