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/12/23 06:59:51 UTC
[GitHub] [incubator-eventmesh] Alonexc opened a new issue, #2653: [Enhancement] Method init() makes literal string comparisons passing the literal as an argument
Alonexc opened a new issue, #2653:
URL: https://github.com/apache/incubator-eventmesh/issues/2653
### 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/209287588-c48b7ffc-da78-45cb-81f1-2f3aac1b3ff9.png)
located at:
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/catalog/EventMeshCatalogClient.java line 76
analysis and explanation:
This line is in the form of
String str = ...
str.equals("someOtherString");
A NullPointerException may occur if the String variable str is null. If instead the code was restructured to
String str = ...
"someOtherString".equals(str);
that is, call equals() on the string literal, passing the variable as an argument, then this exception could never happen as both equals() check for null.
### Describe the solution you'd like
Adjust the code to:String str = "someOtherString".eals(str).
### 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
[GitHub] [incubator-eventmesh] jonyangx commented on issue #2653: [Enhancement] Method init() makes literal string comparisons passing the literal as an argument
Posted by GitBox <gi...@apache.org>.
jonyangx commented on issue #2653:
URL: https://github.com/apache/incubator-eventmesh/issues/2653#issuecomment-1364438801
I'd like to fix it.
--
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] xwm1992 closed issue #2653: [Enhancement] Method init() makes literal string comparisons passing the literal as an argument
Posted by GitBox <gi...@apache.org>.
xwm1992 closed issue #2653: [Enhancement] Method init() makes literal string comparisons passing the literal as an argument
URL: https://github.com/apache/incubator-eventmesh/issues/2653
--
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