Skip to content

Commit

Permalink
8267580: The method JavacParser#peekToken is wrong when the first par…
Browse files Browse the repository at this point in the history
…ameter is not zero

Reviewed-by: mcimadamore
  • Loading branch information
lgxbslgx authored and mcimadamore committed May 24, 2021
1 parent 3113910 commit 54520fb
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -309,8 +309,8 @@ protected boolean peekToken(Predicate<TokenKind>... kinds) {

@SuppressWarnings("unchecked")
protected boolean peekToken(int lookahead, Predicate<TokenKind>... kinds) {
for (; lookahead < kinds.length ; lookahead++) {
if (!kinds[lookahead].test(S.token(lookahead + 1).kind)) {
for (Predicate<TokenKind> kind : kinds) {
if (!kind.test(S.token(++lookahead).kind)) {
return false;
}
}
Expand Down

3 comments on commit 54520fb

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgxbslgx
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 54520fb Jul 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgxbslgx Could not automatically backport 54520fbf to openjdk/jdk11u-dev due to conflicts in the following files:

  • src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java

To manually resolve these conflicts run the following commands in your personal fork of openjdk/jdk11u-dev:

$ git checkout -b lgxbslgx-backport-54520fbf
$ git fetch --no-tags https://git.openjdk.org/jdk 54520fbf49bb6a7bdcff1a69a0bb46f842bdc054
$ git cherry-pick --no-commit 54520fbf49bb6a7bdcff1a69a0bb46f842bdc054
$ # Resolve conflicts
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 54520fbf49bb6a7bdcff1a69a0bb46f842bdc054'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk11u-dev with the title Backport 54520fbf49bb6a7bdcff1a69a0bb46f842bdc054.

Please sign in to comment.