* Suppress AccessController deprecation warning
AccessController has been deprecated for removal since Java 17 as part of JEP 411.
Since snappy-java needs to maintain compatibility with Java 8+, we cannot remove
the AccessController.doPrivileged calls. This commit adds @SuppressWarnings("removal")
to suppress the deprecation warning while maintaining backward compatibility.
The AccessController calls are used to bypass SecurityManager restrictions when
cleaning DirectByteBuffers. In Java 17+, these calls effectively just run the
action directly since SecurityManager is being phased out.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Apply @SuppressWarnings to specific methods instead of class level
Based on review feedback, narrowed the scope of @SuppressWarnings("removal")
annotations to only the specific methods and code blocks that use AccessController,
rather than applying it at the class level. This approach:
- Reduces the scope of the suppression
- Avoids hiding other potential deprecation warnings
- Follows best practices for targeted warning suppression
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
currently we have written a lambda (turns into anonymous class) which
invokes a MethodHandle for the java.util.zip.CRC32C constructor as the
Supplier<Checksum> implementation.
This has 2 layers of misdirection. The Supplier implementation spun up
by the jvm calls the anonymous lambda class, which then calls the
MethodHandle invoke. This leads to stack traces like:
use LambdaMetafactory to generate a Supplier<Checksum> which calls the
java.util.zip.CRC32C
Co-authored-by: bo8979 <bo8979@cerner.com>
* ppc64-le (Fix): Use an LTS-version of cross-compiler for Linux ppc64-le
* Update native libraries for 4764a47e75ed9cdccdf6959e7ade81770ff6f4dd (#517)
Co-authored-by: xerial <xerial@users.noreply.github.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: xerial <xerial@users.noreply.github.com>
* Validate chunk size to be within a configured maximum
* Add constructors to have max size configurable
* Code cleanup
* Use 512MB for consistency
---------
Co-authored-by: Taro L. Saito <leo@xerial.org>
* Fix spacing with comment
* Updated code
* Test: Added Assume catches for each failed tests
* Added and implemented separate method to check if System CI is false
* Added a null check to ensure assumingCIIsFalse() method runs locally as well
* Changed assumeTrue to assumeFalse
* Fixed integer overflow by checking if bytesize is bigger than input length, then throwing exception
* Fixed integer overflow by checking if bytesize is bigger than input length, then throwing exception
* Fixed integer overflow by checking if bytesize is bigger than input length, then throwing exception
* improved error messages by adding new error enum INPUT_TOO_LARGE in SnappyErrorCode.java, and added happy and sad cases in SnappyTest.java
* fixed mispelling: validArrayInputLength --> isInvalidArrayInputLength
* switched SnappyError into ILLEGAL_ARGUMENT in SnappyErrorCode.java and Snappy.java and fixed a typo in error comment
* Fix buffer size boundary tests
* Remove negative array size tests
* updated comments for unit test
---------
Co-authored-by: Taro L. Saito <leo@xerial.org>
* asserted chunksize should be in the bounds of 0-java.outofmmeoryexception
* asserted chunksize should be in the bounds of 0-java.outofmmeoryexception
* https://github.com/xerial/snappy-java-ghsa-qcwq-55hx-v3vh/pull/2
* advisory-fix-3
* added and changed method name for happy and sad cases in SnappyTest.java
* removed expected error for happy case in unit testing
* added another unit test case in SnappyTest.java and fixed comments in SnappyInputStream.java
* switched SnappyError to INVALID_CHUNK_SIZE
* Updated unit tests
* Resolved conflicts with another PR merge
* Fixed integer overflow by checking if multiplication result is smaller than original value
* Fixed integer overflow by checking if multiplication result is smaller than original value
* Fixed integer overflow by checking if multiplication result is smaller than original value
* imporved error messages and added happy and sad cases for unit test in SnappyTest.java
* switched SnappyError into ILLEGAL_ARGUMENT in SnappyErrorCode.java and Snappy.java
* wrote new and updated unit test methods
* updated comments in SnappyTest.java
* Fixed and updated unit tests in SnappyTest.java
* Feature: Use LTS cross-compiler for Linux armv6/armv7 to use glibc 2.28
* Use softfp for armv7
* Fix armv6 config
* Update native libraries
---------
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* ByteBuffer.limit() compiled with JDK9+ shows java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer; error in JDK8
* Set --release 8 JDK option
* Do not use --release 8 option in JDK8
* Upgrade to snappy-1.1.9
* Add sbt-dynver
* Fix script so as not to requrie perl
* Upgrade bitshuffle to 0.5.1
* use bitshuffle 0.3.4, which can be compiled without errors
* Add native library build workflow