DBZ-362 Fix checkstyle whitespace violations

This commit is contained in:
Jiri Pechanec 2019-03-28 10:12:27 +01:00 committed by Gunnar Morling
parent 98f1124877
commit 5c490dc933
7 changed files with 44 additions and 44 deletions

View File

@ -39,7 +39,7 @@ class LcrEventHandler implements XStreamLCRCallbackHandler {
private final OracleOffsetContext offsetContext;
private final boolean tablenameCaseInsensitive;
public LcrEventHandler(ErrorHandler errorHandler, EventDispatcher<TableId> dispatcher, Clock clock, RelationalDatabaseSchema schema, OracleOffsetContext offsetContext,boolean tablenameCaseInsensitive) {
public LcrEventHandler(ErrorHandler errorHandler, EventDispatcher<TableId> dispatcher, Clock clock, RelationalDatabaseSchema schema, OracleOffsetContext offsetContext, boolean tablenameCaseInsensitive) {
this.errorHandler = errorHandler;
this.dispatcher = dispatcher;
this.clock = clock;

View File

@ -86,7 +86,7 @@ protected Set<TableId> getAllTableIds(SnapshotContext ctx) throws Exception {
@Override
protected void lockTablesForSchemaSnapshot(ChangeEventSourceContext sourceContext, SnapshotContext snapshotContext) throws SQLException, InterruptedException {
((OracleSnapshotContext)snapshotContext).preSchemaSnapshotSavepoint = jdbcConnection.connection().setSavepoint("dbz_schema_snapshot");
((OracleSnapshotContext) snapshotContext).preSchemaSnapshotSavepoint = jdbcConnection.connection().setSavepoint("dbz_schema_snapshot");
try (Statement statement = jdbcConnection.connection().createStatement()) {
for (TableId tableId : snapshotContext.capturedTables) {
@ -103,7 +103,7 @@ protected void lockTablesForSchemaSnapshot(ChangeEventSourceContext sourceContex
@Override
protected void releaseSchemaSnapshotLocks(SnapshotContext snapshotContext) throws SQLException {
jdbcConnection.connection().rollback(((OracleSnapshotContext)snapshotContext).preSchemaSnapshotSavepoint);
jdbcConnection.connection().rollback(((OracleSnapshotContext) snapshotContext).preSchemaSnapshotSavepoint);
}
@Override
@ -217,7 +217,7 @@ protected SchemaChangeEvent getCreateTableEvent(SnapshotContext snapshotContext,
}
Object res = rs.getObject(1);
String ddl = ((Clob)res).getSubString(1, (int) ((Clob)res).length());
String ddl = ((Clob) res).getSubString(1, (int) ((Clob) res).length());
return new SchemaChangeEvent(snapshotContext.offset.getPartition(), snapshotContext.offset.getOffset(), snapshotContext.catalogName,
table.id().schema(), ddl, table, SchemaChangeEventType.CREATE, true);

View File

@ -170,7 +170,7 @@ else if (width < 19) {
@Override
protected Object convertString(Column column, Field fieldDefn, Object data) {
if (data instanceof CHAR) {
return ((CHAR)data).stringValue();
return ((CHAR) data).stringValue();
}
return super.convertString(column, fieldDefn, data);
@ -180,7 +180,7 @@ protected Object convertString(Column column, Field fieldDefn, Object data) {
protected Object convertInteger(Column column, Field fieldDefn, Object data) {
if (data instanceof NUMBER) {
try {
data = ((NUMBER)data).intValue();
data = ((NUMBER) data).intValue();
}
catch (SQLException e) {
throw new RuntimeException("Couldn't convert value for column " + column.name(), e);
@ -196,11 +196,11 @@ protected Object convertFloat(Column column, Field fieldDefn, Object data) {
return data;
}
else if (data instanceof NUMBER) {
return ((NUMBER)data).floatValue();
return ((NUMBER) data).floatValue();
}
else if (data instanceof BINARY_FLOAT) {
try {
return ((BINARY_FLOAT)data).floatValue();
return ((BINARY_FLOAT) data).floatValue();
}
catch (SQLException e) {
throw new RuntimeException("Couldn't convert value for column " + column.name(), e);
@ -214,7 +214,7 @@ else if (data instanceof BINARY_FLOAT) {
protected Object convertDouble(Column column, Field fieldDefn, Object data) {
if (data instanceof BINARY_DOUBLE) {
try {
return ((BINARY_DOUBLE)data).doubleValue();
return ((BINARY_DOUBLE) data).doubleValue();
}
catch (SQLException e) {
throw new RuntimeException("Couldn't convert value for column " + column.name(), e);
@ -228,7 +228,7 @@ protected Object convertDouble(Column column, Field fieldDefn, Object data) {
protected Object convertDecimal(Column column, Field fieldDefn, Object data) {
if (data instanceof NUMBER) {
try {
data = ((NUMBER)data).bigDecimalValue();
data = ((NUMBER) data).bigDecimalValue();
}
catch (SQLException e) {
throw new RuntimeException("Couldn't convert value for column " + column.name(), e);
@ -260,7 +260,7 @@ protected Object convertNumeric(Column column, Field fieldDefn, Object data) {
protected Object convertNumericAsTinyInt(Column column, Field fieldDefn, Object data) {
if (data instanceof NUMBER) {
try {
data = ((NUMBER)data).byteValue();
data = ((NUMBER) data).byteValue();
}
catch (SQLException e) {
throw new RuntimeException("Couldn't convert value for column " + column.name(), e);
@ -273,7 +273,7 @@ protected Object convertNumericAsTinyInt(Column column, Field fieldDefn, Object
protected Object convertNumericAsSmallInt(Column column, Field fieldDefn, Object data) {
if (data instanceof NUMBER) {
try {
data = ((NUMBER)data).shortValue();
data = ((NUMBER) data).shortValue();
}
catch (SQLException e) {
throw new RuntimeException("Couldn't convert value for column " + column.name(), e);
@ -286,7 +286,7 @@ protected Object convertNumericAsSmallInt(Column column, Field fieldDefn, Object
protected Object convertNumericAsInteger(Column column, Field fieldDefn, Object data) {
if (data instanceof NUMBER) {
try {
data = ((NUMBER)data).intValue();
data = ((NUMBER) data).intValue();
}
catch (SQLException e) {
throw new RuntimeException("Couldn't convert value for column " + column.name(), e);
@ -299,7 +299,7 @@ protected Object convertNumericAsInteger(Column column, Field fieldDefn, Object
protected Object convertNumericAsBigInteger(Column column, Field fieldDefn, Object data) {
if (data instanceof NUMBER) {
try {
data = ((NUMBER)data).longValue();
data = ((NUMBER) data).longValue();
}
catch (SQLException e) {
throw new RuntimeException("Couldn't convert value for column " + column.name(), e);
@ -336,10 +336,10 @@ protected Object convertVariableScale(Column column, Field fieldDefn, Object dat
}
// TODO Need to handle special values, it is not supported in variable scale decimal
else if (data instanceof SpecialValueDecimal) {
return VariableScaleDecimal.fromLogical(fieldDefn.schema(), (SpecialValueDecimal)data);
return VariableScaleDecimal.fromLogical(fieldDefn.schema(), (SpecialValueDecimal) data);
}
else if (data instanceof BigDecimal) {
return VariableScaleDecimal.fromLogical(fieldDefn.schema(), new SpecialValueDecimal((BigDecimal)data));
return VariableScaleDecimal.fromLogical(fieldDefn.schema(), new SpecialValueDecimal((BigDecimal) data));
}
return handleUnknownData(column, fieldDefn, data);
}
@ -353,7 +353,7 @@ else if (data instanceof DATE) {
data = ((DATE) data).timestampValue();
}
else if (data instanceof TIMESTAMPTZ) {
final TIMESTAMPTZ ts = (TIMESTAMPTZ)data;
final TIMESTAMPTZ ts = (TIMESTAMPTZ) data;
data = ZonedDateTime.ofInstant(ts.timestampValue(connection.connection()).toInstant(), ts.getTimeZone().toZoneId());
}
else if (data instanceof TIMESTAMPLTZ) {

View File

@ -136,8 +136,8 @@ public abstract class AbstractOracleDatatypesTest extends AbstractConnectorTest
new SchemaAndValueField("VAL_NUMBER_4", Schema.OPTIONAL_INT16_SCHEMA, (short) 9999),
new SchemaAndValueField("VAL_NUMBER_9", Schema.OPTIONAL_INT32_SCHEMA, 9999_99999),
new SchemaAndValueField("VAL_NUMBER_18", Schema.OPTIONAL_INT64_SCHEMA, 999_99999_99999_99999L),
new SchemaAndValueField("VAL_NUMBER_2_NEGATIVE_SCALE", Schema.OPTIONAL_INT8_SCHEMA, (byte)90),
new SchemaAndValueField("VAL_NUMBER_4_NEGATIVE_SCALE", Schema.OPTIONAL_INT16_SCHEMA, (short)9900),
new SchemaAndValueField("VAL_NUMBER_2_NEGATIVE_SCALE", Schema.OPTIONAL_INT8_SCHEMA, (byte) 90),
new SchemaAndValueField("VAL_NUMBER_4_NEGATIVE_SCALE", Schema.OPTIONAL_INT16_SCHEMA, (short) 9900),
new SchemaAndValueField("VAL_NUMBER_9_NEGATIVE_SCALE", Schema.OPTIONAL_INT32_SCHEMA, 9999_99990),
new SchemaAndValueField("VAL_NUMBER_18_NEGATIVE_SCALE", Schema.OPTIONAL_INT64_SCHEMA, 999_99999_99999_99900L),
new SchemaAndValueField("VAL_DECIMAL", Schema.OPTIONAL_INT64_SCHEMA, 99999_99999L),
@ -231,7 +231,7 @@ public void stringTypes() throws Exception {
VerifyRecord.isValidRead(record, "ID", 1);
}
Struct after = (Struct) ((Struct)record.value()).get("after");
Struct after = (Struct) ((Struct) record.value()).get("after");
assertRecord(after, EXPECTED_STRING);
}
@ -262,7 +262,7 @@ public void fpTypes() throws Exception {
VerifyRecord.isValidRead(record, "ID", 1);
}
Struct after = (Struct) ((Struct)record.value()).get("after");
Struct after = (Struct) ((Struct) record.value()).get("after");
assertRecord(after, EXPECTED_FP);
}
@ -293,7 +293,7 @@ public void intTypes() throws Exception {
VerifyRecord.isValidRead(record, "ID", 1);
}
Struct after = (Struct) ((Struct)record.value()).get("after");
Struct after = (Struct) ((Struct) record.value()).get("after");
assertRecord(after, EXPECTED_INT);
}
@ -324,7 +324,7 @@ public void timeTypes() throws Exception {
VerifyRecord.isValidRead(record, "ID", 1);
}
Struct after = (Struct) ((Struct)record.value()).get("after");
Struct after = (Struct) ((Struct) record.value()).get("after");
assertRecord(after, EXPECTED_TIME);
}

View File

@ -134,7 +134,7 @@ public void shouldApplyWhitelistConfiguration() throws Exception {
assertThat(testTableRecords).hasSize(1);
VerifyRecord.isValidInsert(testTableRecords.get(0), "ID", 1);
Struct after = (Struct) ((Struct)testTableRecords.get(0).value()).get("after");
Struct after = (Struct) ((Struct) testTableRecords.get(0).value()).get("after");
assertThat(after.get("ID")).isEqualTo(1);
assertThat(after.get("NAME")).isEqualTo("Text-1");
@ -145,7 +145,7 @@ public void shouldApplyWhitelistConfiguration() throws Exception {
assertThat(testTableRecords).hasSize(1);
VerifyRecord.isValidInsert(testTableRecords.get(0), "ID", 3);
after = (Struct) ((Struct)testTableRecords.get(0).value()).get("after");
after = (Struct) ((Struct) testTableRecords.get(0).value()).get("after");
assertThat(after.get("ID")).isEqualTo(3);
assertThat(after.get("NAME")).isEqualTo("Text-3");
}
@ -186,7 +186,7 @@ public void shouldApplyBlacklistConfiguration() throws Exception {
assertThat(testTableRecords).hasSize(1);
VerifyRecord.isValidInsert(testTableRecords.get(0), "ID", 1);
Struct after = (Struct) ((Struct)testTableRecords.get(0).value()).get("after");
Struct after = (Struct) ((Struct) testTableRecords.get(0).value()).get("after");
assertThat(after.get("ID")).isEqualTo(1);
assertThat(after.get("NAME")).isEqualTo("Text-1");
@ -197,7 +197,7 @@ public void shouldApplyBlacklistConfiguration() throws Exception {
assertThat(testTableRecords).hasSize(1);
VerifyRecord.isValidInsert(testTableRecords.get(0), "ID", 3);
after = (Struct) ((Struct)testTableRecords.get(0).value()).get("after");
after = (Struct) ((Struct) testTableRecords.get(0).value()).get("after");
assertThat(after.get("ID")).isEqualTo(3);
assertThat(after.get("NAME")).isEqualTo("Text-3");
}

View File

@ -101,7 +101,7 @@ public void shouldTakeSnapshot() throws Exception {
// read
SourceRecord record1 = testTableRecords.get(0);
VerifyRecord.isValidRead(record1, "ID", 1);
Struct after = (Struct) ((Struct)record1.value()).get("after");
Struct after = (Struct) ((Struct) record1.value()).get("after");
assertThat(after.get("ID")).isEqualTo(1);
assertThat(after.get("NAME")).isEqualTo("Billie-Bob");
assertThat(after.get("SCORE")).isEqualTo(BigDecimal.valueOf(1234.56));
@ -110,12 +110,12 @@ public void shouldTakeSnapshot() throws Exception {
assertThat(record1.sourceOffset().get(SourceInfo.SNAPSHOT_KEY)).isEqualTo(true);
assertThat(record1.sourceOffset().get(SNAPSHOT_COMPLETED_KEY)).isEqualTo(false);
Struct source = (Struct) ((Struct)record1.value()).get("source");
Struct source = (Struct) ((Struct) record1.value()).get("source");
assertThat(source.get(SourceInfo.SNAPSHOT_KEY)).isEqualTo(true);
SourceRecord record2 = testTableRecords.get(1);
VerifyRecord.isValidRead(record2, "ID", 2);
after = (Struct) ((Struct)record2.value()).get("after");
after = (Struct) ((Struct) record2.value()).get("after");
assertThat(after.get("ID")).isEqualTo(2);
assertThat(after.get("NAME")).isEqualTo("Bruce");
assertThat(after.get("SCORE")).isEqualTo(BigDecimal.valueOf(2345.67));
@ -124,7 +124,7 @@ public void shouldTakeSnapshot() throws Exception {
assertThat(record2.sourceOffset().get(SourceInfo.SNAPSHOT_KEY)).isEqualTo(true);
assertThat(record2.sourceOffset().get(SNAPSHOT_COMPLETED_KEY)).isEqualTo(true);
source = (Struct) ((Struct)record2.value()).get("source");
source = (Struct) ((Struct) record2.value()).get("source");
assertThat(source.get(SourceInfo.SNAPSHOT_KEY)).isEqualTo(true);
}
@ -150,10 +150,10 @@ public void shouldContinueWithStreamingAfterSnapshot() throws Exception {
// read
SourceRecord record1 = testTableRecords.get(0);
VerifyRecord.isValidRead(record1, "ID", 1);
Struct after = (Struct) ((Struct)record1.value()).get("after");
Struct after = (Struct) ((Struct) record1.value()).get("after");
assertThat(after.get("ID")).isEqualTo(1);
Struct source = (Struct) ((Struct)record1.value()).get("source");
Struct source = (Struct) ((Struct) record1.value()).get("source");
assertThat(source.get(SourceInfo.SNAPSHOT_KEY)).isEqualTo(true);
assertThat(source.get(SourceInfo.SCN_KEY)).isNotNull();
assertThat(source.get(SourceInfo.SERVER_NAME_KEY)).isEqualTo("server1");
@ -166,7 +166,7 @@ public void shouldContinueWithStreamingAfterSnapshot() throws Exception {
SourceRecord record2 = testTableRecords.get(1);
VerifyRecord.isValidRead(record2, "ID", 2);
after = (Struct) ((Struct)record2.value()).get("after");
after = (Struct) ((Struct) record2.value()).get("after");
assertThat(after.get("ID")).isEqualTo(2);
assertThat(record2.sourceOffset().get(SourceInfo.SNAPSHOT_KEY)).isEqualTo(true);
@ -183,13 +183,13 @@ public void shouldContinueWithStreamingAfterSnapshot() throws Exception {
SourceRecord record3 = testTableRecords.get(0);
VerifyRecord.isValidInsert(record3, "ID", 3);
after = (Struct) ((Struct)record3.value()).get("after");
after = (Struct) ((Struct) record3.value()).get("after");
assertThat(after.get("ID")).isEqualTo(3);
assertThat(record3.sourceOffset().containsKey(SourceInfo.SNAPSHOT_KEY)).isFalse();
assertThat(record3.sourceOffset().containsKey(SNAPSHOT_COMPLETED_KEY)).isFalse();
source = (Struct) ((Struct)record3.value()).get("source");
source = (Struct) ((Struct) record3.value()).get("source");
assertThat(source.get(SourceInfo.SNAPSHOT_KEY)).isEqualTo(false);
assertThat(source.get(SourceInfo.SCN_KEY)).isNotNull();
assertThat(source.get(SourceInfo.SERVER_NAME_KEY)).isEqualTo("server1");
@ -235,7 +235,7 @@ public void shouldReadChangeStreamForExistingTable() throws Exception {
// insert
VerifyRecord.isValidInsert(testTableRecords.get(0), "ID", 1);
Struct after = (Struct) ((Struct)testTableRecords.get(0).value()).get("after");
Struct after = (Struct) ((Struct) testTableRecords.get(0).value()).get("after");
assertThat(after.get("ID")).isEqualTo(1);
assertThat(after.get("NAME")).isEqualTo("Billie-Bob");
assertThat(after.get("SCORE")).isEqualTo(BigDecimal.valueOf(1234.56));
@ -247,13 +247,13 @@ public void shouldReadChangeStreamForExistingTable() throws Exception {
// update
VerifyRecord.isValidUpdate(testTableRecords.get(1), "ID", 1);
Struct before = (Struct) ((Struct)testTableRecords.get(1).value()).get("before");
Struct before = (Struct) ((Struct) testTableRecords.get(1).value()).get("before");
assertThat(before.get("ID")).isEqualTo(1);
assertThat(before.get("NAME")).isEqualTo("Billie-Bob");
assertThat(before.get("SCORE")).isEqualTo(BigDecimal.valueOf(1234.56));
assertThat(before.get("REGISTERED")).isEqualTo(toMicroSecondsSinceEpoch(LocalDateTime.of(2018, 2, 22, 0, 0, 0)));
after = (Struct) ((Struct)testTableRecords.get(1).value()).get("after");
after = (Struct) ((Struct) testTableRecords.get(1).value()).get("after");
assertThat(after.get("ID")).isEqualTo(1);
assertThat(after.get("NAME")).isEqualTo("Bruce");
assertThat(after.get("SCORE")).isEqualTo(BigDecimal.valueOf(2345.67));
@ -261,7 +261,7 @@ public void shouldReadChangeStreamForExistingTable() throws Exception {
// update of PK
VerifyRecord.isValidDelete(testTableRecords.get(2), "ID", 1);
before = (Struct) ((Struct)testTableRecords.get(2).value()).get("before");
before = (Struct) ((Struct) testTableRecords.get(2).value()).get("before");
assertThat(before.get("ID")).isEqualTo(1);
assertThat(before.get("NAME")).isEqualTo("Bruce");
assertThat(before.get("SCORE")).isEqualTo(BigDecimal.valueOf(2345.67));
@ -270,7 +270,7 @@ public void shouldReadChangeStreamForExistingTable() throws Exception {
VerifyRecord.isValidTombstone(testTableRecords.get(3));
VerifyRecord.isValidInsert(testTableRecords.get(4), "ID", 2);
after = (Struct) ((Struct)testTableRecords.get(4).value()).get("after");
after = (Struct) ((Struct) testTableRecords.get(4).value()).get("after");
assertThat(after.get("ID")).isEqualTo(2);
assertThat(after.get("NAME")).isEqualTo("Bruce");
assertThat(after.get("SCORE")).isEqualTo(BigDecimal.valueOf(2345.67));
@ -278,7 +278,7 @@ public void shouldReadChangeStreamForExistingTable() throws Exception {
// delete
VerifyRecord.isValidDelete(testTableRecords.get(5), "ID", 2);
before = (Struct) ((Struct)testTableRecords.get(5).value()).get("before");
before = (Struct) ((Struct) testTableRecords.get(5).value()).get("before");
assertThat(before.get("ID")).isEqualTo(2);
assertThat(before.get("NAME")).isEqualTo("Bruce");
assertThat(before.get("SCORE")).isEqualTo(BigDecimal.valueOf(2345.67));
@ -321,7 +321,7 @@ public void shouldReadChangeStreamForTableCreatedWhileStreaming() throws Excepti
assertThat(testTableRecords).hasSize(1);
VerifyRecord.isValidInsert(testTableRecords.get(0), "ID", 2);
Struct after = (Struct) ((Struct)testTableRecords.get(0).value()).get("after");
Struct after = (Struct) ((Struct) testTableRecords.get(0).value()).get("after");
assertThat(after.get("ID")).isEqualTo(2);
assertThat(after.get("NAME")).isEqualTo("Billie-Bob");
assertThat(after.get("SCORE")).isEqualTo(BigDecimal.valueOf(1234.56));

View File

@ -4,7 +4,7 @@
<parent>
<groupId>io.debezium</groupId>
<artifactId>debezium-parent</artifactId>
<version>0.9.3.Final</version>
<version>0.9.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>