pandaapo commented on code in PR #4352:
URL: https://github.com/apache/eventmesh/pull/4352#discussion_r1292787912
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/HttpCommand.java:
##########
@@ -82,9 +80,7 @@ public HttpCommand(String httpMethod, String httpVersion,
String requestCode) {
}
public HttpCommand createHttpCommandResponse(Header header, Body body) {
- if (StringUtils.isBlank(requestCode)) {
- return null;
- }
+
Review Comment:
```
if (StringUtils.isBlank(requestCode)) {
...
}
```
Is it appropriate to directly remove this judgment? This may solve other
NPEs caused by it, but new problems may arise: a `HttpCommand` with blank
`requestCode`.
If there is no better solution temporarily, could we define a
`RequestCode.UNKNOWN` to use when `requestCode` is blank?
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/HttpCommand.java:
##########
@@ -96,9 +92,7 @@ public HttpCommand createHttpCommandResponse(Header header,
Body body) {
}
public HttpCommand createHttpCommandResponse(EventMeshRetCode
eventMeshRetCode) {
- if (StringUtils.isBlank(requestCode)) {
- return null;
- }
+
Review Comment:
Same as the opinion above.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]