ForbidTokensAtLineEnd #125

Closed
romani opened this Issue Aug 11, 2013 · 4 comments

Comments

Projects
None yet
4 participants
@romani
Member

romani commented Aug 11, 2013

Condition:

        return methodType.getType() == TokenTypes.ARRAY_DECLARATOR ||
                mCollectionList.contains(methodType.getText());

better condition:

        return methodType.getType() == TokenTypes.ARRAY_DECLARATOR
                || mCollectionList.contains(methodType.getText());

All conditions at : http://docs.oracle.com/javase/tutorial/java/nutsandbolts/op2.html

The same problem for "," and ".":
bad:

        return new JPAQuery(em)
                from(teamInGame).
                limit(1L).
                uniqueResult(teamInGame.teamInSeason.season);

good (https://github.com/isopov/fan/blob/master/fan-core/src/main/java/com/sopovs/moradanen/fan/service/DaoService.java):

        return new JPAQuery(em)
                .from(teamInGame)
                .limit(1L)
                .uniqueResult(teamInGame.teamInSeason.season);

good:

getGames(firstTeamId
      , secondTeamId
      , size
      ,  startFrom);

bad:

getGames(firstTeamId, 
         secondTeamId, 
         size,  
         startFrom);

Task: create Check that will allow user to forbid presence of Token (selected in options of Check) at the end of any line (condition, method declaration, call of function, ..... ). Do not put token ";" in list tokens. I do believe we need to focus on conditions, "+-", ".," ... anything that could be used inside one command (http://www.quepublishing.com/articles/article.aspx?p=28697&seqNum=4).

@rdiachenko

This comment has been minimized.

Show comment
Hide comment
@rdiachenko

rdiachenko May 27, 2014

Member

The case with operators is already covered by OperatorWrap check

Member

rdiachenko commented May 27, 2014

The case with operators is already covered by OperatorWrap check

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 7, 2014

Member

OperatorWrap does not cover all cases , new check was created maxvetrenko/checkstyle#10

Member

romani commented Jul 7, 2014

OperatorWrap does not cover all cases , new check was created maxvetrenko/checkstyle#10

@romani romani assigned romani and unassigned alexkravin Jul 7, 2014

@daniilyar

This comment has been minimized.

Show comment
Hide comment
@daniilyar

daniilyar Jul 18, 2014

Member

So, could we close this issue?

Member

daniilyar commented Jul 18, 2014

So, could we close this issue?

@romani

This comment has been minimized.

Show comment
Hide comment
Member

romani commented Jul 20, 2014

@romani romani closed this Jul 20, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment