You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "Alonexc (via GitHub)" <gi...@apache.org> on 2023/02/02 03:07:36 UTC

[GitHub] [incubator-eventmesh] Alonexc opened a new issue, #3009: [Enhancement] Method manually handles closing an auto-closeable resource [MetricsHandler]

Alonexc opened a new issue, #3009:
URL: https://github.com/apache/incubator-eventmesh/issues/3009

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Enhancement Request
   
   ![image](https://user-images.githubusercontent.com/91315508/216220119-89aaabeb-79d1-4ea0-8020-1652bf4c2711.png)
   located at:
   eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/MetricsHandler.java line 139
   analysis and explanation:
   This method allocates and uses an auto closeable resource. However, it manually closes the resource in a finally block. While this is correct management, it doesn't rely on the idiomatic way available to JDK 7 and above, allows for possible subtle problems, and complicates the reading of code by developers expecting the use of try-with-resources.
   
   
   ### Describe the solution you'd like
   
   Change to use try-with-resources to manage resources.
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
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: dev-unsubscribe@eventmesh.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


Re: [I] [Enhancement] Method manually handles closing an auto-closeable resource [MetricsHandler] (eventmesh)

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm closed issue #3009: [Enhancement] Method manually handles closing an auto-closeable resource [MetricsHandler]
URL: https://github.com/apache/eventmesh/issues/3009


-- 
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: issues-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org