Fix merging networks with a tie line and a dangling line of same pairing key #2740
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Bug fix (+ logs)
What is the current behavior?
When merging a network having a tie line between 2 dangling lines of pairing key
k
with another network having a sole dangling line of pairing keyk
, we try to create a tie line between the 2 networks, which prevents the merging (an Exception is thrown).+ Nothing indicates when dangling lines cannot be merged.
What is the new behavior (if this is a feature change)?
When merging a network having a tie line between 2 dangling lines of pairing key
k
with another network having a sole dangling line of pairing keyk
, we don't try to create a tie line between the 2 networks and the merge succeeds.+ Logs are added when dangling lines cannot be merged.
Does this PR introduce a breaking change or deprecate an API?
Other information:
This PR introduces a new method (
TieLineUtil.findCandidateDanglingLines
) to identify the dangling lines which are candidate to become tie lines when merging the network with another.To limit the impact of this PR (to avoid breaking changes), which will be introduced in a bug fix release, we didn't refactor the whole dangling lines matching. This will be the object of another PR (see #2741).