Conversation
- DefaultSchemaMigration.entityReplacement now returns Optional<EntityMatch> (return type was mismatched with interface despite @CompileStatic due to Groovy generic erasure; would ClassCast at runtime on any call site using .map(EntityMatch::getMatch)) - UnmigratedCell returns Optional.empty() when lookup misses, rather than wrapping a null match inside EntityMatch.of() - AbstractMergeCellMigrator: fix two multipleCandidates flags that used size() > 0 (always true) instead of size() > 1 - minor fixes ING-5131
|
This PR cannot be merged yet because a required label is missing: |
There was a problem hiding this comment.
Pull request overview
Fixes alignment migration entity replacement handling by consistently returning Optional<EntityMatch> and correcting join-context migration logic so multi-candidate/join flags are computed correctly. This addresses a runtime ClassCast risk and improves behavior when no replacement exists.
Changes:
- Update
DefaultSchemaMigrationandUnmigratedCellto returnOptional<EntityMatch>correctly (and returnOptional.empty()on lookup misses). - Fix incorrect “multiple candidates/sources” conditions in
AbstractMergeCellMigrator(size() > 0→size() > 1) and clean up related variable naming. - Minor log/message escaping and test comment corrections.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/internal/EntityReplacementVisitor.java | Javadoc correction for mismatch detection helper. |
| common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/AbstractGeotoolsFilter.java | Escape apostrophes for MessageFormat-formatted SimpleLog messages. |
| common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/UnmigratedCell.java | Return Optional.empty() when no mapping exists; wrap mappings via EntityMatch.of. |
| common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/DefaultSchemaMigration.groovy | Align return type with AlignmentMigration (Optional<EntityMatch>) and avoid null matches. |
| common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/AbstractMigration.groovy | Log message updated to print the matched entity (EntityMatch.match). |
| common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/AbstractMergeCellMigrator.java | Correct multi-candidate/source conditions and rename transferedSource → transferredSource. |
| common/plugins/eu.esdihumboldt.hale.common.align.merge.test/src/eu/esdihumboldt/hale/common/align/merge/test/impl/JoinRetainConditionsTest.groovy | Update comments to match expected propagation target. |
| common/plugins/eu.esdihumboldt.hale.common.align.merge.test/src/eu/esdihumboldt/hale/common/align/merge/test/impl/DefaultMergeCellMigratorTest.groovy | Update comment to reflect expected absence of a condition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
hale studio builds for this pull request: Build triggered for commit 7e789ba. |
ING-5131