exercism / exercism/java-representer

Normalize usage of `this`

Ouverte
#116 2 commentaires 0 réactions 1 personne assignée Réclamée par @tharun694 Voir sur GitHub
Langage dominant
Java
Étoiles
1
Forks
12
Merge moyen
4 j 4 h
PR mergées (30 j)
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()`.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.