-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8267580: The method JavacParser#peekToken is wrong when the first parameter is not zero #4158
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
Conversation
…ameter is not zero
|
👋 Welcome back gli! A progress list of the required criteria for merging this PR into |
mcimadamore
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - I wonder if we could rewrite all the other routines in terms of this one, rather than having a bunch of different related methods bottoming out in the same code?
|
@lgxbslgx This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@mcimadamore) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
@mcimadamore Thank you for your review. These similar overloaded methods seem like a common way at module I don't think it is good to remove them in this patch. Maybe we should continue to discuss this issue at another thread which is like /integrate |
|
I misread the patch. One method - |
|
/sponsor |
|
@mcimadamore @lgxbslgx Since your change was applied there has been 1 commit pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 54520fb. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi all,
The method
JavacParser#peekToken(int lookahead, Predicate<TokenKind>... kinds)succeeds only when the first parameterlookaheadis zero. If thelookaheadis not zero, it is wrong and returns unexpected result.The parameter
kindsshould not be dereferenced bylookaheadand should be always started at zero.But currently, the method
JavacParser#peekToken(int lookahead, Predicate<TokenKind>... kinds)has not been used so that this issue doesn't effect the parser.An alternative way: remove the following methods, because they are not used.
To test this patch, we can comment out the following methods and run the tests locally.
Note: some methods may need to add
@SuppressWarnings("unchecked").Thanks for your review.
Best Regards,
-- Guoxiong
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4158/head:pull/4158$ git checkout pull/4158Update a local copy of the PR:
$ git checkout pull/4158$ git pull https://git.openjdk.java.net/jdk pull/4158/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4158View PR using the GUI difftool:
$ git pr show -t 4158Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4158.diff