exercism / exercism/java-representer

Normalize usage of `this`

Open
#116 2 comments 0 reactions 1 assignee Claimed by @tharun694 View on GitHub
Dominant language
Java
Stars
1
Forks
12
Avg merge
4d 4h
Merged PRs (30d)
7

Description

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

```java
class SomeClass {
private String someField = "";

String getSomeField() {
return someField;
}

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

```java
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()`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.