From fa8e1c9b21f1766bc74114e6cf579fe585702934 Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Fri, 9 Dec 2016 20:09:54 +0300 Subject: [PATCH] Removed newlines and tables from DataSource pretty-printing --- .../sql/impl/parser/DataSource.java | 21 ++++++++----------- .../sql/impl/task/DataSourceTask.java | 6 +++--- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/parser/DataSource.java b/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/parser/DataSource.java index 865f6c5c..ce6f5e5c 100644 --- a/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/parser/DataSource.java +++ b/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/parser/DataSource.java @@ -131,32 +131,29 @@ public enum DataSourceType { @Override public String toString() { - StringBuilder sb = new StringBuilder("DataSource{\n"); + StringBuilder sb = new StringBuilder("DataSource{"); if (tableAlias != null) { - sb.append(String.format("\ttableAlias='%s',\n", String.valueOf(tableAlias))); + sb.append(String.format("tableAlias='%s',", String.valueOf(tableAlias))); } if (leftDataSource != null) { - sb.append(String.format("\tleftDataSource=%s,\n", String.valueOf(leftDataSource).replace("\n", "\n\t"))); + sb.append(String.format("leftDataSource=%s,", String.valueOf(leftDataSource))); } if (isNaturalJoin) { - sb.append("\tnaturalJoin=true,\n"); + sb.append("naturalJoin=true,"); } if (joinType != null) { - sb.append(String.format("\tjoinType=%s,\n", String.valueOf(joinType))); + sb.append(String.format("joinType=%s,", String.valueOf(joinType))); } if (condition != null) { - sb.append(String.format("\tcondition=%s,\n", String.valueOf(condition))); + sb.append(String.format("condition=%s,", String.valueOf(condition))); } if (!columns.isEmpty()) { - sb.append(String.format("\tcolumns=%s,\n", columns)); + sb.append(String.format("columns=%s,", columns)); } if (rightDatasource != null) { - sb.append(String.format( - "\trightDatasource=%s,\n", - String.valueOf(rightDatasource).replace("\n", "\n\t") - )); + sb.append(String.format("rightDatasource=%s,", String.valueOf(rightDatasource))); } - sb.append(String.format("\ttype=%s\n", String.valueOf(type))); + sb.append(String.format("type=%s", String.valueOf(type))); sb.append("}"); return sb.toString(); } diff --git a/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/task/DataSourceTask.java b/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/task/DataSourceTask.java index ef5ab4c7..e62aa7c5 100644 --- a/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/task/DataSourceTask.java +++ b/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/task/DataSourceTask.java @@ -65,9 +65,9 @@ private DataContainer processDataSource(DataSource dataSource, Map