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

Normalize usage of this #116

Open
sanderploegsma opened this issue Feb 5, 2024 · 0 comments
Open

Normalize usage of this #116

sanderploegsma opened this issue Feb 5, 2024 · 0 comments

Comments

@sanderploegsma
Copy link
Contributor

sanderploegsma commented Feb 5, 2024

It would be nice if the representer was able to normalize code such as the following two snippets into the same representation:

class SomeClass {
    private String someField = "";

    String getSomeField() {
        return someField;
    }

    void setSomeField(String someField) {
        this.someField = someField;
    }
}
class SomeClass {
    private String someField = "";

    String getSomeField() {
        return this.someField;
    }

    void setSomeField(String someField) {
        this.someField = someField;
    }
}

Right now, these variants both get their own representation because one uses this in getSomeField() while the other one doesn't. The easiest way to normalize would be to always add this when referencing instance fields or methods, since removing it will result in invalid code for setSomeField().

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

No branches or pull requests

1 participant