exercism / exercism/java-representer

Normalize usage of `this`

Aperta
#116 2 commenti 0 reazioni 1 assegnatario Rivendicata da @tharun694 Vedi su GitHub
Lingua principale
Java
Stelle
1
Fork
12
Merge medio
4g 4h
PR unite (30g)
7

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.