Skip to content

Commit 6fc500f

Browse files
committed
Put all warning messages in constants
1 parent 577b264 commit 6fc500f

21 files changed

+273
-74
lines changed

Diff for: src/main/java/com/ing/data/cassandra/jdbc/CassandraConnection.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@
6363
import static com.ing.data.cassandra.jdbc.utils.DriverUtil.toStringWithoutSensitiveValues;
6464
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.ALWAYS_AUTOCOMMIT;
6565
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.BAD_TIMEOUT;
66-
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.INVALID_FETCH_SIZE_PARAMETER;
67-
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.INVALID_PROFILE_NAME;
6866
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.NO_TRANSACTIONS;
6967
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.WAS_CLOSED_CONN;
7068
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.PROTOCOL;
@@ -77,6 +75,8 @@
7775
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.TAG_SERIAL_CONSISTENCY_LEVEL;
7876
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.TAG_USER;
7977
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.createSubName;
78+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.INVALID_FETCH_SIZE_PARAMETER;
79+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.INVALID_PROFILE_NAME;
8080

8181
/**
8282
* Cassandra connection: implementation class for {@link Connection} to create a JDBC connection to a Cassandra
@@ -183,7 +183,7 @@ public class CassandraConnection extends AbstractConnection implements Connectio
183183
this.defaultFetchSize = Integer.parseInt(fetchSizeParameter);
184184
}
185185
} catch (final NumberFormatException e) {
186-
LOG.warn(String.format(INVALID_FETCH_SIZE_PARAMETER, fetchSizeParameter, fetchSizeFromProfile));
186+
LOG.warn(INVALID_FETCH_SIZE_PARAMETER, fetchSizeParameter, fetchSizeFromProfile);
187187
this.defaultFetchSize = fetchSizeFromProfile;
188188
}
189189

@@ -724,7 +724,7 @@ public void setActiveExecutionProfile(final String profile) {
724724
this.activeExecutionProfile = this.cSession.getContext().getConfig().getProfile(profile);
725725
this.lastUsedExecutionProfile = currentProfile;
726726
} catch (final IllegalArgumentException e) {
727-
LOG.warn(String.format(INVALID_PROFILE_NAME, profile));
727+
LOG.warn(INVALID_PROFILE_NAME, profile);
728728
if (this.activeExecutionProfile == null) {
729729
this.activeExecutionProfile = this.cSession.getContext().getConfig().getDefaultProfile();
730730
}

Diff for: src/main/java/com/ing/data/cassandra/jdbc/CassandraDriver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import static com.ing.data.cassandra.jdbc.utils.DriverUtil.safeParseVersion;
4444
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.CONNECTION_CREATION_FAILED;
4545
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.NOT_SUPPORTED;
46-
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.PROPERTIES_PARSING_FROM_URL_FAILED;
4746
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.PROTOCOL;
4847
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.TAG_ACTIVE_PROFILE;
4948
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.TAG_AWS_REGION;
@@ -73,6 +72,7 @@
7372
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.TAG_USE_KERBEROS;
7473
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.TAG_USE_SIG_V4;
7574
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.parseURL;
75+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.PROPERTIES_PARSING_FROM_URL_FAILED;
7676

7777
/**
7878
* The Cassandra driver implementation.

Diff for: src/main/java/com/ing/data/cassandra/jdbc/CassandraPreparedStatement.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
import java.time.OffsetTime;
7171
import java.util.ArrayList;
7272
import java.util.Calendar;
73-
import java.util.Collections;
7473
import java.util.HashMap;
7574
import java.util.List;
7675
import java.util.Map;
@@ -92,6 +91,8 @@
9291
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.UNSUPPORTED_JDBC_TYPE;
9392
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.VECTOR_ELEMENTS_NOT_NUMBERS;
9493
import static com.ing.data.cassandra.jdbc.utils.JsonUtil.getObjectMapper;
94+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.INVALID_ARRAY_IMPLEMENTATION;
95+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.PREPARED_STATEMENT_CLOSING_FAILED;
9596
import static java.util.Collections.emptyList;
9697

9798
/**
@@ -211,7 +212,7 @@ public void close() {
211212
try {
212213
this.connection.removeStatement(this);
213214
} catch (final Exception e) {
214-
LOG.warn("Unable to close the prepared statement: {}", e.getMessage());
215+
LOG.warn(PREPARED_STATEMENT_CLOSING_FAILED, e.getMessage());
215216
}
216217
}
217218

@@ -378,8 +379,7 @@ public void setArray(final int parameterIndex, final Array x) throws SQLExceptio
378379
} else if (x instanceof ArrayImpl) {
379380
this.setObject(parameterIndex, ((ArrayImpl) x).toList());
380381
} else {
381-
LOG.warn("Unsupported SQL Array implementation: {}, an empty list will be inserted.",
382-
x.getClass().getName());
382+
LOG.warn(INVALID_ARRAY_IMPLEMENTATION, x.getClass().getName());
383383
this.setObject(parameterIndex, emptyList());
384384
}
385385
}

Diff for: src/main/java/com/ing/data/cassandra/jdbc/CassandraResultSet.java

+9-6
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@
112112
import static com.ing.data.cassandra.jdbc.utils.JsonUtil.getObjectMapper;
113113
import static com.ing.data.cassandra.jdbc.utils.UdtUtil.udtValueUsingFormattedContents;
114114
import static com.ing.data.cassandra.jdbc.utils.UdtUtil.udtValuesUsingFormattedContents;
115+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.GET_LIST_FAILED;
116+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.GET_SET_FAILED;
117+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.GET_VECTOR_FAILED;
115118

116119
/**
117120
* Cassandra result set: implementation class for {@link java.sql.ResultSet}.
@@ -791,7 +794,7 @@ public List<?> getList(final int columnIndex) throws SQLException {
791794
}
792795
return new ArrayList<>(resultList);
793796
} catch (final ClassNotFoundException e) {
794-
LOG.warn("Error while executing getList()", e);
797+
LOG.warn(GET_LIST_FAILED, e);
795798
}
796799
}
797800
return this.currentRow.getList(columnIndex - 1, String.class);
@@ -811,7 +814,7 @@ public List<?> getList(final String columnLabel) throws SQLException {
811814
}
812815
return new ArrayList<>(resultList);
813816
} catch (final ClassNotFoundException e) {
814-
LOG.warn("Error while executing getList()", e);
817+
LOG.warn(GET_LIST_FAILED, e);
815818
}
816819
}
817820
return this.currentRow.getList(columnLabel, String.class);
@@ -1364,7 +1367,7 @@ public Set<?> getSet(final int columnIndex) throws SQLException {
13641367
return this.currentRow.getSet(columnIndex - 1,
13651368
Class.forName(fromDataType(setType.getElementType()).asJavaClass().getCanonicalName()));
13661369
} catch (ClassNotFoundException e) {
1367-
LOG.warn("Error while executing getSet()", e);
1370+
LOG.warn(GET_SET_FAILED, e);
13681371
}
13691372
return null;
13701373
}
@@ -1377,7 +1380,7 @@ public Set<?> getSet(final String columnLabel) throws SQLException {
13771380
return this.currentRow.getSet(columnLabel,
13781381
Class.forName(fromDataType(setType.getElementType()).asJavaClass().getCanonicalName()));
13791382
} catch (ClassNotFoundException e) {
1380-
LOG.warn("Error while executing getSet()", e);
1383+
LOG.warn(GET_SET_FAILED, e);
13811384
}
13821385
return null;
13831386
}
@@ -1540,7 +1543,7 @@ public CqlVector<?> getVector(final int columnIndex) throws SQLException {
15401543
throw new SQLException(VECTOR_ELEMENTS_NOT_NUMBERS);
15411544
}
15421545
} catch (ClassNotFoundException e) {
1543-
LOG.warn("Error while executing getSet()", e);
1546+
LOG.warn(GET_VECTOR_FAILED, e);
15441547
}
15451548
return null;
15461549
}
@@ -1558,7 +1561,7 @@ public CqlVector<?> getVector(final String columnLabel) throws SQLException {
15581561
throw new SQLException(VECTOR_ELEMENTS_NOT_NUMBERS);
15591562
}
15601563
} catch (ClassNotFoundException e) {
1561-
LOG.warn("Error while executing getVector()", e);
1564+
LOG.warn(GET_VECTOR_FAILED, e);
15621565
}
15631566
return null;
15641567
}

Diff for: src/main/java/com/ing/data/cassandra/jdbc/SessionHolder.java

+8-5
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.TAG_USE_SIG_V4;
9393
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.parseReconnectionPolicy;
9494
import static com.ing.data.cassandra.jdbc.utils.JdbcUrlUtil.parseURL;
95+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.CONFIGURATION_FILE_NOT_FOUND;
96+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.PARAMETER_PARSING_FAILED;
9597

9698
/**
9799
* Holds a {@link Session} shared among multiple {@link CassandraConnection} objects.
@@ -100,6 +102,7 @@
100102
* the last {@link CassandraConnection} has been closed, the {@code Session} is closed.
101103
* </p>
102104
*/
105+
@SuppressWarnings("LoggingSimilarMessage")
103106
class SessionHolder {
104107
static final String URL_KEY = "jdbcUrl";
105108

@@ -215,7 +218,7 @@ private Session createSession(final Properties properties) throws SQLException {
215218
LOG.info("The configuration file {} will be used and will override the parameters defined into the "
216219
+ "JDBC URL except contact points and keyspace.", configurationFilePath);
217220
} else {
218-
LOG.warn("The configuration file {} cannot be found, it will be ignored.", configurationFilePath);
221+
LOG.warn(CONFIGURATION_FILE_NOT_FOUND, configurationFilePath);
219222
}
220223
}
221224

@@ -305,8 +308,8 @@ private Session createSession(final Properties properties) throws SQLException {
305308
if (debugMode) {
306309
throw new SQLNonTransientConnectionException(e);
307310
}
308-
LOG.warn("Error occurred while parsing load balancing policy: {} / Forcing to "
309-
+ "DefaultLoadBalancingPolicy...", e.getMessage());
311+
LOG.warn(PARAMETER_PARSING_FAILED, "load balancing policy", e.getMessage(),
312+
"Forcing to DefaultLoadBalancingPolicy");
310313
driverConfigLoaderBuilder.withString(DefaultDriverOption.LOAD_BALANCING_POLICY_CLASS,
311314
DefaultLoadBalancingPolicy.class.getSimpleName());
312315
}
@@ -320,7 +323,7 @@ private Session createSession(final Properties properties) throws SQLException {
320323
if (debugMode) {
321324
throw new SQLNonTransientConnectionException(e);
322325
}
323-
LOG.warn("Error occurred while parsing retry policy: {} / skipping...", e.getMessage());
326+
LOG.warn(PARAMETER_PARSING_FAILED, "retry policy", e.getMessage(), "skipping");
324327
}
325328
}
326329

@@ -344,7 +347,7 @@ private Session createSession(final Properties properties) throws SQLException {
344347
if (debugMode) {
345348
throw new SQLNonTransientConnectionException(e);
346349
}
347-
LOG.warn("Error occurred while parsing reconnection policy: {} / skipping...", e.getMessage());
350+
LOG.warn(PARAMETER_PARSING_FAILED, "reconnection policy", e.getMessage(), "skipping");
348351
}
349352
}
350353

Diff for: src/main/java/com/ing/data/cassandra/jdbc/commands/AbstractCopyCommandExecutor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import static com.ing.data.cassandra.jdbc.commands.SpecialCommandsUtil.buildSpecialCommandResultSet;
3838
import static com.ing.data.cassandra.jdbc.utils.ByteBufferUtil.bytes;
3939
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.UNSUPPORTED_COPY_OPTIONS;
40+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.INVALID_OPTION_VALUE;
4041
import static org.apache.commons.lang3.StringUtils.EMPTY;
4142

4243
/**
@@ -135,8 +136,7 @@ int getOptionValueAsInt(final String optionName, final int defaultValue) {
135136
try {
136137
return Integer.parseInt(optionValue);
137138
} catch (final NumberFormatException e) {
138-
LOG.warn("Invalid value for option {}: {}. Will use the default value: {}.",
139-
optionName, optionValue, defaultValue);
139+
LOG.warn(INVALID_OPTION_VALUE, optionName, optionValue, defaultValue);
140140
}
141141
}
142142
return defaultValue;

Diff for: src/main/java/com/ing/data/cassandra/jdbc/commands/CopyFromCommandExecutor.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.COLUMN_DEFINITIONS_RETRIEVAL_FAILED;
5858
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.CSV_FILE_NOT_FOUND;
5959
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.MISSING_COLUMN_DEFINITIONS;
60+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.ADD_STATEMENT_TO_BATCH_FAILED;
61+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.PARSING_VALUE_FAILED;
6062
import static org.apache.commons.lang3.StringUtils.EMPTY;
6163
import static org.apache.commons.lang3.StringUtils.wrap;
6264

@@ -333,7 +335,7 @@ private void handleValuesToInsert(final CassandraStatement statement,
333335
LOG.trace("Added to batch: {}", cql);
334336
}
335337
} catch (final SQLException e) {
336-
LOG.warn("Failed to add statement to the batch: {}", cql, e);
338+
LOG.warn(ADD_STATEMENT_TO_BATCH_FAILED, cql, e);
337339
}
338340
}
339341

@@ -345,7 +347,7 @@ private String handleNumberValue(final String strValue) {
345347
final Number number = this.decimalFormat.parse(strValue.trim());
346348
return number.toString();
347349
} catch (final ParseException e) {
348-
LOG.warn("Failed to parse and convert value: {}, the value will be ignored.", strValue);
350+
LOG.warn(PARSING_VALUE_FAILED, strValue);
349351
}
350352
return null;
351353
}

Diff for: src/main/java/com/ing/data/cassandra/jdbc/commands/CopyToCommandExecutor.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import static com.ing.data.cassandra.jdbc.commands.SpecialCommandsUtil.LOG;
4848
import static com.ing.data.cassandra.jdbc.commands.SpecialCommandsUtil.translateFilename;
4949
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.CANNOT_WRITE_CSV_FILE;
50+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.COUNTING_EXPORTED_ROWS_FAILED;
5051
import static org.apache.commons.lang3.StringUtils.EMPTY;
5152
import static org.apache.commons.lang3.time.TimeZones.GMT;
5253

@@ -203,7 +204,7 @@ public ResultSet execute(final CassandraStatement statement, final String cql) t
203204
try (Stream<String> csvLines = Files.lines(targetPath)) {
204205
exportedRows += csvLines.count();
205206
} catch (final IOException e) {
206-
LOG.warn("Failed to read exported CSV file to count exportedRows.");
207+
LOG.warn(COUNTING_EXPORTED_ROWS_FAILED);
207208
}
208209
return buildCopyCommandResultSet("exported to", exportedRows, 1, -1);
209210
}

Diff for: src/main/java/com/ing/data/cassandra/jdbc/metadata/ColumnMetadataResultSetBuilder.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import static com.ing.data.cassandra.jdbc.ColumnDefinitions.Definition.buildDefinitionInAnonymousTable;
3434
import static com.ing.data.cassandra.jdbc.types.AbstractJdbcType.DEFAULT_PRECISION;
3535
import static com.ing.data.cassandra.jdbc.types.TypesMap.getTypeForComparator;
36+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.JDBC_TYPE_NOT_FOUND_FOR_CQL_TYPE;
3637

3738
/**
3839
* Utility class building metadata result sets ({@link CassandraMetadataResultSet} objects) related to columns.
@@ -193,8 +194,7 @@ public CassandraMetadataResultSet buildColumns(final String schemaPattern,
193194
jdbcType = getTypeForComparator(columnMetadata.getType().toString())
194195
.getJdbcType();
195196
} catch (final Exception e) {
196-
LOG.warn("Unable to get JDBC type for comparator [{}]: {}",
197-
columnMetadata.getType(), e.getMessage());
197+
LOG.warn(JDBC_TYPE_NOT_FOUND_FOR_CQL_TYPE, columnMetadata.getType(), e.getMessage());
198198
}
199199

200200
final MetadataRow row = new MetadataRow().withTemplate(rowTemplate,

Diff for: src/main/java/com/ing/data/cassandra/jdbc/metadata/MetadataRow.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@
3939

4040
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.UNABLE_TO_POPULATE_METADATA_ROW;
4141
import static com.ing.data.cassandra.jdbc.utils.ErrorConstants.VALID_LABELS;
42+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.INVALID_CAST;
4243

4344
/**
4445
* The content of a metadata row returned in a {@link CassandraMetadataResultSet}.
4546
*/
46-
@SuppressWarnings("unused")
47+
@SuppressWarnings({"unused", "LoggingSimilarMessage"})
4748
public class MetadataRow {
4849

4950
private static final Logger LOG = LoggerFactory.getLogger(MetadataRow.class);
@@ -153,7 +154,7 @@ public boolean getBool(final int i) {
153154
try {
154155
return (Boolean) entryValue;
155156
} catch (final ClassCastException e) {
156-
LOG.warn("Unable to cast [{}] (index {}) as boolean, it will return false.", entryValue, i);
157+
LOG.warn(INVALID_CAST, entryValue, i, "boolean", Boolean.FALSE);
157158
return false;
158159
}
159160
}
@@ -184,7 +185,7 @@ public byte getByte(final int i) {
184185
try {
185186
return (byte) entryValue;
186187
} catch (final ClassCastException e) {
187-
LOG.warn("Unable to cast [{}] (index {}) as byte, it will return 0.", entryValue, i);
188+
LOG.warn(INVALID_CAST, entryValue, i, "byte", 0);
188189
return 0;
189190
}
190191
}
@@ -215,7 +216,7 @@ public short getShort(final int i) {
215216
try {
216217
return (short) entryValue;
217218
} catch (final ClassCastException e) {
218-
LOG.warn("Unable to cast [{}] (index {}) as short, it will return 0.", entryValue, i);
219+
LOG.warn(INVALID_CAST, entryValue, i, "short", 0);
219220
return 0;
220221
}
221222
}
@@ -246,7 +247,7 @@ public int getInt(final int i) {
246247
try {
247248
return (int) entryValue;
248249
} catch (final ClassCastException e) {
249-
LOG.warn("Unable to cast [{}] (index {}) as integer, it will return 0.", entryValue, i);
250+
LOG.warn(INVALID_CAST, entryValue, i, "integer", 0);
250251
return 0;
251252
}
252253
}
@@ -277,7 +278,7 @@ public long getLong(final int i) {
277278
try {
278279
return (long) entryValue;
279280
} catch (final ClassCastException e) {
280-
LOG.warn("Unable to cast [{}] (index {}) as long, it will return 0.", entryValue, i);
281+
LOG.warn(INVALID_CAST, entryValue, i, "long", 0);
281282
return 0;
282283
}
283284
}

Diff for: src/main/java/com/ing/data/cassandra/jdbc/metadata/TableMetadataResultSetBuilder.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import static com.ing.data.cassandra.jdbc.ColumnDefinitions.Definition.buildDefinitionInAnonymousTable;
3636
import static com.ing.data.cassandra.jdbc.types.AbstractJdbcType.DEFAULT_PRECISION;
3737
import static com.ing.data.cassandra.jdbc.types.TypesMap.getTypeForComparator;
38+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.JDBC_TYPE_NOT_FOUND_FOR_CQL_TYPE;
3839
import static java.sql.DatabaseMetaData.bestRowNotPseudo;
3940

4041
/**
@@ -415,8 +416,7 @@ public CassandraMetadataResultSet buildBestRowIdentifier(final String schema, fi
415416
try {
416417
jdbcType = getTypeForComparator(columnMetadata.getType().toString()).getJdbcType();
417418
} catch (final Exception e) {
418-
LOG.warn("Unable to get JDBC type for comparator [{}]: {}",
419-
columnMetadata.getType(), e.getMessage());
419+
LOG.warn(JDBC_TYPE_NOT_FOUND_FOR_CQL_TYPE, columnMetadata.getType(), e.getMessage());
420420
}
421421

422422
final MetadataRow row = new MetadataRow().withTemplate(rowTemplate,

Diff for: src/main/java/com/ing/data/cassandra/jdbc/metadata/TypeMetadataResultSetBuilder.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import static com.ing.data.cassandra.jdbc.types.TypesMap.getTypeForComparator;
4646
import static com.ing.data.cassandra.jdbc.utils.DriverUtil.SINGLE_QUOTE;
4747
import static com.ing.data.cassandra.jdbc.utils.DriverUtil.existsInDatabaseVersion;
48+
import static com.ing.data.cassandra.jdbc.utils.WarningConstants.JDBC_TYPE_NOT_FOUND_FOR_CQL_TYPE;
4849
import static java.sql.DatabaseMetaData.typeNullable;
4950
import static java.sql.DatabaseMetaData.typePredBasic;
5051
import static java.sql.Types.JAVA_OBJECT;
@@ -431,7 +432,7 @@ public CassandraMetadataResultSet buildAttributes(final String schemaPattern, fi
431432
try {
432433
jdbcType = getTypeForComparator(attrType.toString()).getJdbcType();
433434
} catch (final Exception e) {
434-
LOG.warn("Unable to get JDBC type for comparator [{}]: {}", attrType, e.getMessage());
435+
LOG.warn(JDBC_TYPE_NOT_FOUND_FOR_CQL_TYPE, attrType, e.getMessage());
435436
}
436437

437438
final MetadataRow row = new MetadataRow().withTemplate(rowTemplate,

0 commit comments

Comments
 (0)