Skip to content

Conversation

TwoOfTwelve
Copy link
Contributor

@TwoOfTwelve TwoOfTwelve commented Jul 21, 2025

Adds an assign token to variable declarations with initializers.

For example:

int x = 1;
| VARDEF
      | ASSIGN

This should be better since it is now equivalent to:

int x;
| VARDEF
x = 1;
  | ASSIGN

To make this compatible with the new pattern syntax, an assignment is also added there:

public class PatternMatchingManual {
    private static final record Test(int x) {
    }

    public void test() {
        Object a = new Test(1);
        if (a instanceof Test testA) {
                         | VARDEF
                                  | ASSIGN
        }
    }
}

Required for #1962

@TwoOfTwelve TwoOfTwelve self-assigned this Jul 21, 2025
@TwoOfTwelve TwoOfTwelve added enhancement Issue/PR that involves features, improvements and other changes minor Minor issue/feature/contribution/change language PR / Issue deals (partly) with new and/or existing languages for JPlag labels Jul 21, 2025
@TwoOfTwelve TwoOfTwelve requested a review from tsaglam July 21, 2025 09:01
@tsaglam
Copy link
Member

tsaglam commented Jul 22, 2025

For PRs like this one that fundamentally change tokenization, we should ensure there is a detailed PR description including examples of how the tokenization changes (for example, see #1869 or #911).
Moreover, we must ensure that this change has no adverse side effects. I will have to do some testing with larger datasets. Perhaps you could include the summary metric results of the E2E tests regarding the shift for plagiarism pairs and unrelated pairs in the PR description.

Copy link
Member

@tsaglam tsaglam left a comment

Choose a reason for hiding this comment

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

Reminder for @jplag/maintainer: Do not merge before internal impact testing with real-world data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue/PR that involves features, improvements and other changes language PR / Issue deals (partly) with new and/or existing languages for JPlag minor Minor issue/feature/contribution/change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants