Conversation
- GuardedString now overrides toString() so it never inherits Object's default (fixes call-to-object-tostring at its two call sites in one place instead of patching each site). - AttributeTypeUtil.createInstantiatedObject wraps its numeric parsing in the same try/catch -> ConnectorException pattern used elsewhere (uncaught-number-format-exception), and switches from deprecated boxed constructors to the static parse methods. - Remove the dead ContractTestFactory inner class and its now-unused imports. - Mechanical fixes: StringUtil/XSDAnnotationParser empty-string checks, PrettyStringBuilder's Map iteration via entrySet(), a shadowed local in LdapInternalSearch, a javadoc @PARAM typo/gap in MultiOpTests, and a missing space in a log message in ActiveDirectoryChangeLogSyncStrategy.
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
Follow-up to the unused-parameter cleanup (#141): investigated all the newly-surfaced small
note-severity CodeQL categories plus the 8uncaught-number-format-exceptionalerts left over inAttributeTypeUtil.javaafter #139.GuardedStringnow overridestoString()(returns"GuardedString(...)"), so it no longer inheritsObject's default. Fixescall-to-object-tostringat its root instead of patching the two current call sites (SharedSecretPrincipal,ScriptOnResourceApiOpTests) individually — any future logging of aGuardedStringis safe by construction.AttributeTypeUtil.createInstantiatedObject: the 8 remaininguncaught-number-format-exceptionalerts. Numeric parsing now goes through private helpers that catchNumberFormatExceptionand rethrow asConnectorExceptionwith the offending value — the same pattern used across Wrap malformed numeric values in a domain exception instead of a bare NumberFormatException #139. Also swaps the deprecated boxed constructors (new Integer/Long/Double/Float/Boolean(String)) for their static parse methods.ContractTestFactoryinner class fromContractITCase(unused-reference-type) and its now-unused imports.StringUtil.isEmpty/XSDAnnotationParserempty-string checks (inefficient-empty-string-test),PrettyStringBuilder'sMapiteration viaentrySet()instead ofkeySet()(inefficient-key-set-iterator), a shadowed local inLdapInternalSearch.execute()(local-shadows-field), a javadoc@paramtypo/gap inMultiOpTests(unknown-javadoc-parameter), a missing space in a log message inActiveDirectoryChangeLogSyncStrategy(missing-space-in-concatenation).Also dismissed on GitHub: 3
ignored-error-status-of-call(the ignored return values are already covered by a subsequent check or exception path), 8jdk-internal-api-access(AD DirSync'scom.sun.jndi.ldap.Ber*, no public JDK alternative exists), 1confusing-method-signature(Log.log(..)is long-standing, heavily-used public API — renaming to remove the overload is too invasive for the benefit).Test plan
GuardedStringTests.testToStringNeverExposesTheClearText,AttributeTypeUtilTests(valid values parse; malformed numeric values raiseConnectorException, not a bareNumberFormatException).mvn installonconnector-framework,connector-framework-contract,OpenICF-ldap-connector,OpenICF-xml-connector(incl. their existing test suites, LDAP/OpenDJ integration tests included) — all green.