From 6342442ae34a7be2297d1a23ac7620be42718a00 Mon Sep 17 00:00:00 2001 From: Nikolaus Krismer <niko@krismer.de> Date: Wed, 19 Mar 2014 16:12:29 +0100 Subject: [PATCH] minor code formatting --- .../java/it/unibz/inf/isoga/db/DbUtility.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/main/java/it/unibz/inf/isoga/db/DbUtility.java b/src/main/java/it/unibz/inf/isoga/db/DbUtility.java index 166aae8c..517b2523 100644 --- a/src/main/java/it/unibz/inf/isoga/db/DbUtility.java +++ b/src/main/java/it/unibz/inf/isoga/db/DbUtility.java @@ -85,8 +85,7 @@ public final class DbUtility { } public static void createSpatialIndex(final Connection connection, final TableEntry tableEntry) { - executeStatement(connection, "CREATE INDEX " + tableEntry.getIndexName() + " ON " + tableEntry.getTableName() - + " USING GIST(\"GEOMETRY\")"); + executeStatement(connection, "CREATE INDEX " + tableEntry.getIndexName() + " ON " + tableEntry.getTableName() + " USING GIST(\"GEOMETRY\")"); } public static boolean dropTablesByRegexp(final Connection connection, final String regex) { @@ -130,24 +129,20 @@ public final class DbUtility { } public static void createVertexAnnotationTable(final Connection connection, final String tableName) { - executeStatement(connection, "CREATE TABLE " + tableName - + " (\"ID\" integer NOT NULL, \"ROUTE_ID\" smallint,\"TIME_A\" integer,\"TIME_D\" integer)"); + executeStatement(connection, "CREATE TABLE " + tableName + " (\"ID\" integer NOT NULL, \"ROUTE_ID\" smallint,\"TIME_A\" integer,\"TIME_D\" integer)"); } public static void createTargetVertexTable(final Connection connection, final String tableName) { - executeStatement(connection, "CREATE TABLE " + tableName - + " (\"ID\" integer NOT NULL, \"DISTANCE\" double precision, \"ROUTE_ID\" smallint, \"STATE\" VARCHAR(7), \"T_TYPE\" smallint)"); + executeStatement(connection, "CREATE TABLE " + tableName + " (\"ID\" integer NOT NULL, \"DISTANCE\" double precision, \"ROUTE_ID\" smallint, \"STATE\" VARCHAR(7), \"T_TYPE\" smallint)"); } public static void createTargetBufferTable(final Connection connection, final String tableName) { - executeStatement(connection, "CREATE TABLE " + tableName - + " (\"ID\" integer NOT NULL, CONSTRAINT pkey_" + tableName - + " PRIMARY KEY (\"ID\"))"); + executeStatement(connection, "CREATE TABLE " + tableName + " (\"ID\" integer NOT NULL, CONSTRAINT pkey_" + tableName + " PRIMARY KEY (\"ID\"))"); } public static ResponsePoiFeature getPoiFeatures(final String sqlExpr, final ConfigDataset config) { final ResponsePoiFeature result = new ResponsePoiFeature(); - if (sqlExpr.equals("noResult")) { + if ("noResult".equals(sqlExpr)) { result.setType("invalid"); return result; } @@ -180,7 +175,6 @@ public final class DbUtility { } public static ResponseWps spatialIntersection2JSON(final String sqlExpr, final SqlQuery query, final ConfigDataset config) { - final boolean isSum = query.getQueryType().equals(QueryType.SUM); final ResponseWps result = new ResponseWps(query.getQueryType().toString().toLowerCase()); if (sqlExpr.equals("noResult")) { result.setType("invalid"); @@ -205,6 +199,7 @@ public final class DbUtility { } } + final boolean isSum = query.getQueryType().equals(QueryType.SUM); double sum = isSum ? 0 : -1; while (rSet.next()) { final WpsFeature feature = new WpsFeature(); -- GitLab