Taro L. Saito 83466aa5e0
Suppress AccessController deprecation warning for Java 17+ (#682)
* 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>
2025-07-20 11:59:59 -07:00
..
2015-05-18 16:44:49 +09:00