From 9a6ce7bb965967ddd5cdd2e40998343dedbf5632 Mon Sep 17 00:00:00 2001 From: soumyaPrakashB <107208234+soumyaPrakashB@users.noreply.github.com> Date: Tue, 20 Dec 2022 19:07:20 +0530 Subject: [PATCH] Nullable annotation added in constructor argument. In one of the constructors of the AggregationOptions class, Nullable annotation is missing for an argument. This cursor parameter canbe null, however as it is not marked as Nullable, in some projects the sonar quality check is failing stating the reason "Nullness of parameters should be guaranteed." --- .../data/mongodb/core/aggregation/AggregationOptions.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOptions.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOptions.java index e4ef7a7e49..7626f07a94 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOptions.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOptions.java @@ -33,6 +33,7 @@ * @author Christoph Strobl * @author Mark Paluch * @author Yadhukrishna S Pai + * @author Soumya Prakash Behera * @see Aggregation#withOptions(AggregationOptions) * @see TypedAggregation#withOptions(AggregationOptions) * @since 1.6 @@ -65,7 +66,7 @@ public class AggregationOptions { * @param explain whether to get the execution plan for the aggregation instead of the actual results. * @param cursor can be {@literal null}, used to pass additional options to the aggregation. */ - public AggregationOptions(boolean allowDiskUse, boolean explain, Document cursor) { + public AggregationOptions(boolean allowDiskUse, boolean explain, @Nullable Document cursor) { this(allowDiskUse, explain, cursor, null); }