Conversation
…g, clone - ReconciliationService: drop the unreachable ScheduledThreadPoolExecutor branches (it is a ThreadPoolExecutor) - Fix SLF4J placeholder/argument mismatches in ClusterManager, ConnectorInfoProviderService, Id, GenericTableHandler, MappedTableHandler and PostgreSQLMappedTableHandler - ExplicitResultSetMapper: the "total" guard compared a String against a List<ColumnMapping> and never matched; check the mapped DB column names - AbstractScriptedService: synchronize on a dedicated lock instead of the (possibly null) registration field, make it volatile and clear it after unregistering; the old code threw NPE on every REGISTERED script event - JsonUser / ChecksumFile: override clone() so the copy keeps its type (and, for JsonUser, its CryptoService) - OrientDBRepoService: back off between pool-acquire retries outside the pool lock - Remove the write-only containers in OperationHelperImpl and RepoJobStore Resolves CodeQL alerts #470-#486, #490-#494, #497-#499.
vharseko
added a commit
to vharseko/OpenIDM
that referenced
this pull request
Sep 19, 2026
…correctness Brings in the JsonUser.clone() override from OpenIdentityPlatform#205 so the error-level CodeQL alert java/missing-clone-method no longer fires on the class declaration line this branch touches. # Conflicts: # openidm-workflow-activiti/src/main/java/org/forgerock/openidm/workflow/activiti/impl/JsonUser.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes all 25 open error-level (code quality) CodeQL alerts: #470–#486, #490–#494, #497–#499. Most are mechanical, but three turned out to be real bugs (marked bug below).
contradictory-type-checksReconciliationServiceelse if (… instanceof ScheduledThreadPoolExecutor)branches — it is aThreadPoolExecutor, so the first branch always wins.missing-format-argumentClusterManager,ConnectorInfoProviderService,Id,GenericTableHandler,MappedTableHandler×2,PostgreSQLMappedTableHandlerinstanceId;new Object[]{…}, e→ plain varargs with the throwable last; stray{}dropped; the "Unprepared query strings" debug line was missingreadForUpdateQueryStr.type-mismatch-access— bugExplicitResultSetMappercolumnMappings.contains("total")compared aStringagainst aList<ColumnMapping>and was alwaysfalse, so an explicitly mappedtotalcolumn was silently overwritten withrs.getInt("total"). Now checks the mapped DB column names.unsafe-sync-on-field/unsafe-double-checked-locking— bugAbstractScriptedServicesynchronized (selfRegistration)whileselfRegistration == null→NullPointerExceptionon everyREGISTEREDscript event (the new test reproduced it). Now a dedicatedregistrationLock, avolatilefield, and the field is cleared afterunregister()so a script reload re-registers instead of leaving a stale registration.missing-clone-method— bugJsonUserJsonValue.clone()returns a plainJsonValue, so cloning aJsonUserlost theUsertype and itsCryptoService. Overridden.missing-clone-methodChecksumFileclone()override (shallow, likeHashMap; documented).sleep-with-lock-heldOrientDBRepoServicedbLock; only thepool.acquirecall is serialised.InterruptedExceptionrestores the interrupt flag and stops retrying instead of being swallowed.unused-containerOperationHelperImpl,RepoJobStoreresultList(only referenced from commented-out code) andblockedJobs(added/removed, never read) plus theelse {}that became empty.Test plan
ExplicitResultSetMapperTest(2),AbstractScriptedServiceTest(3),JsonUserTest(2),ChecksumFileTest.testCloneKeepsEntriesAndType— all failed before the change (2× compile error, 1× NPE, 1× overwritten value), pass now