You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "Bhaskar1312 (via GitHub)" <gi...@apache.org> on 2023/03/09 17:37:28 UTC

[GitHub] [incubator-eventmesh] Bhaskar1312 commented on a diff in pull request #3374: [ISSUE #2972] Require null check

Bhaskar1312 commented on code in PR #3374:
URL: https://github.com/apache/incubator-eventmesh/pull/3374#discussion_r1131375579


##########
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/producer/CloudEventProducer.java:
##########
@@ -75,7 +76,7 @@ private void validateCloudEvent(final CloudEvent cloudEvent) {
 
     private RequestParam buildCommonPostParam(final CloudEvent cloudEvent) {
         validateCloudEvent(cloudEvent);
-        final byte[] bodyByte = EventFormatProvider.getInstance().resolveFormat(cloudEvent.getDataContentType())
+        final byte[] bodyByte = Objects.requireNonNull(EventFormatProvider.getInstance().resolveFormat(cloudEvent.getDataContentType()))
             .serialize(cloudEvent);
         final String content = new String(bodyByte, StandardCharsets.UTF_8);

Review Comment:
   My IDE is not recogninzing this Constants.DEFAULT_CHARSET. Can you put the import as well?



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