Skip to content

Commit

Permalink
Bugfix/27 fix sonar findings on 0.3.0 (#32)
Browse files Browse the repository at this point in the history
* #27: Fixed Sonar findings.
  • Loading branch information
redcatbear authored Feb 25, 2019
1 parent 67ac3cf commit 3777dde
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 14 deletions.
12 changes: 12 additions & 0 deletions src/main/java/com/exasol/sql/ValueTableVisitor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.exasol.sql;

import com.exasol.sql.dql.ValueTable;
import com.exasol.sql.dql.ValueTableRow;

public interface ValueTableVisitor extends FragmentVisitor {
@Override
public void visit(ValueTable valueTable);

@Override
public void visit(ValueTableRow valueTableRow);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.exasol.sql.dml.rendering;

import com.exasol.sql.Field;
import com.exasol.sql.Table;
import com.exasol.sql.*;
import com.exasol.sql.dml.*;
import com.exasol.sql.dql.ValueTable;
import com.exasol.sql.dql.ValueTableRow;
Expand All @@ -12,7 +11,7 @@
* The {@link InsertRenderer} turns SQL statement structures in to SQL strings.
*/
// [impl->dsn~rendering.sql.insert~1]
public class InsertRenderer extends AbstractFragmentRenderer implements InsertVisitor {
public class InsertRenderer extends AbstractFragmentRenderer implements InsertVisitor, ValueTableVisitor {
/**
* Create a new {@link InsertRenderer} with custom render settings.
*
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/exasol/sql/dql/SelectVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,4 @@ public interface SelectVisitor extends FragmentVisitor {
public void visit(LimitClause limitClause);

public void visit(WhereClause whereClause);

public void visit(ValueTable valueTable);

public void visit(ValueTableRow valueTableRow);
}
2 changes: 1 addition & 1 deletion src/main/java/com/exasol/sql/dql/ValueTableRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static Builder builder(final Fragment root) {
* Builder for {@link ValueTableRow}s
*/
public static class Builder {
public Fragment root;
private final Fragment root;
private final List<ValueExpression> expressions = new ArrayList<>();

public Builder(final Fragment root) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import java.util.Optional;

import com.exasol.sql.Field;
import com.exasol.sql.Table;
import com.exasol.sql.*;
import com.exasol.sql.dql.*;
import com.exasol.sql.rendering.AbstractFragmentRenderer;
import com.exasol.sql.rendering.StringRendererConfig;
Expand All @@ -12,7 +11,7 @@
* The {@link SelectRenderer} turns SQL statement structures in to SQL strings.
*/
// [impl->dsn~rendering.sql.select~1]
public class SelectRenderer extends AbstractFragmentRenderer implements SelectVisitor {
public class SelectRenderer extends AbstractFragmentRenderer implements SelectVisitor, ValueTableVisitor {
/**
* Create a new {@link SelectRenderer} with custom render settings.
*
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/exasol/sql/expression/BooleanTerm.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public static BooleanExpression ge(final String left, final String right) {
* @return instance of either {@link And}, {@link Or} or {@link Not}
* @throws IllegalArgumentException if the operator is unknown or null
*/
public static BooleanExpression operation(final String operator, final BooleanExpression... expressions)
throws IllegalArgumentException {
public static BooleanExpression operation(final String operator, final BooleanExpression... expressions) {
switch (operator.toLowerCase()) {
case "and":
return new And(expressions);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/exasol/util/TreeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public interface TreeNode {
* @return child node at position
* @throws IndexOutOfBoundsException if the index is out of range (index &lt; 0 || index &ge; size())
*/
public TreeNode getChild(int index) throws IndexOutOfBoundsException;
public TreeNode getChild(int index);

/**
* Check whether this node is the root of the tree.
Expand Down

0 comments on commit 3777dde

Please sign in to comment.