Elffuss BraidHub

kikocis/java-driver public

Have CodecNotFoundException implement copy() instead of changing the test.
Changeset86b23c4def3b38e8380341f77d3c0bb7f9a70f287caddd371946b8fd2fe60f94
Authorolim7t <omichallat+github@gmail.com> · 2016-04-19 18:58 +02:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2016-04-19 12:08 -05:00
Parents90868556be12

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/exceptions/CodecNotFoundException.java +11 −4
@@ -30,13 +30,15 @@
3030 private final TypeToken<?> javaType;
3131
3232 public CodecNotFoundException(String msg, DataType cqlType, TypeToken<?> javaType) {
33- super(msg);
34- this.cqlType = cqlType;
35- this.javaType = javaType;
33+ this(msg, null, cqlType, javaType);
3634 }
3735
3836 public CodecNotFoundException(Throwable cause, DataType cqlType, TypeToken<?> javaType) {
39- super(cause);
37+ this(null, cause, cqlType, javaType);
38+ }
39+
40+ private CodecNotFoundException(String msg, Throwable cause, DataType cqlType, TypeToken<?>javaType) {
41+ super(msg, cause);
4042 this.cqlType = cqlType;
4143 this.javaType = javaType;
4244 }
@@ -48,4 +50,9 @@
4850 public TypeToken<?> getJavaType() {
4951 return javaType;
5052 }
53+
54+ @Override
55+ public CodecNotFoundException copy() {
56+ return new CodecNotFoundException(getMessage(), getCause(), getCqlType(), getJavaType());
57+ }
5158 }