@@ -174,8 +174,9 @@ private void connectForeignKeysRemoteTable(Database db, RemoteTable remoteTable,
174
174
} catch (SQLException sqlExc ) {
175
175
if (!remoteTable .isLogical ()) {
176
176
// if explicitly asking for these details then propagate the exception
177
- if (multiSchemas )
177
+ if (multiSchemas ) {
178
178
throw sqlExc ;
179
+ }
179
180
180
181
// otherwise just report the fact that we tried & couldn't
181
182
LOGGER .warn ("Couldn't resolve foreign keys for remote table '{}'" , remoteTable .getFullName (), sqlExc );
@@ -262,8 +263,9 @@ private boolean shouldExclude(String databaseName, ImportForeignKey foreignKey)
262
263
* @return int
263
264
*/
264
265
protected long fetchNumRows (Database db , Table table ) {
265
- if (table .isView () || table .isRemote ())
266
+ if (table .isView () || table .isRemote ()) {
266
267
return -1 ;
268
+ }
267
269
268
270
SQLException originalFailure = null ;
269
271
@@ -289,8 +291,9 @@ protected long fetchNumRows(Database db, Table table) {
289
291
return fetchNumRows (db , table , "count(1)" , false );
290
292
} catch (SQLException try3Exception ) {
291
293
if (!table .isLogical ()) {
292
- if (originalFailure != null )
294
+ if (originalFailure != null ) {
293
295
LOGGER .warn ("Failed to fetch number of rows for '{}' using custom query: '{}'" , table .getFullName (), sql , originalFailure );
296
+ }
294
297
LOGGER .warn ("Failed to fetch number of rows for '{}' using built-in query with 'count(*)'" , table .getFullName (), try2Exception );
295
298
LOGGER .warn ("Failed to fetch number of rows for '{}' using built-in query with 'count(1)'" , table .getFullName (), try3Exception );
296
299
}
@@ -330,8 +333,9 @@ protected long fetchNumRows(Database db, Table table, String clause, boolean for
330
333
}
331
334
return -1 ;
332
335
} catch (SQLException exc ) {
333
- if (forceQuotes ) // we tried with and w/o quotes...fail this attempt
336
+ if (forceQuotes ) { // we tried with and w/o quotes...fail this attempt
334
337
throw exc ;
338
+ }
335
339
336
340
return fetchNumRows (db , table , clause , true );
337
341
}
@@ -355,9 +359,9 @@ private Table addRemoteTable(Database db, RemoteTableIdentifier remoteTableIdent
355
359
if (remoteTable == null ) {
356
360
LOGGER .debug ("Creating remote table {}" , fullName );
357
361
358
- if (logical )
362
+ if (logical ) {
359
363
remoteTable = new LogicalRemoteTable (db , remoteTableIdentifier , baseContainer );
360
- else {
364
+ } else {
361
365
remoteTable = new RemoteTable (db , remoteTableIdentifier , baseContainer );
362
366
columnService .gatherColumns (remoteTable );
363
367
}
@@ -472,8 +476,9 @@ public void gatherTableIds(Database db) throws SQLException {
472
476
while (rs .next ()) {
473
477
String tableName = rs .getString (TABLE_NAME );
474
478
Table table = db .getLocals ().get (tableName );
475
- if (table != null )
479
+ if (table != null ) {
476
480
table .setId (rs .getObject ("table_id" ));
481
+ }
477
482
}
478
483
} catch (SQLException sqlException ) {
479
484
LOGGER .warn ("Failed to fetch table ids using SQL '{}'" , sql , sqlException );
@@ -496,8 +501,9 @@ public void gatherTableComments(Database db) {
496
501
while (rs .next ()) {
497
502
String tableName = rs .getString (TABLE_NAME );
498
503
Table table = db .getLocals ().get (tableName );
499
- if (table != null )
504
+ if (table != null ) {
500
505
table .setComments (rs .getString ("comments" ));
506
+ }
501
507
}
502
508
} catch (SQLException sqlException ) {
503
509
// don't die just because this failed
@@ -523,8 +529,9 @@ public void gatherTableColumnComments(Database db) {
523
529
Table table = db .getLocals ().get (tableName );
524
530
if (table != null ) {
525
531
TableColumn column = table .getColumn (rs .getString (COLUMN_NAME ));
526
- if (column != null )
532
+ if (column != null ) {
527
533
column .setComments (rs .getString (COMMENTS ));
534
+ }
528
535
}
529
536
}
530
537
} catch (SQLException sqlException ) {
0 commit comments