Uh oh!
There was an error while loading. Please reload this page.
Remove containers whose contents are never read (java/unused-container CodeQL alerts) - #784
Merged
vharseko merged 1 commit intoJul 29, 2026
Conversation
CodeQL java/unused-container flags seven collections that are populated but never read: * ErrorLogAccountStatusNotificationHandler.NOTIFICATION_TYPE_NAMES * NodeSearcherQueue.cancelList - cancellation itself is performed by task.cancel(), this map was pure bookkeeping nobody consulted * GenerateMessageFileMojo.CATEGORY_DESCRIPTIONS * OnDiskMergeImporter.importedBaseDNs * NewIndexPanel.configurationAttrNames * PropertyValueEditor.addedValues, along with the previousValues set that only fed it * DSConfig.getPropHandlers - the only one of the five handler maps that SubMenuCallback is not given; the surrounding loop is kept because it also populates the relations set NewIndexPanel collected configuration attributes into a set that was never rendered, so they were silently excluded from the attribute combo box. AbstractVLVIndexPanel does exactly the same, so the exclusion is intended rather than an oversight; it is now expressed directly instead of through a discarded collection. No behaviour changes.
maximthomas
approved these changes
Jul 29, 2026
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Clears seven
java/unused-containeralerts (#688, #689, #690, #691, #693, #694, #695). No behaviour changes.Removed
ErrorLogAccountStatusNotificationHandler.NOTIFICATION_TYPE_NAMESNodeSearcherQueue.cancelListput/removecalls but no reads. The cancellation itself is done bytask.cancel(); this map was bookkeeping nobody consulted.GenerateMessageFileMojo.CATEGORY_DESCRIPTIONSputcalls, zero reads. TheLocalizableMessageimport became unused and was dropped with it.OnDiskMergeImporter.importedBaseDNsNewIndexPanel.configurationAttrNamesPropertyValueEditor.addedValuespreviousValuesset that only existed to feed it.DSConfig.getPropHandlersSubMenuCallback. The surrounding loop is kept, because it also populates therelationsset.A note on
NewIndexPanelThe panel classified attributes three ways — standard, configuration, custom — but only rendered the custom and standard categories, so configuration attributes were silently dropped into a set nobody read.
That looks like an oversight at first glance, but
AbstractVLVIndexPaneldoes exactly the same thing: same three-way split, same two categories in the combo box. Two independent panels behaving identically reads as intent — configuration attributes are not offered for indexing — so this change does not add a third category. It only expresses the existing exclusion directly:If the intent was in fact to offer them, that is a separate, user-visible change and should be its own PR.
Two alerts deliberately left open
#686 —
SubCommandArgumentParser.globalArgumentMap(java/empty-container) is not dead code, it is unfinished code: the map is read in two places but nothing is ever put into it.hasGlobalArgument(name)always returnsfalse, so the conflict check inSubCommand.addArgument()never fires and a subcommand argument can silently shadow a global one.addGlobalArgument()never fires either.globalLongIDMapcovers part of it, but only on the!longArgumentsCaseSensitive()path.Fixing it — populating the map, or pointing both reads at
globalLongIDMap— switches on two validations that are currently dead. If any tool (dsconfig,base64, ...) has such a name clash today, it would start failing at startup with anArgumentException. That cannot be settled by reading the code; it needs the CLI tools to be exercised. It deserves its own change rather than riding along with a cleanup.#692 —
InternalConnection.listeners:addConnectionEventListener()/removeConnectionEventListener()work, but nothing ever iterates the list, so internal connections never notify their listeners of a close, an error or an unsolicited notification. The field cannot simply be deleted without breaking the publicConnectioncontract, and wiring up the notifications is a feature, not a cleanup.Testing
mvn -pl opendj-config,opendj-doc-maven-plugin,opendj-server-legacy compile— BUILD SUCCESSmvn -pl opendj-config test— 544 tests run, 0 failures, 0 errors