Commit 74e5c9e
Issue #58 Fix HttpClient resource management in ApiTracker.java
- Replaced static shared HttpClient instance with factory method
- Updated fetchFromUrl() to use try-with-resources for proper resource management
- Updated fetchUpstreamSources() to use try-with-resources for proper resource management
- Ensures HttpClient instances are properly closed after use
- Aligns with Java 21+ AutoCloseable best practices
The changes ensure that HttpClient resources are properly managed using
try-with-resources, preventing potential resource leaks and following
Java best practices for AutoCloseable resources.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 8b13911 commit 74e5c9e
File tree
1 file changed
+10
-8
lines changed- json-java21-api-tracker/src/main/java/io/github/simbo1905/tracker
1 file changed
+10
-8
lines changedLines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
74 | | - | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
230 | | - | |
| 232 | + | |
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
237 | | - | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
0 commit comments