You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/10/25 11:06:44 UTC

[GitHub] [incubator-eventmesh] KxxxxxX opened a new issue, #1845: [Enhancement] Method makes literal string comparisons passing the literal as an argument

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

   ### 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
   
   ```java
       @Override
       protected boolean isContentTypeHeader(String key) {
           return key.equals(KnativeHeaders.CONTENT_TYPE);
       }
   ```
   located at:
   org/apache/eventmesh/connector/knative/cloudevent/impl/KnativeBinaryMessageReader.java line 34
   explanation:
   This line has the form `String str = str.equals("someOtherString")`
   If the string variable str is null, a NullPointerException may occur. if the code is adapted to `String str = "someOtherString".equals(str)`
   That is, if you call equals() on a string literal, passing the variable as an argument, then this exception will not occur because equals() will check for null.
   
   ### Describe the solution you'd like
   
   ```java    
      @Override
       protected boolean isContentTypeHeader(String key) {
           return KnativeHeaders.CONTENT_TYPE.equals(key);
       }
   ```
   
   ### Are you willing to submit PR?
   
   - [X] 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


[GitHub] [incubator-eventmesh] MajorHe1 closed issue #1845: [Enhancement] Method makes literal string comparisons passing the literal as an argument

Posted by GitBox <gi...@apache.org>.
MajorHe1 closed issue #1845: [Enhancement] Method makes literal string comparisons passing the literal as an argument
URL: https://github.com/apache/incubator-eventmesh/issues/1845


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

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


[GitHub] [incubator-eventmesh] github-actions[bot] commented on issue #1845: [Enhancement] Method makes literal string comparisons passing the literal as an argument

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #1845:
URL: https://github.com/apache/incubator-eventmesh/issues/1845#issuecomment-1290371906

   Welcome to the Apache EventMesh (incubating) community!!
   We are glad that you are contributing by opening this issue. :D
   
   Please make sure to include all the relevant context.
   We will be here shortly.
   
   If you are interested in contributing to our project, please let us know!
   You can check out our contributing guide on [contributing to EventMesh](https://github.com/apache/incubator-eventmesh/blob/develop/CONTRIBUTING.md).
   
   Want to get closer to the community?
   
   WeChat Group:
   ![wechat_qr](https://github.com/apache/incubator-eventmesh/blob/master/docs/images/contact/wechat-assistant.jpg?raw=true)
   
   Mailing Lists:
   | Name | Description |Subscribe	|Unsubscribe|Archive
   | ----    | ----    |----    | ----    | ----    |
   |Users	|User support and questions mailing list|	[Subscribe](mailto:users-subscribe@eventmesh.incubator.apache.org)	|[Unsubscribe](mailto:users-unsubscribe@eventmesh.incubator.apache.org)	|[Mail Archives](https://lists.apache.org/list.html?users@eventmesh.apache.org)|
   |Development	|Development related discussions|	[Subscribe](mailto:dev-subscribe@eventmesh.incubator.apache.org)	|[Unsubscribe](mailto:dev-unsubscribe@eventmesh.incubator.apache.org)	|[Mail Archives](https://lists.apache.org/list.html?dev@eventmesh.apache.org)|
   |Commits	|All commits to repositories|	[Subscribe](mailto:commits-subscribe@eventmesh.incubator.apache.org)	|[Unsubscribe](mailto:commits-unsubscribe@eventmesh.incubator.apache.org)	|[Mail Archives](https://lists.apache.org/list.html?commits@eventmesh.apache.org)|


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

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