From 1f8021ef79a43a0a049c524abcd34c43645abcae Mon Sep 17 00:00:00 2001 From: Sualeh Fatehi Date: Sun, 23 Apr 2023 15:26:46 -0400 Subject: [PATCH] Code cleanup --- .../schemacrawler/crawl/DatabaseInfoRetriever.java | 1 - .../java/schemacrawler/crawl/RetrieverUtility.java | 14 +++++--------- .../schemacrawler/crawl/TableExtRetriever.java | 3 --- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/schemacrawler-api/src/main/java/schemacrawler/crawl/DatabaseInfoRetriever.java b/schemacrawler-api/src/main/java/schemacrawler/crawl/DatabaseInfoRetriever.java index 15fb1ed077..2069765b79 100644 --- a/schemacrawler-api/src/main/java/schemacrawler/crawl/DatabaseInfoRetriever.java +++ b/schemacrawler-api/src/main/java/schemacrawler/crawl/DatabaseInfoRetriever.java @@ -330,7 +330,6 @@ private Collection retrieveResultSetTypesProperties( Level.FINE, e.getCause(), new StringFormat("Could not execute method <%s>", methodName)); - continue; } } diff --git a/schemacrawler-api/src/main/java/schemacrawler/crawl/RetrieverUtility.java b/schemacrawler-api/src/main/java/schemacrawler/crawl/RetrieverUtility.java index 674bbb2d98..20d356e2c0 100644 --- a/schemacrawler-api/src/main/java/schemacrawler/crawl/RetrieverUtility.java +++ b/schemacrawler-api/src/main/java/schemacrawler/crawl/RetrieverUtility.java @@ -30,11 +30,9 @@ import static java.util.Objects.requireNonNull; import static us.fatehi.utility.Utility.isBlank; - import java.util.Optional; import java.util.logging.Level; import java.util.logging.Logger; - import schemacrawler.schema.Catalog; import schemacrawler.schema.Column; import schemacrawler.schema.Schema; @@ -52,11 +50,9 @@ static String constructForeignKeyName(final Table pkTable, final Table fkTable) requireNonNull(pkTable, "No referenced table provided"); requireNonNull(fkTable, "No referencing table provided"); - final String foreignKeyName = - String.format( - "SCHCRWLR_%1$08X_%2$08X", - fkTable.getFullName().hashCode(), pkTable.getFullName().hashCode()); - return foreignKeyName; + return String.format( + "SCHCRWLR_%1$08X_%2$08X", + fkTable.getFullName().hashCode(), pkTable.getFullName().hashCode()); } static Column lookupOrCreateColumn( @@ -78,9 +74,9 @@ static Column lookupOrCreateColumn( if (column == null) { // Create the table and column, but do not add it to the schema - final Table table = new TablePartial(schema, tableName); + final TablePartial table = new TablePartial(schema, tableName); column = new ColumnPartial(table, columnName); - ((TablePartial) table).addColumn(column); + table.addColumn(column); LOGGER.log( Level.FINER, diff --git a/schemacrawler-api/src/main/java/schemacrawler/crawl/TableExtRetriever.java b/schemacrawler-api/src/main/java/schemacrawler/crawl/TableExtRetriever.java index 51c17922de..67dca23e2d 100644 --- a/schemacrawler-api/src/main/java/schemacrawler/crawl/TableExtRetriever.java +++ b/schemacrawler-api/src/main/java/schemacrawler/crawl/TableExtRetriever.java @@ -35,14 +35,12 @@ import static schemacrawler.schemacrawler.InformationSchemaKey.TRIGGERS; import static schemacrawler.schemacrawler.InformationSchemaKey.VIEWS; import static schemacrawler.schemacrawler.InformationSchemaKey.VIEW_TABLE_USAGE; - import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import java.util.Optional; import java.util.logging.Level; import java.util.logging.Logger; - import schemacrawler.plugin.EnumDataTypeHelper; import schemacrawler.plugin.EnumDataTypeInfo; import schemacrawler.schema.ActionOrientationType; @@ -112,7 +110,6 @@ void retrieveAdditionalColumnAttributes() throws SQLException { new StringFormat( "Cannot find column <%s.%s.%s.%s>", catalogName, schemaName, tableName, columnName)); - continue; } else { final MutableColumn column = columnOptional.get(); column.addAttributes(results.getAttributes());