Skip to content

Experiments#819

Draft
garydgregory wants to merge 281 commits intofix/read-onlyfrom
master
Draft

Experiments#819
garydgregory wants to merge 281 commits intofix/read-onlyfrom
master

Conversation

@garydgregory
Copy link
Copy Markdown
Member

No description provided.

ppkarwasz and others added 30 commits October 18, 2025 21:07
Commit 0698bd9 introduced convenient `AutoCloseable` usage for `ScratchBytes` and `ScratchChars`. However, it also introduced a **classloader memory leak risk** in application server environments by storing custom wrapper instances directly in a `ThreadLocal`.

This PR keeps the ergonomic `AutoCloseable` pattern while eliminating the classloader leak risk:

* Store **only primitive buffers** (`byte[]` / `char[]`) in the `ThreadLocal`, not custom classes.
* Introduce two types of `ScratchBytes` / `ScratchChars` instances:

  * **Global instance** (`buffer == null`) that fetches its buffer from the `ThreadLocal`.
  * **Reentrant instances** (`buffer != null`) for nested usage without interfering with shared buffers.

**Note:** While this revision keeps the readability of using the `AutoCloseable` API, it also introduces a performance regression compared to the original #801 design: retrieving a buffer now requires two `ThreadLocal` lookups: once in `get()` and once in `array()`. The original design avoided this overhead intentionally. Since these classes are package-private and used in performance-sensitive paths, we should carefully weigh the trade-off between API convenience and runtime cost.
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.30.8 to 4.30.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@f443b60...16140ae)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.30.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [org.apache.commons:commons-parent](https://github.com/apache/commons-parent) from 89 to 90.
- [Changelog](https://github.com/apache/commons-parent/blob/master/RELEASE-NOTES.txt)
- [Commits](https://github.com/apache/commons-parent/commits)

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-parent
  dependency-version: '90'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Using h1 and h2 as done here is needed to get Javadoc to work on Java
8, 11, 17, 21, and 25
- I checked with `mvn clean javadoc:javadoc`
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.30.9 to 4.31.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@16140ae...0499de3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.2 to 5.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@ea165f8...330a01c)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
garydgregory and others added 30 commits March 26, 2026 08:48
* [IO-856] Try test on all OSs for GitHub CI

* [IO-885] PathUtils.copyDirectory with NOFOLLOW_LINKS ignores symlinks

* [IO-885] PathUtils.copyDirectory with NOFOLLOW_LINKS ignores symlinks

More tests
…ead-only channel (#834)

* [IO-856] Try test on all OSs for GitHub CI

* [IO-883] ByteArraySeekableByteChannel should optionally configure a
read-only channel

- AbstractStreamBuilder.setOpenOptions(OpenOption...) now makes a
defensive copy of its input array.
- Add ByteArraySeekableByteChannel.Builder and builder().
- Add AbstractStreamBuilder.getByteArray().
* [IO-856] Try test on all OSs for GitHub CI

* BOMInputStream now fails-fast and tracks its ByteOrderMark as a final
…on (#836)

* [IO-856] Try test on all OSs for GitHub CI

* CloseShieldInputStreamTest now supports a custom close shield as a
function
Bumps `commons.bytebuddy.version` from 1.18.7 to 1.18.8.

Updates `net.bytebuddy:byte-buddy` from 1.18.7 to 1.18.8
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](raphw/byte-buddy@byte-buddy-1.18.7...byte-buddy-1.18.8)

Updates `net.bytebuddy:byte-buddy-agent` from 1.18.7 to 1.18.8
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](raphw/byte-buddy@byte-buddy-1.18.7...byte-buddy-1.18.8)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy
  dependency-version: 1.18.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: net.bytebuddy:byte-buddy-agent
  dependency-version: 1.18.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Show how to limit the amount of data read into a
ValidatingObjectInputStream by using a BoundedInputStream.
Show how to limit the amount of data read into a
ValidatingObjectInputStream by using a BoundedInputStream.
Show how to limit the amount of data read into a
ValidatingObjectInputStream by using a BoundedInputStream.
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.

8 participants