GLM-5.3 · 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 Haiku 5.5.

Gold bugs found
0 of 0
Comments published
2
Comments matching a bug
0
Comments not matching
2
Cost of this PR
$0.344

Published comments (2)

mediumbugmodel/infinispan/src/main/java/org/keycloak/models/cache/infinispan/GroupAdapter.java:274-275

getSubGroupsCount() returns null when backing group is gone, violating GroupModel contract — A null `subGroupCount` can reach admin group listings via `GroupUtils.populateSubGroupCount`, and callers unboxing the `Long` will NPE, breaking the documented `GroupModel` invariant. Return `0L` from `getSubGroupsCount()` when `modelSupplier.get()` finds no backing group.

mediumbugtests/base/src/test/java/org/keycloak/tests/admin/group/GroupTest.java:139-157

Reader thread is never joined, so late exceptions can slip past the assertion — An exception from the reader's final in-flight request can land in `caughtExceptions` after `assertThat` already passed, letting this regression test false-pass. Capture the thread reference and call `join()` after `deletedAll.set(true)` before asserting.

Gold bugs found (0)

None.

Gold bugs missed (0)

None.