Skip to content

Fix unstable connectable ordering#3786

Open
quinarygio wants to merge 10 commits intomainfrom
3674-unstable-connectable-ordering
Open

Fix unstable connectable ordering#3786
quinarygio wants to merge 10 commits intomainfrom
3674-unstable-connectable-ordering

Conversation

@quinarygio
Copy link
Contributor

@quinarygio quinarygio commented Feb 18, 2026

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

Fixes #3674

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Implementations of Identifiable interface should implement the new getSortIndex method.

Other information:

flo-dup and others added 3 commits January 16, 2026 11:47
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
@quinarygio quinarygio marked this pull request as draft February 18, 2026 18:22
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
@alicecaron alicecaron moved this from TODO to Waiting for review in Release 03/2026 Feb 26, 2026
Comment on lines +351 to +356
return exportOptions.isSorted() ? StreamSupport.stream(identifiables.spliterator(), false)
.sorted(Comparator.comparing(Identifiable::getId))
.collect(Collectors.toList())
: identifiables;
: StreamSupport.stream(identifiables.spliterator(), false)
.sorted(Comparator.comparing(Identifiable::getSortIndex))
.collect(Collectors.toList());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the comparator is different between the 2 alternatives. It would be cleaner to choose the comparator first and then to execute the processing with it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

/**
* Get the sort index of the object.
*/
long getSortIndex();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test should be added in the TCK to ensure that the custom IIDM implementations handle it correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

quinarygio and others added 5 commits February 27, 2026 15:38
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
Signed-off-by: CARON Alice <alice.caron@rte-france.com>
@alicecaron alicecaron requested a review from olperr1 March 3, 2026 10:56
@alicecaron alicecaron assigned alicecaron and unassigned quinarygio Mar 3, 2026
@alicecaron alicecaron self-requested a review March 3, 2026 10:56
@alicecaron alicecaron force-pushed the 3674-unstable-connectable-ordering branch from 2cd41c5 to e61c93e Compare March 3, 2026 11:04
@alicecaron alicecaron marked this pull request as ready for review March 3, 2026 11:07
alicecaron
alicecaron previously approved these changes Mar 3, 2026
@alicecaron alicecaron added the Breaking Change API is broken label Mar 3, 2026
Signed-off-by: CARON Alice <alice.caron@rte-france.com>
@alicecaron alicecaron force-pushed the 3674-unstable-connectable-ordering branch from e61c93e to c15bfe5 Compare March 3, 2026 13:39
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

@alicecaron alicecaron self-requested a review March 5, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking Change API is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unstable connectable ordering

4 participants