From 372cfb9dca6aab35a7f32041795ba9dc6889db99 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sun, 18 Jun 2023 18:55:12 +0200 Subject: [PATCH 1/6] doc: highlight for CtRecordComponent that return values are views Update the comments of the `toMethod()` and `toField()` functions in the `CtRecordComponent.java` file to improve the view of the corresponding methods and fields. This change improves the readability of previously confusing aspects of the code while highlighting ways to view specific fields and methods. --- .../reflect/declaration/CtRecordComponent.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java index 074395f0606..53b5b76f09f 100644 --- a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java +++ b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java @@ -19,14 +19,22 @@ public interface CtRecordComponent extends CtTypedElement, CtNamedElement, CtShadowable { /** - * Converts the component to an implicit method. - * @return the method + * Converts the component to an implicit method. The returned method is a view and has no parent. + * This means that any modification on the returned method will not be reflected on the component. + * Also this element is not part of the model. A record already has the methods corresponding to its components. + * Use {@link CtRecord#getMethods()} to get the getter methods of a record. + * + * @return the method corresponding to the component (a getter) as a view. */ CtMethod toMethod(); /** - * Converts the component to an implicit field. - * @return the field + * Converts the component to an implicit field.The returned field is a view and has no parent. + * This means that any modification on the returned field will not be reflected on the component. + * Also this element is not part of the model. A record already has the field corresponding to its components. + * Use {@link CtRecord#getFields()} to get the field of a record. + * + * @return the field corresponding to the component as a view. */ CtField toField(); From 566e2e0736880555d6eb4310b4a2ed69076cff91 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sun, 18 Jun 2023 19:01:44 +0200 Subject: [PATCH 2/6] one day I use and IDE with checkstyle --- .../java/spoon/reflect/declaration/CtRecordComponent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java index 53b5b76f09f..96aa308f956 100644 --- a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java +++ b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java @@ -23,7 +23,7 @@ public interface CtRecordComponent extends CtTypedElement, CtNamedElemen * This means that any modification on the returned method will not be reflected on the component. * Also this element is not part of the model. A record already has the methods corresponding to its components. * Use {@link CtRecord#getMethods()} to get the getter methods of a record. - * + * * @return the method corresponding to the component (a getter) as a view. */ CtMethod toMethod(); @@ -33,7 +33,7 @@ public interface CtRecordComponent extends CtTypedElement, CtNamedElemen * This means that any modification on the returned field will not be reflected on the component. * Also this element is not part of the model. A record already has the field corresponding to its components. * Use {@link CtRecord#getFields()} to get the field of a record. - * + * * @return the field corresponding to the component as a view. */ CtField toField(); From c2a6f06bb9739ea959bf743ddb110444bc333c69 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Mon, 19 Jun 2023 20:30:44 +0200 Subject: [PATCH 3/6] Update src/main/java/spoon/reflect/declaration/CtRecordComponent.java Co-authored-by: I-Al-Istannen --- src/main/java/spoon/reflect/declaration/CtRecordComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java index 96aa308f956..17ff9c5a3ce 100644 --- a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java +++ b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java @@ -32,7 +32,7 @@ public interface CtRecordComponent extends CtTypedElement, CtNamedElemen * Converts the component to an implicit field.The returned field is a view and has no parent. * This means that any modification on the returned field will not be reflected on the component. * Also this element is not part of the model. A record already has the field corresponding to its components. - * Use {@link CtRecord#getFields()} to get the field of a record. + * Use {@link CtRecord#getFields()} to get the fields of a record. * * @return the field corresponding to the component as a view. */ From 82554d772aabfa46797c988a20b11cc5a89e8c4d Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Mon, 19 Jun 2023 20:31:14 +0200 Subject: [PATCH 4/6] Update src/main/java/spoon/reflect/declaration/CtRecordComponent.java Co-authored-by: I-Al-Istannen --- src/main/java/spoon/reflect/declaration/CtRecordComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java index 17ff9c5a3ce..4350b9f42eb 100644 --- a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java +++ b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java @@ -31,7 +31,7 @@ public interface CtRecordComponent extends CtTypedElement, CtNamedElemen /** * Converts the component to an implicit field.The returned field is a view and has no parent. * This means that any modification on the returned field will not be reflected on the component. - * Also this element is not part of the model. A record already has the field corresponding to its components. + * Also this element is not part of the model. A record already has the field corresponding to its components. * Use {@link CtRecord#getFields()} to get the fields of a record. * * @return the field corresponding to the component as a view. From c15910ed2953b34f2e15946417ddf4d0274f14d3 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Mon, 19 Jun 2023 20:31:21 +0200 Subject: [PATCH 5/6] Update src/main/java/spoon/reflect/declaration/CtRecordComponent.java Co-authored-by: I-Al-Istannen --- src/main/java/spoon/reflect/declaration/CtRecordComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java index 4350b9f42eb..0e910aecd0c 100644 --- a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java +++ b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java @@ -21,7 +21,7 @@ public interface CtRecordComponent extends CtTypedElement, CtNamedElemen /** * Converts the component to an implicit method. The returned method is a view and has no parent. * This means that any modification on the returned method will not be reflected on the component. - * Also this element is not part of the model. A record already has the methods corresponding to its components. + * Also this element is not part of the model. A record already has the methods corresponding to its components. * Use {@link CtRecord#getMethods()} to get the getter methods of a record. * * @return the method corresponding to the component (a getter) as a view. From 9aba969b352b6baec3aa7f3ae0aa802cb6ce7afe Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Mon, 19 Jun 2023 20:34:07 +0200 Subject: [PATCH 6/6] Update src/main/java/spoon/reflect/declaration/CtRecordComponent.java Co-authored-by: I-Al-Istannen --- src/main/java/spoon/reflect/declaration/CtRecordComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java index 0e910aecd0c..e8065dfe18f 100644 --- a/src/main/java/spoon/reflect/declaration/CtRecordComponent.java +++ b/src/main/java/spoon/reflect/declaration/CtRecordComponent.java @@ -34,7 +34,7 @@ public interface CtRecordComponent extends CtTypedElement, CtNamedElemen * Also this element is not part of the model. A record already has the field corresponding to its components. * Use {@link CtRecord#getFields()} to get the fields of a record. * - * @return the field corresponding to the component as a view. + * @return the field corresponding to the component as a view. */ CtField toField();