Skip to content

Map Of Countries 1.5.2: use the model of the graph being laid out - #372

Merged
mbastian merged 1 commit into
master-forgefrom
fix/map-of-countries-graph-model
Nov 8, 2026
Merged

mbastian merged 1 commit into
master-forgefrom
fix/map-of-countries-graph-model

Conversation

@mbastian

@mbastian mbastian commented Nov 8, 2026

Copy link
Copy Markdown
Member

Found by the SPI contract tests of gephi-plugins-tests (LayoutContractTest), run against Gephi 0.11.4.

ShapeFileReader.read(Graph gr, ...) ignored the graph it was given: it looked up the GraphController and took the current workspace's graph model, then used its factory to create the map nodes. When the layout runs on a graph that is not in the current workspace (a script, a test), that model is null and GeoLayout.goAlgo() throws NullPointerException: ... "gm" is null. It now uses gr.getModel(), the model of the graph being laid out. In the user interface this is the same model, so behavior there doesn't change. Removed the two imports that became unused. Version 1.5.1 → 1.5.2.

Verified: the contract tests (gephi-plugins-tests 1.1.1) now run the layout on every graph. The only finding left is that the layout adds the map's nodes and edges, which is by design and becomes a warning in the next gephi-plugins-tests release. Short-lived branch off master-forge, 2 files.

ShapeFileReader looked up the current workspace's graph model through the GraphController instead of using the graph it was given, so the layout threw a NullPointerException when run on a graph that is not in the current workspace (a script, a test). Use the model of the given graph. Version 1.5.2.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mbastian
mbastian merged commit 869d224 into master-forge Nov 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant