Skip to content

Commit

Permalink
fix: ensure sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylong committed Feb 11, 2025
1 parent 5c0a06f commit bf66fd1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ private void storeEntireYearToCache(int year, CvesNvdPojo cves, CacheProperties
int size = cves.vulnerabilities.size();
MessageDigest md = getDigestAlg();

//sort the cve vulnerabilities by cveId
// sort the cve vulnerabilities by cveId
cves.vulnerabilities.sort(Comparator.comparing(v -> v.getCve().getId()));

// save vulnerabilities into cache
Expand Down Expand Up @@ -439,7 +439,7 @@ private void saveRecentlyModifiedCacheFile(List<DefCveItem> recentlyChanged, Cac
}
// ensure we do not include a slice more than 8 days old
removeOutdatedCves(vulnerabilities);

vulnerabilities.sort(Comparator.comparing(v -> v.getCve().getId()));
int recentSize = vulnerabilities.size();
CveApiJson20 data = new CveApiJson20(recentSize, 0, recentSize, FORMAT, VERSION, lastChanged, vulnerabilities);

Expand Down

0 comments on commit bf66fd1

Please sign in to comment.