powsybl / powsybl-core

A framework to build power system oriented software
https://www.powsybl.org
Mozilla Public License 2.0
124 stars 40 forks source link

Fix area boundary auto-removal with merged and detached Networks #3081

Closed jeandemanged closed 3 months ago

jeandemanged commented 3 months ago

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

What is the current behavior?

In #2955 listeners were implemented to automatically delete area boundaries when the undelying equipment is removed from the network (e.g. DanglingLine removal). This was done using "cleanup" listeners. However when performing network merge or detach, the listeners are lost / not transfered to the new root network of the Areas.

What is the new behavior (if this is a feature change)? The "cleanup" listeners are properly moved to the new root Network when merging and detaching.

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

Other information:

This is very similar to #3076, although here it is not about iIDM extensions. I originally wanted to add notification mechanism for merging and detaching, but obviously this wouldn't work because manipulating listeners within listeners isn't the right approach (ConcurrentModificationException). I made few specific code dedicated to Area only. When iIDM will be improved to deal with equipment removal & cleanup in a generic way, this would be revisited.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud