From 01c4e2c2ddd7d524ef1cac4d7692a24dcea7a57e Mon Sep 17 00:00:00 2001 From: Aosen Xiong Date: Tue, 8 Aug 2023 22:38:23 -0400 Subject: [PATCH 1/7] fix typo: --- .../checker/initialization/InitializationTransfer.java | 2 +- .../checkerframework/checker/optional/OptionalChecker.java | 4 ++-- .../checkerframework/dataflow/cfg/node/FieldAccessNode.java | 2 +- .../checkerframework/framework/flow/CFAbstractTransfer.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/checker/src/main/java/org/checkerframework/checker/initialization/InitializationTransfer.java b/checker/src/main/java/org/checkerframework/checker/initialization/InitializationTransfer.java index f3fd93b79b3..f46ef5eba09 100644 --- a/checker/src/main/java/org/checkerframework/checker/initialization/InitializationTransfer.java +++ b/checker/src/main/java/org/checkerframework/checker/initialization/InitializationTransfer.java @@ -168,7 +168,7 @@ public TransferResult visitAssignment(AssignmentNode n, TransferInput createTransferResult(@Nullable V value, TransferI * * @param value the value; possibly null * @param in the TransferResult to copy - * @return the input informatio + * @return the input information */ @SideEffectFree protected TransferResult recreateTransferResult( From 3418bb34e3b1e38105c56ba2cddaf27a513b1817 Mon Sep 17 00:00:00 2001 From: Aosen Xiong Date: Wed, 9 Aug 2023 00:23:01 -0400 Subject: [PATCH 2/7] provide default constructor --- .../checkerframework/checker/optional/OptionalChecker.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java index aa78b92148f..e8d5765765b 100644 --- a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java +++ b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java @@ -13,4 +13,6 @@ // TODO: For a call to of Nullable, if the argument has type @NonNull, make the return type have // type @Present. Make Optional Checker a subchecker of the Nullness Checker. @RelevantJavaTypes(Optional.class) -public class OptionalChecker extends BaseTypeChecker {} +public class OptionalChecker extends BaseTypeChecker { + public OptionalChecker() {} +} From 28a363052220bdc03af7335e4b00e323db1619de Mon Sep 17 00:00:00 2001 From: Aosen Xiong Date: Wed, 9 Aug 2023 04:07:24 -0400 Subject: [PATCH 3/7] test for lint errors --- .../org/checkerframework/checker/optional/OptionalChecker.java | 1 + 1 file changed, 1 insertion(+) diff --git a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java index e8d5765765b..2c4deaac601 100644 --- a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java +++ b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java @@ -14,5 +14,6 @@ // type @Present. Make Optional Checker a subchecker of the Nullness Checker. @RelevantJavaTypes(Optional.class) public class OptionalChecker extends BaseTypeChecker { + // Below is an empty constructor for OptionalChecker. public OptionalChecker() {} } From 12129273ad912171b4ff13a5104379cc91d2ee5e Mon Sep 17 00:00:00 2001 From: Aosen Xiong Date: Wed, 9 Aug 2023 09:25:44 -0400 Subject: [PATCH 4/7] test for lint errors --- .../checkerframework/checker/optional/OptionalChecker.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java index 2c4deaac601..c3a0bd3e4af 100644 --- a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java +++ b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java @@ -14,6 +14,7 @@ // type @Present. Make Optional Checker a subchecker of the Nullness Checker. @RelevantJavaTypes(Optional.class) public class OptionalChecker extends BaseTypeChecker { - // Below is an empty constructor for OptionalChecker. - public OptionalChecker() {} + public OptionalChecker() { + // This is an empty constructor for OptionalChecker. + } } From cd4004b90c15418d23ee2a435df488cffa65c1af Mon Sep 17 00:00:00 2001 From: Aosen Xiong Date: Fri, 11 Aug 2023 23:51:46 -0400 Subject: [PATCH 5/7] add javadoc comment --- .../checkerframework/checker/optional/OptionalChecker.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java index c3a0bd3e4af..4b14256342b 100644 --- a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java +++ b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java @@ -14,7 +14,6 @@ // type @Present. Make Optional Checker a subchecker of the Nullness Checker. @RelevantJavaTypes(Optional.class) public class OptionalChecker extends BaseTypeChecker { - public OptionalChecker() { - // This is an empty constructor for OptionalChecker. - } + /** Default constructor for OptionalChecker. */ + public OptionalChecker() {} } From 9f71dfcd95da24632e511e2e040948d6d44db294 Mon Sep 17 00:00:00 2001 From: Aosen Xiong <82676488+Ao-senXiong@users.noreply.github.com> Date: Tue, 15 Aug 2023 20:18:50 -0400 Subject: [PATCH 6/7] Update checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java --- .../org/checkerframework/checker/optional/OptionalChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java index 4b14256342b..5c26a6f162a 100644 --- a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java +++ b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java @@ -10,7 +10,7 @@ * * @checker_framework.manual #optional-checker Optional Checker */ -// TODO: For a call to of Nullable, if the argument has type @NonNull, make the return type have +// TODO: For a call to `Optional#ofNullable`, if the argument has type @NonNull, make the return type have // type @Present. Make Optional Checker a subchecker of the Nullness Checker. @RelevantJavaTypes(Optional.class) public class OptionalChecker extends BaseTypeChecker { From 520fd3e1a7134df3036de9f7502a9f1fc7f6c367 Mon Sep 17 00:00:00 2001 From: Aosen Xiong Date: Tue, 15 Aug 2023 21:55:33 -0400 Subject: [PATCH 7/7] apply spotless --- .../checkerframework/checker/optional/OptionalChecker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java index 5c26a6f162a..40a5be5a339 100644 --- a/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java +++ b/checker/src/main/java/org/checkerframework/checker/optional/OptionalChecker.java @@ -10,8 +10,8 @@ * * @checker_framework.manual #optional-checker Optional Checker */ -// TODO: For a call to `Optional#ofNullable`, if the argument has type @NonNull, make the return type have -// type @Present. Make Optional Checker a subchecker of the Nullness Checker. +// TODO: For a call to `Optional#ofNullable`, if the argument has type @NonNull, make the return +// type have type @Present. Make Optional Checker a subchecker of the Nullness Checker. @RelevantJavaTypes(Optional.class) public class OptionalChecker extends BaseTypeChecker { /** Default constructor for OptionalChecker. */