Skip to content

Commit

Permalink
javadoc and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nimakarimipour committed Oct 3, 2024
1 parent 979329a commit f569b9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public NullAwayError(

@Override
protected Set<Fix> computeFixesFromAnnotations(Set<AddAnnotation> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Fix> computeFixesFromAnnotations(Set<AddAnnotation> annotations);

public Set<Fix> getFixes() {
Expand Down

0 comments on commit f569b9f

Please sign in to comment.