Skip to content

Instantly share code, notes, and snippets.

@thomasfenaroli-wf
Created October 17, 2025 15:47
Show Gist options
  • Save thomasfenaroli-wf/9c7d506f2b0eb2f2f156411c6d911a1e to your computer and use it in GitHub Desktop.
Save thomasfenaroli-wf/9c7d506f2b0eb2f2f156411c6d911a1e to your computer and use it in GitHub Desktop.
@Override
public Unit process() {
Set<Method> annotatedMethods = reflections.getMethodsAnnotatedWith(annotationClass);
Set<Field> annotatedFields = reflections.getFieldsAnnotatedWith(annotationClass);
List<DataSet> dataSets = Sets.union(annotatedFields, annotatedMethods).stream()
.map(this::buildDataSet)
.sorted(Comparator.comparing(DataSet::getStaleAt))
.toList();
Multimap<Author, StaleDatasetRow> authorToStaleDatasetRows = ArrayListMultimap.create();
for (DataSet dataSet : dataSets) {
for (StaleDatasetRow staleDatasetRow : dataSet.toReportRowIfStale()) {
authorToStaleDatasetRows.put(dataSet.getAuthor(), staleDatasetRow);
}
dataSet.pageIfExpired();
}
maybeSendStalenessReport(authorToStaleDatasetRows);
return Unit.unit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment