fix: address SonarCloud reliability issues - #112
Conversation
- Fix infinite recursion in `RequestHandler.process` (5 args) by throwing `UnsupportedOperationException`. - Fix potential `NullPointerException` in `RufhUploadExistsValidator` when request or storage service is null. - Fix potential `NullPointerException` in `DiskLockingService.getStopPath` when `getPathInStorageDirectory` returns null. Co-authored-by: tomdesair <14034630+tomdesair@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Fix infinite recursion in `RequestHandler.process` (5 args) by throwing `UnsupportedOperationException`. - Fix potential `NullPointerException` in `RufhUploadExistsValidator` when request or storage service is null. - Fix potential `NullPointerException` in `DiskLockingService.getStopPath` when `getPathInStorageDirectory` returns null. Co-authored-by: tomdesair <14034630+tomdesair@users.noreply.github.com>
This PR addresses three reliability issues identified by SonarCloud:
RequestHandler: The defaultprocess(5 args)method called theprocess(7 args)method, which in turn defaulted to calling theprocess(5 args)method. If neither was implemented, this would result in aStackOverflowError. The 5 args method was modified to throw anUnsupportedOperationExceptionto break the cycle and enforce the use of the newer 7 args method.RufhUploadExistsValidator: Added null checks forrequestanduploadStorageServiceat the start of thevalidatemethod. Previously, if they were null,Utils.isCreationEndpointwould return false, leading to a NPE whenrequest.getRequestURI()was invoked.DiskLockingService: Added a null check forlockPathingetStopPath.getPathInStorageDirectorycan return null, which would cause an NPE when calling.resolveSibling()on it.Tests and test coverage were updated to ensure everything passes and code changes are well-covered.
PR created automatically by Jules for task 1854060035614280304 started by @tomdesair