LuciferYang opened a new pull request, #10216: URL: https://github.com/apache/paimon/pull/10216
### Purpose `OrphanFilesClean.validBranches` took the list returned by the branch manager and appended the main branch to it in place. For a table without branches the REST branch manager returns an immutable empty list, since `RESTApi.listBranches` falls back to `Collections.emptyList()`, so the add threw `UnsupportedOperationException` and aborted orphan file cleaning. A cached or otherwise shared list would be corrupted the same way. This copies the branch list into a new `ArrayList` before adding the main branch. ### Tests Added `OrphanFilesCleanTest.testValidBranchesDoesNotMutateManagerList`. It mocks the branch manager to return `Collections.emptyList()` and asserts `validBranches` returns exactly `[main]`. Without the fix this test errors with `UnsupportedOperationException`. ### API and Format No. ### Documentation No. -- 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]
