PrashantBhanage opened a new pull request, #13490:
URL: https://github.com/apache/cloudstack/pull/13490

   Fixes #11635
   
   ### Description
   
   This PR addresses the technical debt in 
`ApiResponseHelper#createUsageResponse(Usage)` by modularizing the 530-line 
method. 
   
   - Extracted the 500+ line switch/if-else block into a main dispatcher method 
`populateUsageTypeSpecificDetails`.
   - Created 18 individual private helper methods for each specific `UsageType` 
to improve maintainability and readability.
   - Introduced a `UsageResourceDetails` container class to safely manage and 
return `resourceId` and `resourceType` state for tag lookups.
   - Verified zero business logic changes; strictly structural refactoring.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [x] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] Build/CI
   - [ ] Test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   N/A (Pure backend refactoring)
   
   ### How Has This Been Tested?
   
   Ran a successful clean compile locally to verify no structural or syntax 
breaks:
   `mvn -pl server -DskipTests clean compile`
   Passed all local Checkstyle validations.
   
   #### How did you try to break this feature and the system with this change?
   
   This is a pure structural refactor. Carefully verified that no business 
logic, string formatting, or calculations were altered. I am relying on the 
existing automated CI test suites to ensure data integrity and backward 
compatibility remain strictly intact.


-- 
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