exercism / exercism/java-representer

Normalize usage of `this`

Đang mở
#116 2 bình luận 0 reaction 1 người được giao Được @tharun694 nhận Xem trên GitHub
Ngôn ngữ chính
Java
Star
1
Fork
12
Merge trung bình
4 ngày 4 giờ
Pull request đã merge (30 ngày)
7

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.