mirror of
https://github.com/xerial/snappy-java.git
synced 2025-11-03 04:55:48 +01:00
* 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>