On 30/06/2026 22:53, [email protected] wrote:
This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 13ecfa2f06 Add utility URLConnection wrapper for review
13ecfa2f06 is described below
commit 13ecfa2f066bd8d4e89f00d33d355f1598155551
Author: remm <[email protected]>
AuthorDate: Tue Jun 30 23:53:01 2026 +0200
Add utility URLConnection wrapper for review
Co authored using OpenCode.
I looked at it and it looked OK to me for the places we have been
discussing using it.
Then I gave it to Claude and CoPilot to review.
They found quite a few other places were we could use this class. Given
that wider potential usage, the key finding was the new class extends
URLConnection but doesn't override all the methods pass the calls to the
wrapped connection. That might cause some bugs if we are not careful.
Proposed solutions:
a) don't extend URLConnection
b) override all the methods
Personally, I'm leaning towards b) as that way the class remains a
drop-in replacement for any current use of UrlConnection.
A less important issue is that if a stream can't be obtained (e.g. for
"jar:file:/some/path/my.jar!/" then the JarFile won't be closed.
Using getJarFile() rather than getInputStream() would fix that.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]