Skip to content

Commit

Permalink
fix: initialise the SelectDeparser with an ExpressionDeparser (bu…
Browse files Browse the repository at this point in the history
…t not with an empty Adaptor only)

Signed-off-by: Andreas Reichel <andreas@manticore-projects.com>
  • Loading branch information
manticore-projects committed Apr 19, 2024
1 parent e4ece0c commit f417c8f
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@
*/
package net.sf.jsqlparser.util.deparser;

import static java.util.stream.Collectors.joining;

import java.util.Iterator;
import java.util.List;
import net.sf.jsqlparser.expression.Alias;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.ExpressionVisitor;
import net.sf.jsqlparser.expression.ExpressionVisitorAdapter;
import net.sf.jsqlparser.expression.MySQLIndexHint;
import net.sf.jsqlparser.expression.OracleHint;
import net.sf.jsqlparser.expression.SQLServerHints;
Expand Down Expand Up @@ -50,6 +45,11 @@
import net.sf.jsqlparser.statement.select.Values;
import net.sf.jsqlparser.statement.select.WithItem;

import java.util.Iterator;
import java.util.List;

import static java.util.stream.Collectors.joining;

@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
public class SelectDeParser extends AbstractDeParser<PlainSelect> implements SelectVisitor,
SelectItemVisitor, FromItemVisitor, PivotVisitor {
Expand All @@ -61,7 +61,8 @@ public SelectDeParser() {
}

public SelectDeParser(StringBuilder buffer) {
this(new ExpressionVisitorAdapter(), buffer);
super(buffer);
this.expressionVisitor = new ExpressionDeParser(this, buffer);
}

public SelectDeParser(ExpressionVisitor expressionVisitor, StringBuilder buffer) {
Expand Down

0 comments on commit f417c8f

Please sign in to comment.