Skip to content

Revert AtomicInteger changes - #6592

Open
Amemeda wants to merge 2 commits into
apache:mainfrom
Amemeda:6542-revert-atomic-int
Open

Amemeda wants to merge 2 commits into
apache:mainfrom
Amemeda:6542-revert-atomic-int

Conversation

@Amemeda

@Amemeda Amemeda commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Revert AtomicInteger changes from #3219. AtomicInteger cur is now volatile int cur in SeekableByteArrayInputStream.java, references and usages in class also reverted.

Keeps the NotThreadSafe tag on the class.

Closes #6542

@NotThreadSafe
public class SeekableByteArrayInputStream extends InputStream {

private final byte[] buffer;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this field was volatile in #3219, should it be reverted to volatile?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you might be able to leave the final modifier.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

updated in cb03ffd

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It can stay volatile, but there was a discussion previously about possibly leaking the buffer, so it's contents aren't guaranteed to be fixed: #3219 (comment)

It's kind of a separate issue, though.

@Amemeda
Amemeda marked this pull request as ready for review October 15, 2026 19:28

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

SeekableByteArrayInputStream - revert #3219?

3 participants