Skip to content

Upgrade curation library#1535

Merged
cmpich merged 2 commits intostagefrom
upgradeCurationLibrary
Mar 25, 2026
Merged

Upgrade curation library#1535
cmpich merged 2 commits intostagefrom
upgradeCurationLibrary

Conversation

@cmpich
Copy link
Copy Markdown
Contributor

@cmpich cmpich commented Mar 25, 2026

No description provided.

@cmpich cmpich requested a review from a team as a code owner March 25, 2026 14:54
@claude
Copy link
Copy Markdown

claude bot commented Mar 25, 2026

Code Review — PR #1535

Summary: Library upgrade from v0.47.6 to v0.47.9, adapting to API changes (TransgenicAlleleDTOTransgenicAlleleDocument, construct access pattern change), adding construct component fields to allele search, and a new species null check.

Bug: getFirst() on potentially empty/null construct list

TransgenicAlleleCurationIndexer.java line ~104:

Construct constructObj = da.getConstructList().getFirst();

The old code called da.getConstruct() (single object). The new code calls da.getConstructList().getFirst(), which will throw:

  • NullPointerException if getConstructList() returns null
  • NoSuchElementException if the list is empty

There is no guard before this call. Consider adding a null/empty check (similar to the existing da == null check above), or using a safer access pattern.

Potential NPE chain on species access

Species species = da.getAllele().getTaxon().getSpecies();

If da.getAllele() or da.getAllele().getTaxon() is null, this will throw a NullPointerException. The existing null check only covers da itself. If the upstream data guarantees these are never null, this is fine — but it's worth confirming given this is indexer code processing bulk data.

Rest of the changes look correct

  • The new construct component fields in AlleleSearchResultDocument and their population in AlleleSearchResultConverter are straightforward additions with proper null/empty guards.
  • Method reference refactors (NameSlotAnnotation::getDisplayText, Objects::nonNull) are clean.
  • Import changes are cosmetic (wildcard imports).

@cmpich cmpich merged commit 296cca5 into stage Mar 25, 2026
5 checks passed
@cmpich cmpich deleted the upgradeCurationLibrary branch March 25, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants