Skip to content

Ensure unique keys inside EntryMapAdapter#254

Open
kwin wants to merge 1 commit into
mainfrom
bugfix/ensure-unique-keys-in-entrymapadapter
Open

Ensure unique keys inside EntryMapAdapter#254
kwin wants to merge 1 commit into
mainfrom
bugfix/ensure-unique-keys-in-entrymapadapter

Conversation

@kwin
Copy link
Copy Markdown
Contributor

@kwin kwin commented May 11, 2026

This closes #253

@kwin kwin requested a review from cstamas May 11, 2026 19:07
@kwin kwin force-pushed the bugfix/ensure-unique-keys-in-entrymapadapter branch from efccaea to 1a5adb5 Compare May 11, 2026 19:11
@sonarqubecloud
Copy link
Copy Markdown

@cstamas
Copy link
Copy Markdown
Member

cstamas commented May 11, 2026

Isn't this just fixing the symptom, and at the same time hiding the possible problem of double loaded component?

@kwin
Copy link
Copy Markdown
Contributor Author

kwin commented May 11, 2026

I think instead of silently ignoring as before this logs duplicates now proactively. I fail to see how this is worse than before.

@cstamas
Copy link
Copy Markdown
Member

cstamas commented May 27, 2026

Logs, ok, but does it also remove duplicates? As if removes, this is breaking change: components (duplicates) may be now gone and nothing user can do about that.

@cstamas cstamas added this to the 1.0.1 milestone May 27, 2026
@cstamas cstamas added the enhancement New feature or request label May 27, 2026
@kwin
Copy link
Copy Markdown
Contributor Author

kwin commented May 27, 2026

Relying on duplicates within a map is clearly violating the API contract so I don't think we need to support it (even if previously this was working by accident).

@cstamas
Copy link
Copy Markdown
Member

cstamas commented May 27, 2026

Well, IF sisu did this since its inception, then WE CANNOT fix this in 1.0.1. So, I'd rather change this PR to log warnings but do not alter behaviour in any other way. Moreover, I have concerns this is by design.

Also, are you sure this is Sisu and not Plexus? From where does duplicates come from? One important difference between Sisu and Plexus-Shim is that former is "flat" while latter does factor in visibility by Realms. So, it is quite possible that with this change you'd break something somewhere in some Plexus component...

So yes, Map interface says that, but I think this is intentional design choice, after all, you do have duplicates in your system, and Sisu is not Realm aware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EntryMapAdapter based on NamedIterableAdapter may violate Map contract (by having duplicate keys)

2 participants