Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #9464: Added example for LITERAL_BREAK in TokenTypes.java" #9687

Closed
wants to merge 4 commits into from

Conversation

suubh
Copy link

@suubh suubh commented Mar 21, 2021

Issue #9464
Screenshot (414)

My test code

public class test{
    public static void main(String args[]){
        
        for(int i=0;i<10;i++){
            if(i == 5){
                break;
            }
            System.out.println(i);
        }
    }
}

AST

C:\Users\HP\Desktop\checklist>java -jar checkstyle-8.41-all.jar -t test.java
CLASS_DEF -> CLASS_DEF [1:0]
|--MODIFIERS -> MODIFIERS [1:0]
|   `--LITERAL_PUBLIC -> public [1:0]
|--LITERAL_CLASS -> class [1:7]
|--IDENT -> test [1:13]
`--OBJBLOCK -> OBJBLOCK [1:17]
    |--LCURLY -> { [1:17]
    |--METHOD_DEF -> METHOD_DEF [2:4]
    |   |--MODIFIERS -> MODIFIERS [2:4]
    |   |   |--LITERAL_PUBLIC -> public [2:4]
    |   |   `--LITERAL_STATIC -> static [2:11]
    |   |--TYPE -> TYPE [2:18]
    |   |   `--LITERAL_VOID -> void [2:18]
    |   |--IDENT -> main [2:23]
    |   |--LPAREN -> ( [2:27]
    |   |--PARAMETERS -> PARAMETERS [2:39]
    |   |   `--PARAMETER_DEF -> PARAMETER_DEF [2:39]
    |   |       |--MODIFIERS -> MODIFIERS [2:39]
    |   |       |--TYPE -> TYPE [2:39]
    |   |       |   `--ARRAY_DECLARATOR -> [ [2:39]
    |   |       |       |--IDENT -> String [2:28]
    |   |       |       `--RBRACK -> ] [2:40]
    |   |       `--IDENT -> args [2:35]
    |   |--RPAREN -> ) [2:41]
    |   `--SLIST -> { [2:42]
    |       |--LITERAL_FOR -> for [4:8]
    |       |   |--LPAREN -> ( [4:11]
    |       |   |--FOR_INIT -> FOR_INIT [4:12]
    |       |   |   `--VARIABLE_DEF -> VARIABLE_DEF [4:12]
    |       |   |       |--MODIFIERS -> MODIFIERS [4:12]
    |       |   |       |--TYPE -> TYPE [4:12]
    |       |   |       |   `--LITERAL_INT -> int [4:12]
    |       |   |       |--IDENT -> i [4:16]
    |       |   |       `--ASSIGN -> = [4:17]
    |       |   |           `--EXPR -> EXPR [4:18]
    |       |   |               `--NUM_INT -> 0 [4:18]
    |       |   |--SEMI -> ; [4:19]
    |       |   |--FOR_CONDITION -> FOR_CONDITION [4:21]
    |       |   |   `--EXPR -> EXPR [4:21]
    |       |   |       `--LT -> < [4:21]
    |       |   |           |--IDENT -> i [4:20]
    |       |   |           `--NUM_INT -> 10 [4:22]
    |       |   |--SEMI -> ; [4:24]
    |       |   |--FOR_ITERATOR -> FOR_ITERATOR [4:26]
    |       |   |   `--ELIST -> ELIST [4:26]
    |       |   |       `--EXPR -> EXPR [4:26]
    |       |   |           `--POST_INC -> ++ [4:26]
    |       |   |               `--IDENT -> i [4:25]
    |       |   |--RPAREN -> ) [4:28]
    |       |   `--SLIST -> { [4:29]
    |       |       |--LITERAL_IF -> if [5:12]
    |       |       |   |--LPAREN -> ( [5:14]
    |       |       |   |--EXPR -> EXPR [5:17]
    |       |       |   |   `--EQUAL -> == [5:17]
    |       |       |   |       |--IDENT -> i [5:15]
    |       |       |   |       `--NUM_INT -> 5 [5:20]
    |       |       |   |--RPAREN -> ) [5:21]
    |       |       |   `--SLIST -> { [5:22]
    |       |       |       |--LITERAL_BREAK -> break [6:16]
    |       |       |       |   `--SEMI -> ; [6:21]
    |       |       |       `--RCURLY -> } [7:12]
    |       |       |--EXPR -> EXPR [8:30]
    |       |       |   `--METHOD_CALL -> ( [8:30]
    |       |       |       |--DOT -> . [8:22]
    |       |       |       |   |--DOT -> . [8:18]
    |       |       |       |   |   |--IDENT -> System [8:12]
    |       |       |       |   |   `--IDENT -> out [8:19]
    |       |       |       |   `--IDENT -> println [8:23]
    |       |       |       |--ELIST -> ELIST [8:31]
    |       |       |       |   `--EXPR -> EXPR [8:31]
    |       |       |       |       `--IDENT -> i [8:31]
    |       |       |       `--RPAREN -> ) [8:32]
    |       |       |--SEMI -> ; [8:33]
    |       |       `--RCURLY -> } [9:8]
    |       `--RCURLY -> } [10:4]
    `--RCURLY -> } [11:0]

Expected update for Javadoc

 |--LITERAL_BREAK -> break [6:16]
 |     `--SEMI -> ; [6:21]

@suubh suubh changed the title Added example for LITERAL_BREAK in TokenTypes.java" Issue #9464:Added example for LITERAL_BREAK in TokenTypes.java" Mar 21, 2021
@suubh suubh changed the title Issue #9464:Added example for LITERAL_BREAK in TokenTypes.java" Issue #9464: Added example for LITERAL_BREAK in TokenTypes.java" Mar 21, 2021
@suubh suubh closed this Mar 22, 2021
@suubh suubh reopened this Mar 22, 2021
@suubh
Copy link
Author

suubh commented Mar 22, 2021

@pbludov Please have a look .

@suubh
Copy link
Author

suubh commented Mar 22, 2021

Made the changes . @pbludov

@pbludov
Copy link
Member

pbludov commented Mar 22, 2021

Made the changes

There should be only one commit in the PR. Please squash and rebase to the latest upstream.

@suubh
Copy link
Author

suubh commented Mar 22, 2021

Made the changes

There should be only one commit in the PR. Please squash and rebase to the latest upstream.

Okay . I am trying to rebase but its showing some error and also mvn clean verify is not building successfully .Can I create a new PR and close this one ?
@pbludov

@muhlba91
Copy link

@suubh does it work locally?

also, can you please force push your change with the squashed commit. we‘ll then see if the CI builds and what the changeset is.

(maybe some rebase error happened.)

@suubh
Copy link
Author

suubh commented Mar 23, 2021

@suubh does it work locally?

also, can you please force push your change with the squashed commit. we‘ll then see if the CI builds and what the changeset is.

(maybe some rebase error happened.)

Yes it is working locally .
Can you please help me with the commands ? What I did is I forked and cloned the repo ,created a new branch and did the changes and add, commit and push using git push origin suubh-contribution .

I did 4 commits as you can see so for rebase I tried git rebase --interactive HEAD~[4] ,it says invalid upstream . Can you please guide me with the commands !

@CryptoSingh1337
Copy link
Contributor

@suubh

  1. type git rebase -i HEAD~4
  2. then squash the commits by replacing pick with s and save the file.
  3. then remove the unwanted commit messages.

@suubh suubh closed this Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants