GLM-5.3 Flash · Balanced
fix-concurrent-group-access-to-prevent-nullpointerexception-keycloak
Keycloak · Java · XS · <30 lines · 3 files
The normal review, with one generalist agent. Judge: Claude Opus 5.5.
- Gold bugs found
- 2 of 2
- Comments published
- 4
- Comments matching a bug
- 2
- Comments not matching
- 2
- Cost of this PR
- $0.044
Published comments (4)
Null modelSupplier result still dereferenced in sibling getSubGroupsStream overloads — The same null from `modelSupplier.get()` still reaches the `getSubGroupsStream` overloads, including one used by the group-children endpoint in `GroupResource`, so the NPE this PR fixes remains reproducible. Apply the same null handling to all three sibling overloads.
getSubGroupsCount() returns null, violating GroupModel's never-null contract — The null propagates through `GroupUtils.populateSubGroupCount` and is serialized as a null `subGroupCount` in admin API responses, breaking clients that expect a number. Return `0L` instead — a group that no longer resolves has no subgroups.
Reader thread not joined before asserting no exceptions were captured — A request still in flight when `deletedAll` is set can append to `caughtExceptions` after the assertion has already run, so the test passes despite capturing the exact concurrent-deletion failure it should detect. Join the reader thread before asserting on `caughtExceptions`.
Reader thread spins forever if a group delete throws before deletedAll is set — If any `remove()` call throws, `deletedAll.set(true)` is never reached and the reader thread loops forever issuing admin requests, hanging the test JVM and discarding the collected exceptions. Wrap the deletion loop in try/finally so `deletedAll` is always set.
Gold bugs found (2)
Gold bugs missed (0)
None.