Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOTImporter.setVertexWithAttributesFactory gets called with an empty string #1070

Open
asarkar opened this issue Apr 2, 2021 · 1 comment

Comments

@asarkar
Copy link

asarkar commented Apr 2, 2021

 * JGraphT version: 1.5.1
 * Java version (java -version)/platform:  11

I apologize if this issue has been raised before but I didn't find anything similar from Google search or by searching the issues in this repo.

Issue
Given the following graph:

strict digraph G {
  root="commons/master";
  "auth/master" [ comments="{\"ancestors\":[\"commons/master\",\"subscription/master\"]}" ];
  "commons/master" [ comments="{\"ancestors\":[]}" ];
  "subscription/master" [ comments="{\"ancestors\":[\"commons/master\"]}" ];
  "gateway/master" [ comments="{\"ancestors\":[\"auth/master\",\"commons/master\",\"subscription/master\"]}" ];
  "datetime/master" [ comments="{\"ancestors\":[\"commons/master\",\"subscription/master\"]}" ];
  "browse/master" [ comments="{\"ancestors\":[\"commons/master\"]}" ];
  "subscription/master" -> "auth/master";
  "commons/master" -> "subscription/master";
  "auth/master" -> "gateway/master";
  "subscription/master" -> "datetime/master";
  "commons/master" -> "browse/master";
}

DOTImporter.setVertexWithAttributesFactory gets called with an empty string for vertex, and no attributes. There is no way for the client to create a vertex from an empty string and returning null causes an NPE.

Expected behaviour
DOTImporter.setVertexWithAttributesFactory should not get called with an empty string for vertex.

Other information
FWIW, client code is in Kotlin.

@asarkar
Copy link
Author

asarkar commented Apr 2, 2021

Looks like this happens when regular parsing fails due to a code bug. Parsing vertex "auth/master" was throwing an exception, and that caused the vertexWithAttributesFactory to be called with an empty string.

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

No branches or pull requests

1 participant