Repository navigation
Bounding Diameters 0.0.2: don't fail on an empty graph - #363
Merged
Merged
Conversation
The statistics looked for the giant component of a graph with no component, which threw an ArrayIndexOutOfBoundsException, and the report then read results that were never set. Return early with empty results. Version 0.0.2. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Found by the SPI contract tests of gephi-plugins-tests (
StatisticsContractTest), run against Gephi 0.11.4.Running the statistics on an empty graph looked for the giant connected component of a graph without any, giving
ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0frominitializeStartValues(). The report then read eccentricities that were never allocated.execute()now returns early on a graph with no nodes, with empty results (sogetReport()works).Verified: the empty-graph contract test (gephi-plugins-tests 1.1.1) now passes. The one remaining finding, "needs a StatisticsUI", is not a plugin bug: the UI lives in the sibling
BoundingDiametersUImodule, which the test harness does not put on the classpath yet.Short-lived branch off
master-forge: the plugin's own branch has unmerged commits, so this is just the 2 files.