use of com.google.gerrit.entities.FixSuggestion in project gerrit by GerritCodeReview.
the class Fixes method parse.
@Override
public FixResource parse(RevisionResource revisionResource, IdString id) throws ResourceNotFoundException {
String fixId = id.get();
ChangeNotes changeNotes = revisionResource.getNotes();
List<RobotComment> robotComments = commentsUtil.robotCommentsByPatchSet(changeNotes, revisionResource.getPatchSet().id());
for (RobotComment robotComment : robotComments) {
for (FixSuggestion fixSuggestion : robotComment.fixSuggestions) {
if (Objects.equals(fixId, fixSuggestion.fixId)) {
return new FixResource(revisionResource, fixSuggestion.replacements);
}
}
}
throw new ResourceNotFoundException(id);
}
Aggregations