DocJlm opened a new issue, #16098: URL: https://github.com/apache/dubbo/issues/16098
### Pre-check - [x] I am sure that all the content I provide is in English. ### Search before asking - [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues. ### Apache Dubbo Component Java SDK (apache/dubbo) ### Dubbo Version Dubbo 3.3.x, branch 3.3 (source code review) ### Steps to reproduce this issue 1. Open `dubbo-common/src/main/java/org/apache/dubbo/common/utils/ConfigUtils.java` 2. In `replaceProperty()` method (line 142): `StringBuffer` is used for a local variable, `StringBuilder` would be more appropriate 3. In `loadMigrationRule()` method: `InputStream` opened via `url.openStream()` is never closed after `readString()` returns — this is a confirmed resource leak 4. In `loadProperties()` multi-file loop: uses nested try-finally with empty catch blocks instead of try-with-resources ### What you expected to happen 1. Local variables should use `StringBuilder` instead of `StringBuffer` when thread-safety is not needed 2. All `InputStream` resources should be properly closed using try-with-resources to prevent file handle leaks 3. Empty catch blocks should be eliminated ### Anything else The most critical issue is in `loadMigrationRule()` where an InputStream opened via `url.openStream()` is never closed. In long-running applications this can lead to file descriptor exhaustion ("Too many open files" error). I will submit a PR to fix all these issues. ### Do you have a (mini) reproduction demo? - [ ] Yes, I have a minimal reproduction demo to help resolve this issue more effectively! ### Are you willing to submit a pull request to fix on your own? - [x] Yes I am willing to submit a pull request on my own! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
