GLM-5.3 · Heavy

fix-concurrent-group-access-to-prevent-nullpointerexception-keycloak

Keycloak · Java · XS · <30 lines · 3 files

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. 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
$1.044

Published comments (2)

mediumbugmodel/infinispan/src/main/java/org/keycloak/models/cache/infinispan/GroupAdapter.java:272-276

getSubGroupsCount returns null when underlying group is deleted, violating non-null contract — Unboxing callers following the `GroupModel.getSubGroupsCount()` never-null contract will NPE. Return 0L for a concurrently deleted group, as the JPA layer does with its `Objects::nonNull` filter.

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

Reader thread not joined before asserting, so late exceptions go unobserved — The thread can still be mid-read when `deletedAll.set(true)` flips, so a `GroupAdapter.getSubGroupsCount()` failure may land after the assertion already passed. Keep the Thread reference and `join()` with a timeout before asserting `caughtExceptions`. **Also found in:** - `tests/base/src/test/java/org/keycloak/tests/admin/group/GroupTest.java:136-149`

Gold bugs found (0)

None.

Gold bugs missed (0)

None.