Aias00 opened a new issue, #7444:
URL: https://github.com/apache/shenyu/issues/7444

   ## Background
   
   `MemorySafeLRUMap` remains in `shenyu-common`, but a repository-wide 
reference search at `master` commit `67596c1d228b62da75cd0a0ecb47d0ac5d995384` 
finds only its declaration and dedicated tests. There are no repository-local 
production callers or configuration references.
   
   This is a maintenance simplification opportunity: the class retains an 
additional non-thread-safe cache implementation and public constructors without 
serving the current runtime. It is not a measured runtime performance 
improvement.
   
   ## Location
   
   - 
[MemorySafeLRUMap.java:33](https://github.com/apache/shenyu/blob/67596c1d228b62da75cd0a0ecb47d0ac5d995384/shenyu-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeLRUMap.java#L33).
   - 
[MemorySafeLRUMapTest.java:28](https://github.com/apache/shenyu/blob/67596c1d228b62da75cd0a0ecb47d0ac5d995384/shenyu-common/src/test/java/org/apache/shenyu/common/cache/MemorySafeLRUMapTest.java#L28).
   
   ## Proposed Scope
   
   - Assess whether downstream consumers still use this public `shenyu-common` 
API.
   - If compatibility requires it, deprecate the class with a release note and 
document migration before a later removal.
   - If removal is allowed by the project's compatibility policy, remove the 
implementation and its dedicated tests together.
   - Retain the active `WindowTinyLFUMap` implementation.
   - Keep `MemoryLimitCalculator` and `commons-collections4` unless a separate 
dependency/reference analysis proves they can be removed; repository-local 
non-use of this one class is insufficient evidence.
   - Avoid adding a replacement cache abstraction for a class with no current 
production callers.
   
   ## Verification
   
   ```bash
   rg -n 'MemorySafeLRUMap' -g '!**/target/**'
   ./mvnw test -pl shenyu-common
   ```
   
   Also inspect non-Java/reflection/config references and run the affected 
module's Checkstyle and RAT checks when implementing the change.
   
   ## Acceptance Criteria
   
   - [ ] Downstream/public API compatibility has been considered explicitly.
   - [ ] The class is deprecated with migration guidance, or removed at a 
release where that API removal is acceptable.
   - [ ] Dedicated tests are retained for deprecation or removed with the class.
   - [ ] Active cache and memory-limit behavior remains unchanged.
   - [ ] No replacement abstraction or unjustified dependency removal is 
introduced.
   
   ## Validation And Related Issues
   
   Severity: Low. Confidence: high for repository-local non-use; downstream use 
remains unknown.
   
   An independent reviewer confirmed the reference search. Targeted 
`UriUtilsTest,MemorySafeLRUMapTest` execution passed 7 tests with zero failures.
   
   #7309 and #7377 removed the different unused `MemorySafeWindowTinyLFUMap` 
implementation. Their scope did not include `MemorySafeLRUMap`. #4020 discusses 
historical LRU cache usage and does not establish a present production caller 
for this class. Searches across open/closed issues found no current retirement 
task for `MemorySafeLRUMap`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to