FrankChen021 opened a new pull request, #19820: URL: https://github.com/apache/druid/pull/19820
## What changed - Correct nonterminating/constant control flow, comparator contracts, iterator reuse, and redundant tests. - Make affected enum switches explicit in production code, tests, and the tracked SQL parser template. - Replace ad-hoc test implementations with existing contract-correct row and iterator types. - Document 21 intentional identity, ordering, optional-operation, and dual-evaluation contracts with narrow CodeQL suppressions. ## Why The current CodeQL snapshot reports 63 control-flow and API-contract warnings across 13 queries. This change addresses 61 of them: - 40 direct code or contract fixes - 21 precise suppressions for intentional semantics The remaining two `java/subtle-inherited-call` alerts are in untracked output from `protoc-gen-grpc-java`. The current official gRPC Java generator still emits the same pattern. Editing `target/` would not be durable, and excluding the query repository-wide would weaken future scanning, so those two generator-owned findings are intentionally not hidden by this PR. ## Impact The main behavioral fix prevents `ByteBufferMinMaxOffsetHeap.siftDown` from looping when no grandchild swap is needed. Comparator and iterator test helpers now satisfy their API contracts, enum evolution is handled explicitly, and SQL parser regeneration preserves the fixes. ## Root cause Some implementations intentionally use identity or partial ordering semantics that CodeQL cannot infer. Other findings were genuine missing enum cases, one-shot iterator wrappers, constant assertions, or incomplete comparison contracts. Six alerts originated in generated code; four map to the repository-owned SQL parser template and are fixed there, while two originate entirely in the external gRPC generator. ## Checks - 11,919 focused test executions passed - 2 tests skipped - Processing compile and checkstyle passed - SQL parser regeneration and compilation passed - Focused multi-module reactors passed - `git diff --check` Created by GPT-5.6-Sol. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
