refactor: replace deprecated URL constructors in production code #20688
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 312 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.344
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #20688"
general
weight: 0.35
akshat-lakhera
Part of #20525.
Description
This is the first cleanup from the table in #20525. It replaces the deprecated java.net.URL constructors in production code with URI.create(...).toURL() or new URI(...).toURL(). Test code still uses the old constructors, so I didn't add the forbidden-apis rule here. I plan to clean up the tests and add the rule in a follow-up PR.
I tried to keep behaviour the same:
I built the touched modules and ran the unit tests for the changed classes. They pass, except DirectDruidClientTest and FileBasedProtobufBytesDecoderTest.testDescriptorUrl on my Windows machine: the first fails in setup on temp file locking, and the second builds a file URL from a Windows path with backslashes, which URI rejects. Both should be fine on Linux CI.
Release note
No release note, there's no user-facing change.
<hr>
##### Key changed/added classes in this PR
TaskLocation
ServiceLocation
HttpPostEmitter
ChannelResourceFactory
DirectDruidClient
HttpServerInventoryView
HttpLoadQueuePeon
ChangeRequestHttpSyncer
LookupCoordinatorManager
BuildInfo
CoordinatorRedirectInfo
OverlordRedirectInfo
SystemServerPropertiesTable
PrometheusEmitter
CommonCacheNotifier
RestUpdateSender
* FileBasedProtobufBytesDecoder
<hr>
This PR has: