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

Add option to decompress() for variable length #15618

Merged
merged 2 commits into from Aug 10, 2022

Conversation

mikezhang1234567890
Copy link
Contributor

@mikezhang1234567890 mikezhang1234567890 commented Jul 26, 2022

In StringBuilder and StringBuffer, decompress() usually only works up
to the current data length. However, methods like move() can place
characters past the current length, so add a parameter to decompress()
in order to specify the number of characters that are decompressed.

Fixes issues with insert() method when compact strings is enabled and
the caller has compressed storage and the inserted object is not
compressed.

fyi: @pshipton

@pshipton
Copy link
Member

pshipton commented Jul 26, 2022

This was tested internally, I don't see any point it running testing again. @keithc-ca any concerns before this is merged?

@mikezhang1234567890
Copy link
Contributor Author

mikezhang1234567890 commented Jul 27, 2022

Updated PR to pass a length variable to decompress instead. Internal testing at job/Pipeline-Build-Test-Personal/13695/

@mikezhang1234567890 mikezhang1234567890 changed the title Use full array capacity for decompress() instead of just length Add option to decompress() for variable length Jul 27, 2022
@mikezhang1234567890
Copy link
Contributor Author

@KeithCa updated the PR to address the review comments, can you take another look please?

Internal testing done here.

Copy link
Contributor

@keithc-ca keithc-ca left a comment

Choose a reason for hiding this comment

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

I'll review StringBuilder once I'm satisfied with the changes to StringBuffer (I expect them to be similar).

@mikezhang1234567890
Copy link
Contributor Author

Updated PR to address comments. Also fixed some comments mixing up StringBuilder/StringBuffer and the trailing whitespace.

In StringBuilder and StringBuffer, decompress() usually only works up
to the current data length. However, methods like move() can place
characters past the current length, so add a parameter to decompress()
in order to specify the number of characters that are decompressed.

Fixes issues with insert() method when compact strings is enabled and
the caller has compressed storage and the inserted object is not
compressed.

Also corrects some spelling of variable names and fixes some comments
mixing up StringBuilder and StringBuffer.

Signed-off-by: Mike Zhang <mike.h.zhang@ibm.com>
Signed-off-by: Mike Zhang <mike.h.zhang@ibm.com>
@keithc-ca
Copy link
Contributor

jenkins test sanity zlinux jdk8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants