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/16 06:29:43 UTC
[GitHub] [incubator-eventmesh] Alonexc opened a new issue, #3160: [Enhancement] Method needlessly boxes a boolean constant[QueryRecommendEventMeshHandlerTest]
Alonexc opened a new issue, #3160:
URL: https://github.com/apache/incubator-eventmesh/issues/3160
### 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/219285938-0e9daedc-3654-4b94-a546-7c65669900f1.png)
located at:
eventmesh-runtime/src/test/java/org/apache/eventmesh/runtime/admin/handler/QueryRecommendEventMeshHandlerTest.java line 82
analysis and explanation:
This method assigns a Boxed boolean constant to a primitive boolean variable, or assigns a primitive boolean constant to a Boxed boolean variable. Use the correct constant for the variable desired. Use
boolean b = true;
boolean b = false;
or
Boolean b = Boolean.TRUE;
Boolean b = Boolean.FALSE;
Be aware that this boxing happens automatically when you might not expect it.
has two cases of this needless autoboxing. This can be made more efficient by simply substituting in the constant values:
Map statusMap = ...
public Boolean someMethod() {
statusMap. put("foo", Boolean.TRUE);
return Boolean.FALSE;
}
### Describe the solution you'd like
![image](https://user-images.githubusercontent.com/91315508/219286059-1b49cfc3-eef9-45fd-bd9e-8c5157b98112.png)
### 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 needlessly boxes a boolean constant[QueryRecommendEventMeshHandlerTest] (eventmesh)
Posted by "Alonexc (via GitHub)" <gi...@apache.org>.
Alonexc closed issue #3160: [Enhancement] Method needlessly boxes a boolean constant[QueryRecommendEventMeshHandlerTest]
URL: https://github.com/apache/eventmesh/issues/3160
--
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