Skip to content

fix(707): do not throw if the record-pattern contains dims#708

Merged
clementdessoude merged 1 commit intojhipster:mainfrom
clementdessoude:fix/707-record-pattern-with-dims
Jan 2, 2025
Merged

fix(707): do not throw if the record-pattern contains dims#708
clementdessoude merged 1 commit intojhipster:mainfrom
clementdessoude:fix/707-record-pattern-with-dims

Conversation

@clementdessoude
Copy link
Contributor

What changed with this PR:

This piece of code was failing as the java-parser tried to parse String otherName, String[] otherContent as a variable declaration list instead of component pattern list

I added backtrack lookahead which fixed the issue but will see if we can avoid it completely.

// Input
public class Foo {
  public void bar() {
    if (!(obj instanceof Project(String otherName, String[] otherContent))) {
      return false;
    }
  }
}

Relative issues or prs:

#707

@clementdessoude clementdessoude force-pushed the fix/707-record-pattern-with-dims branch 6 times, most recently from 2a2ce50 to f16b22c Compare December 22, 2024 00:37
@clementdessoude clementdessoude force-pushed the fix/707-record-pattern-with-dims branch from f16b22c to 8d79c4d Compare December 22, 2024 09:02
@clementdessoude clementdessoude merged commit 575d375 into jhipster:main Jan 2, 2025
@clementdessoude clementdessoude deleted the fix/707-record-pattern-with-dims branch January 22, 2025 20:02
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.

1 participant