refactor: use empty array singletons#799
Open
ngmr wants to merge 2 commits into
Open
Conversation
26405cf to
63d6c0e
Compare
- Introduced Arrays.emptyArray() utility method with thread-safe caching using ClassValue - Replaced manual empty array allocations (new Type[0]) across 64 files in yoko-core, yoko-rmi-impl, testify-iiop, and yoko-verify - Added comprehensive test suite for Arrays.emptyArray() with 16 tests covering thread safety, caching behavior, and ClassValue semantics - Added documentation explaining GC safety of ClassValue-based caching - Substantive lines added: 672, lines removed: 154 Co-authored-by-AI: IBM Bob 1.0.4 (Claude 3.5 Sonnet)
- Add NO_STRINGS constant to Arrays utility class for common empty String array usage - Replace emptyArray(String.class) calls with NO_STRINGS constant across codebase - Update Arrays.emptyArray() to use ClassValue<Object> instead of ClassValue<Object[]> - Add assertion to prevent primitive types in emptyArray() method - Update ArraysTest to verify NO_STRINGS constant behavior - Refactor 21 files across testify-iiop, yoko-core, yoko-rmi-impl, yoko-util, and yoko-verify modules - Lines added: 87, lines removed: 68 (ignoring whitespace) Co-authored-by: Joe Chacko <chackoj@uk.ibm.com> Co-authored-by-AI: IBM Bob 1.0.4
63d6c0e to
323e8ef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
using ConcurrentHashMap for system classes and SoftReference for custom classes
in yoko-core, yoko-rmi-impl, testify-iiop, and yoko-verify
covering thread safety, caching behavior, and custom class handling
Co-authored-by-AI: IBM Bob 1.0.4