From f569b9f4e58bc9f67d9bf3c7c89547506efd6a31 Mon Sep 17 00:00:00 2001 From: nimakarimipour Date: Thu, 3 Oct 2024 17:29:17 -0500 Subject: [PATCH] javadoc and comment --- .../cs/riple/core/checkers/nullaway/NullAwayError.java | 2 ++ .../edu/ucr/cs/riple/core/registries/index/Error.java | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/annotator-core/src/main/java/edu/ucr/cs/riple/core/checkers/nullaway/NullAwayError.java b/annotator-core/src/main/java/edu/ucr/cs/riple/core/checkers/nullaway/NullAwayError.java index 0597269c..6a105f41 100644 --- a/annotator-core/src/main/java/edu/ucr/cs/riple/core/checkers/nullaway/NullAwayError.java +++ b/annotator-core/src/main/java/edu/ucr/cs/riple/core/checkers/nullaway/NullAwayError.java @@ -51,6 +51,8 @@ public NullAwayError( @Override protected Set computeFixesFromAnnotations(Set annotations) { + // In NullAway inference, each annotation is examined individually. Thus, we create a separate + // fix instance for each annotation. return annotations.stream() .map(annot -> new Fix(annot, messageType)) .collect(Collectors.toSet()); diff --git a/annotator-core/src/main/java/edu/ucr/cs/riple/core/registries/index/Error.java b/annotator-core/src/main/java/edu/ucr/cs/riple/core/registries/index/Error.java index bd5ffac1..9705256b 100644 --- a/annotator-core/src/main/java/edu/ucr/cs/riple/core/registries/index/Error.java +++ b/annotator-core/src/main/java/edu/ucr/cs/riple/core/registries/index/Error.java @@ -63,6 +63,16 @@ public Error( this.resolvingFixes = computeFixesFromAnnotations(annotations); } + /** + * Creates a set of {@link Fix} instances from the provided set of annotations that resolve the + * error. A fix instance can contain multiple annotations, which are grouped for evaluation. A fix + * is an input to the search algorithm, and if approved, all its contained annotations will be + * applied to the source code. + * + * @param annotations A set of annotations that, if fully applied, resolve the error. Each fix can + * contain a subset of these annotations. + * @return A set of fix instances, each representing a possible group of annotations. + */ protected abstract Set computeFixesFromAnnotations(Set annotations); public Set getFixes() {