DaanHoogland opened a new pull request, #14564: URL: https://github.com/apache/cloudstack/pull/14564
Depends on https://github.com/apache/cloudstack/pull/14562 ### Description Stack for #12316 (StorageManager tech debt), one PR per item of the issue checklist, review only the top commit of each: 1. #13598: unused methods, fields and return values 2. never-thrown checked exceptions 3. raw types and unchecked casts 4. never-used parameters 5. remaining trivial warnings 6. deprecated `SearchCriteria.addAnd` usages **This PR (6/6)** replaces the deprecated `SearchCriteria.addAnd()` calls in `StorageManagerImpl` (10 warnings → 0) with `SearchBuilder`s declared once in `configure()`, like the existing `LocalStorageSearch`: - `createCapacityEntry`: `PoolCapacitySearch` (`hostOrPoolId`, `dataCenterId`, `capacityType`) - `getStoragePoolUsedStatsInternal`: `PoolUsedStatsSearch`. Optional zone/pod/cluster/id filters are only set when given; unset conditions are dropped from the WHERE clause, as before. The criteria are now only built in the branch that actually searches: when a single `poolId` is given, the old code built them and then used `findById` anyway. - `getSecondaryStorageUsedStats`: removes a `SearchCriteria` that was built but never used. After this stack, the only javac warnings left in these files are the 4 `Config` deprecations, which #14467 handles. Fixes: #12316 ### Types of changes - [x] Cleanup (Code refactoring and cleanup, that may add test cases) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
