Skip to content

Replace the last deprecated calls: Grizzly SSLContextConfigurator and SecurityManager - #138

Open
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:codeql-deprecated-ssl-securitymanager
Open

vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:codeql-deprecated-ssl-securitymanager

Conversation

@vharseko

Copy link
Copy Markdown
Member

Closes the remaining java/deprecated-call alerts on real (non-MessagesUtil.*Legacy) code: SSLContextConfigurator.createSSLContext (3) and System.getSecurityManager (1). Together with the 67 MessagesUtil.serializeLegacy/deserializeLegacy alerts (dismissed as "won't fix" — see below) and the reflection/boxing/close alerts fixed in #134, this closes java/deprecated-call entirely.

SSLContextConfigurator.createSSLContext() — 3 sites

Grizzly's SSLContextConfigurator.createSSLContext() is deprecated in favour of createSSLContext(boolean throwException). Checked the Grizzly source: the no-arg version is literally return createSSLContext(false); — identical behaviour, so ConnectionManager.java (×2) and ConnectorServer.java (grizzly, ×1) switch to createSSLContext(false) with no behaviour change.

System.getSecurityManager() — CCLWatchThreadFactory

This class's own comment says it is "Copied from java.util.concurrent.Executors.DefaultThreadFactory". Checked the current JDK's own copy of that class (OpenJDK 26 source): it has since dropped the SecurityManager branch entirely, now unconditionally group = Thread.currentThread().getThreadGroup(); — matching the permanent disabling of the Security Manager in JEP 486. This PR makes the same change here, with a comment explaining why.

MessagesUtil.serializeLegacy / deserializeLegacy — 67 alerts, dismissed, not touched

These are the framework's only serialization path for payloads its own wire protocol defines as opaque bytes rather than structured protobuf messages — scriptArguments (CommonObjectMessages.proto), connectorObject, attributes, and the sync token value (OperationMessages.proto). There is no drop-in non-deprecated alternative without redefining the wire protocol, which would break compatibility with the .NET connector server and existing clients. Dismissed on GitHub as "won't fix" with that reasoning recorded on each alert.

Tests

No new tests: both changes are behaviour-preserving (verified against the Grizzly source and the current JDK source respectively), and neither has an observable difference a test could assert on.

Local runs of the three touched modules, all green: connector-framework-internal 469 tests (2 skipped, same as on master), connector-framework-server 29, connector-server-grizzly 34.

… SecurityManager

createSSLContext() is deprecated in favour of createSSLContext(boolean);
the no-arg version is exactly createSSLContext(false) (verified against
the Grizzly source), so the three call sites switch to that with no
behaviour change.

CCLWatchThreadFactory is its own copy of
java.util.concurrent.Executors.DefaultThreadFactory. The JDK's own copy
dropped the SecurityManager check once the Security Manager was
permanently disabled (JEP 486); this one follows suit.
@vharseko vharseko added java Pull requests that update java code framework OpenICF-java-framework labels Sep 18, 2026
@vharseko vharseko added the refactoring Code cleanup / tech debt, no behavior change label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework OpenICF-java-framework java Pull requests that update java code refactoring Code cleanup / tech debt, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant