Skip to content

Commit

Permalink
#76: fixed review findings
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiiaSergienko committed Jun 29, 2020
1 parent 9518d56 commit 54da234
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions src/main/java/com/exasol/sql/ValueTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class ValueTable extends AbstractFragment {
private final List<ValueTableRow> rows = new ArrayList<>();
private String tableNameAlias;
private final List<String> columnNamesAliases = new ArrayList<>();
private final List<String> columnNameAliases = new ArrayList<>();

/**
* Create a new {@link ValueTable}.
Expand Down Expand Up @@ -180,12 +180,12 @@ public void accept(final ValueTableVisitor visitor) {
* Set alias for the value table.
*
* @param tableNameAlias table name alias
* @param columnNamesAliases zero or more column names aliases
* @param columnNameAliases zero or more column names aliases
*/
public void alias(final String tableNameAlias, final String... columnNamesAliases) {
public void alias(final String tableNameAlias, final String... columnNameAliases) {
this.tableNameAlias = tableNameAlias;
if (columnNamesAliases.length > 0) {
this.columnNamesAliases.addAll(Arrays.asList(columnNamesAliases));
if (columnNameAliases.length > 0) {
this.columnNameAliases.addAll(Arrays.asList(columnNameAliases));
}
}

Expand All @@ -196,7 +196,7 @@ public void alias(final String tableNameAlias, final String... columnNamesAliase
*/
public boolean hasAlias() {
return (this.tableNameAlias != null) && (!this.tableNameAlias.isEmpty()) //
&& (!this.columnNamesAliases.isEmpty());
&& (!this.columnNameAliases.isEmpty());
}

/**
Expand All @@ -209,11 +209,11 @@ public String getTableNameAlias() {
}

/**
* Get column names aliases.
* Get column name aliases.
*
* @return column names aliases
* @return column name aliases
*/
public List<String> getColumnNamesAliases() {
return this.columnNamesAliases;
public List<String> getColumnNameAliases() {
return this.columnNameAliases;
}
}
6 changes: 3 additions & 3 deletions src/main/java/com/exasol/sql/dql/select/FromClause.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public FromClause valueTable(final ValueTable valueTable) {
*
* @param valueTable table of value expressions
* @param tableNameAlias table alias
* @param columnNamesAliases columns aliases
* @param columnNameAliases columns aliases
* @return parent {@code FROM} clause
*/
public FromClause valueTableAs(final ValueTable valueTable, final String tableNameAlias,
final String... columnNamesAliases) {
valueTable.alias(tableNameAlias, columnNamesAliases);
final String... columnNameAliases) {
valueTable.alias(tableNameAlias, columnNameAliases);
this.valueTables.add(valueTable);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ public void leave(final ValueTable valueTable) {
appendKeyWord(" AS ");
appendAutoQuoted(valueTable.getTableNameAlias());
append("(");
final List<String> columnNamesAliases = valueTable.getColumnNamesAliases();
for (int i = 0; i < columnNamesAliases.size(); i++) {
appendAutoQuoted(columnNamesAliases.get(i));
if (i < columnNamesAliases.size() - 1) {
final List<String> columnNameAliases = valueTable.getColumnNameAliases();
for (int i = 0; i < columnNameAliases.size(); i++) {
appendAutoQuoted(columnNameAliases.get(i));
if (i < columnNameAliases.size() - 1) {
append(", ");
}
}
Expand Down

0 comments on commit 54da234

Please sign in to comment.