-
Notifications
You must be signed in to change notification settings - Fork 57
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
Improve the SUSHI output String buffer #713
Conversation
It now automatically increases size if the current SUSHI output line is larger than the buffer initial size, preventing an IndexOutOfBoundsException being thrown. The StringBuilder is reused in the same way the old byte array was. to preserve performance. It solves #712.
Is it possible to create a simple test to describe the expected behaviour? The code does seem cleaner with these fixes. |
Sure. I've refactored the code a bit to facilitate testing and have added simple tests for MySushiHandler. Is it fine like that? |
That does look better! I have another PR that refines those tests slightly: https://github.com/qligier/fhir-ig-publisher/pull/1 Could you take a look? |
Thank you for improving this PR, I've merged your commit. |
This was tested locally using the compiled CLI jar to confirm that SUSHI output is still generated and matches previous runs.
|
It now automatically increases size if the current SUSHI output line is larger than the buffer initial size, preventing an IndexOutOfBoundsException being thrown. The StringBuilder is reused in the same way the old byte array was. to preserve performance. It solves #712.