ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kirill Shirokov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IGNITE-7373) Fix style guide violations and imprecise naming in SqlParser-related code
Date Wed, 10 Jan 2018 10:30:00 GMT

     [ https://issues.apache.org/jira/browse/IGNITE-7373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kirill Shirokov updated IGNITE-7373:
------------------------------------
    Description: 
SQL parser implementation contains many abbreviation rule violations and names that doesn't
reflect the method intention:

1. "token" instead of "tok" in variables
2. SqlParserUtils.skipIfMatches throws an exception if the token doesn't match, although the
name doesn't reflect this. 'accept' or 'skip' without 'if' would be more precise
3. SqlKeyword.DEFAULT clashes with SqlParserTokenType.DEFAULT
4. SqlParserUtils.skipCommaOrRightParenthesis() can be generalized. It's better to return
the token it's met instead of obscure boolean (otherwise the name should reflect the returned
type)
5. It makes sense to have a method to return the current token. The container can be refactored
from SqlLexerLookAheadToken, since lookahead token doesn't need it's own class.
6. SqlLexerTokenType.EOF does not mean 'end of FILE'.

  was:
SQL parser implementation contains many abbreviation rule violations and names that doesn't
reflect the method intention:

1. "token" instead of "tok" in variables
2. SqlParserUtils.skipIfMatches throws an exception if the token doesn't match, although the
name doesn't reflect this. 'accept' or 'skip' without 'if' would be more precise
3. SqlKeyword.DEFAULT clashes with SqlParserTokenType.DEFAULT
4. SqlParserUtils.skipCommaOrRightParenthesis() can be generalized. It's better to return
the token it's met instead of obscure boolean (otherwise the name should reflect the returned
type)
5. It makes sense to have a method to return the current token. The container can be refactored
from SqlLexerLookAheadToken, since lookahead token doesn't need it's own class.


> Fix style guide violations and imprecise naming in SqlParser-related code
> -------------------------------------------------------------------------
>
>                 Key: IGNITE-7373
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7373
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.4
>            Reporter: Kirill Shirokov
>            Priority: Minor
>
> SQL parser implementation contains many abbreviation rule violations and names that doesn't
reflect the method intention:
> 1. "token" instead of "tok" in variables
> 2. SqlParserUtils.skipIfMatches throws an exception if the token doesn't match, although
the name doesn't reflect this. 'accept' or 'skip' without 'if' would be more precise
> 3. SqlKeyword.DEFAULT clashes with SqlParserTokenType.DEFAULT
> 4. SqlParserUtils.skipCommaOrRightParenthesis() can be generalized. It's better to return
the token it's met instead of obscure boolean (otherwise the name should reflect the returned
type)
> 5. It makes sense to have a method to return the current token. The container can be
refactored from SqlLexerLookAheadToken, since lookahead token doesn't need it's own class.
> 6. SqlLexerTokenType.EOF does not mean 'end of FILE'.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message