You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@eventmesh.apache.org by "Alonexc (via GitHub)" <gi...@apache.org> on 2023/05/18 01:57:40 UTC

[GitHub] [eventmesh] Alonexc opened a new issue, #3955: [Enhancement] Code optimization.[ConfigurationHandler]

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

   ### 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://github.com/apache/eventmesh/assets/91315508/6316a442-89be-4c4b-9542-793795c4fbfd)
   ![image](https://github.com/apache/eventmesh/assets/91315508/3d5d3356-ea15-4250-9f46-e6a66c00891f)
   ![image](https://github.com/apache/eventmesh/assets/91315508/875576ac-a6f4-48c7-80d6-fa9f1dffc7e5)
   ![image](https://github.com/apache/eventmesh/assets/91315508/9176b4d6-d852-4ceb-a3a6-f94ee045aac3)
   located at:
   eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/ConfigurationHandler.java line 67-70,80-81,106,117
   analysis and explanation:
   a. Method invocation 'getBytes' may produce 'NullPointerException'
   b. Use constant substitution in the `common` module constants class.
   eventmesh-common/src/main/java/org/apache/eventmesh/common/enums/HttpMethod.java
   eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/constants/EventMeshConstants.java
   
   
   ### Describe the solution you'd like
   
   a. Use `Objects.requireNonNull()` to avoid NPE.
   ![image](https://github.com/apache/eventmesh/assets/91315508/12593c1b-183b-44d5-8ef8-7786c641cf0e)
   
   
   b. Constants are extracted into this class.[EventMeshConstants] (If someone has already done it, ignore this)
   ![image](https://github.com/apache/eventmesh/assets/91315508/9774b41a-2aef-4733-b1da-6499f0e47d75)
   
   Replace with constants in the constants class.
   ![image](https://github.com/apache/eventmesh/assets/91315508/c7071a79-ae8f-47a9-962d-4aba537b43dd)
   ![image](https://github.com/apache/eventmesh/assets/91315508/d0f796b1-af65-4cac-b2d3-3cacec6e5dda)
   ![image](https://github.com/apache/eventmesh/assets/91315508/a6937110-87c1-4848-8ca3-87994a1c79bd)
   
   
   ### 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: issues-unsubscribe@eventmesh.apache.org.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


[GitHub] [eventmesh] xwm1992 closed issue #3955: [Enhancement] Code optimization.[ConfigurationHandler]

Posted by "xwm1992 (via GitHub)" <gi...@apache.org>.
xwm1992 closed issue #3955: [Enhancement] Code optimization.[ConfigurationHandler]
URL: https://github.com/apache/eventmesh/issues/3955


-- 
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