Conversation
- Match SLF4J placeholders to their arguments in ManagedObjectSet, ReverseRelationshipValidator, UpdateManagerImpl, MessagingService, RepoJobStore, Activator, RouterConfig and ScriptedRequestHandler - FieldStorageSchemeImpl: stop passing the stored password hash to the logger at all instead of adding a placeholder for it - Use primitives for locals that are never null in DatabaseInfoResourceProvider, ConnectorUtil, GenericTableHandler, TableQueries, CustomCommandScope and JsonUtil Resolves CodeQL alerts #452-#468, #646-#650, #653.
| if (PREFIX_INT.equals(tokenParts[0])) { | ||
| // handle single integer value | ||
| Integer int_value = Integer.parseInt(objValue.toString()); | ||
| int int_value = Integer.parseInt(objValue.toString()); |
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
Second warning-level CodeQL batch: the mechanical Java cleanups — 23 alerts across 15 files, no behaviour change beyond log output. (#651/#652 in
DateUtilare already covered by the rewrite in #207.)java/unused-format-argument(#452–#468)Placeholders reconciled with the arguments actually passed:
{}added where the argument was silently dropped:ManagedObjectSet,UpdateManagerImpl,RepoJobStore×2,RouterConfig,ScriptedRequestHandlerReverseRelationshipValidator:{0}…{3}(MessageFormat style, never expanded by SLF4J) →{}MessagingService(subscriberduplicatedsubscriber.getName()),Activator×6 (theBundleContextobject in "bundle starting/started/stopped" debug lines is noise)FieldStorageSchemeImpl×3 — the dropped argument wasstoredField, i.e. the stored password hash. Rather than making the placeholder work, the value is no longer logged at all; password hashes inerrorlogs are an offline-cracking gift.java/non-null-boxed-variable(#646–#650, #653)Locals only ever assigned primitives are declared as primitives:
DatabaseInfoResourceProvider,ConnectorUtil,GenericTableHandler,TableQueries,CustomCommandScope(Integer.compare),JsonUtil(Double.compare).Test plan
Side note for maintainers (not addressed here):
BundleHandlerTestinopenidm-maintenanceis not idempotent — it leavestarget/test-classes/bundleHandler/felix-cachebehind and fails on the next run withoutmvn clean(Bundle symbolic name and version are not unique).