mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fix sonar rule check violations
This commit is contained in:
@@ -20,12 +20,11 @@ import com.alibaba.druid.sql.dialect.postgresql.ast.PGAggregateExpr;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGOrderBy;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGAnalytic;
|
||||
import com.alibaba.druid.sql.parser.Lexer;
|
||||
import com.alibaba.druid.sql.parser.ParserException;
|
||||
import com.alibaba.druid.sql.parser.SQLExprParser;
|
||||
import com.alibaba.druid.sql.parser.Token;
|
||||
|
||||
public class PGExprParser extends SQLExprParser{
|
||||
public PGExprParser(String sql) throws ParserException{
|
||||
public PGExprParser(String sql) {
|
||||
super(new PGLexer(sql));
|
||||
this.lexer.nextToken();
|
||||
}
|
||||
@@ -34,7 +33,7 @@ public class PGExprParser extends SQLExprParser{
|
||||
super(lexer);
|
||||
}
|
||||
|
||||
protected SQLAggregateExpr parseAggregateExpr(String methodName) throws ParserException {
|
||||
protected SQLAggregateExpr parseAggregateExpr(String methodName) {
|
||||
methodName = methodName.toUpperCase();
|
||||
|
||||
PGAggregateExpr aggregateExpr;
|
||||
|
||||
+4
-4
@@ -40,7 +40,7 @@ import com.alibaba.druid.sql.parser.Token;
|
||||
|
||||
public class PGSQLStatementParser extends SQLStatementParser {
|
||||
|
||||
public PGSQLStatementParser(String sql) throws ParserException{
|
||||
public PGSQLStatementParser(String sql) {
|
||||
super (new PGExprParser(sql));
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class PGSQLStatementParser extends SQLStatementParser {
|
||||
return new PGSelectParser(this.exprParser);
|
||||
}
|
||||
|
||||
public SQLUpdateStatement parseUpdateStatement() throws ParserException {
|
||||
public SQLUpdateStatement parseUpdateStatement() {
|
||||
accept(Token.UPDATE);
|
||||
|
||||
PGUpdateStatement udpateStatement = new PGUpdateStatement();
|
||||
@@ -150,7 +150,7 @@ public class PGSQLStatementParser extends SQLStatementParser {
|
||||
return stmt;
|
||||
}
|
||||
|
||||
public PGDeleteStatement parseDeleteStatement() throws ParserException {
|
||||
public PGDeleteStatement parseDeleteStatement() {
|
||||
lexer.nextToken();
|
||||
PGDeleteStatement deleteStatement = new PGDeleteStatement();
|
||||
|
||||
@@ -329,7 +329,7 @@ public class PGSQLStatementParser extends SQLStatementParser {
|
||||
return withQuery;
|
||||
}
|
||||
|
||||
public PGSelectStatement parseSelect() throws ParserException {
|
||||
public PGSelectStatement parseSelect() {
|
||||
return new PGSelectStatement(createSQLSelectParser().select());
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class PGSelectParser extends SQLSelectParser {
|
||||
super(exprParser);
|
||||
}
|
||||
|
||||
public PGSelectParser(String sql) throws ParserException{
|
||||
public PGSelectParser(String sql) {
|
||||
this(new PGExprParser(sql));
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class PGSelectParser extends SQLSelectParser {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SQLSelectQuery query() throws ParserException {
|
||||
public SQLSelectQuery query() {
|
||||
PGSelectQueryBlock queryBlock = new PGSelectQueryBlock();
|
||||
|
||||
if (lexer.token() == Token.SELECT) {
|
||||
@@ -219,7 +219,7 @@ public class PGSelectParser extends SQLSelectParser {
|
||||
return queryRest(queryBlock);
|
||||
}
|
||||
|
||||
protected SQLTableSource parseTableSourceRest(SQLTableSource tableSource) throws ParserException {
|
||||
protected SQLTableSource parseTableSourceRest(SQLTableSource tableSource) {
|
||||
if (lexer.token() == Token.AS && tableSource instanceof SQLExprTableSource) {
|
||||
String alias = this.as();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user