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

Fixes #2607: apoc.export.json.data JSON format missing brace #2698

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

vga91
Copy link
Collaborator

@vga91 vga91 commented Apr 4, 2022

Fixes #2607

reporter.done() and reporter.getTotal() have to be executed after jsonGenerator.close()

@jexp jexp added the core-functionality Adding new procedure, function or signature to APOC core label Apr 7, 2022
@conker84 conker84 added the 4.4 label Apr 11, 2022
@Lojjs Lojjs self-assigned this Apr 19, 2022
Comment on lines -54 to 53
} finally {
writer.close();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to remove the write.close()? Keeping it but still moving the two reporter lines will also solve the issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The writer.close() should be unnecessary, because the WriterBasedJsonGenerator.close(), called by the getJsonGenerator(writer), has a writer.close();, so we can remove it because of try-with-resource.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, sounds like it should be fine then :) Just wanted to check so it wasn't unintentional

Copy link
Contributor

@Lojjs Lojjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks OK but I'm not sure we should really remove the writer.close

@Lojjs Lojjs merged commit 2caeb6b into neo4j-contrib:4.4 Apr 20, 2022
Lojjs pushed a commit that referenced this pull request Apr 20, 2022
Lojjs pushed a commit that referenced this pull request Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.4 core-functionality Adding new procedure, function or signature to APOC core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apoc.export.json.data JSON format missing brace
4 participants