Skip to content

Conversation

@PreetAngadSingh
Copy link
Contributor

Fixes #3106

Method:
public static T requireNonNull(T obj, String message)

The Objects.requireNonNull() method is used to check that the values associated with the keys CONSTANTS_KEY_HEADERS and CONSTANTS_KEY_BODY are not null before calling the JsonUtils.serialize and getBytes methods on them. If either of the values is null, the method throws a NullPointerException with the specified error message.

line 105 : added requireNonNull method and message "Headers must not be null");
line 106 : added requireNonNull method and message "Bodymust not be null");

  • Does this pull request introduce a new feature? (no)

@xwm1992
Copy link
Contributor

xwm1992 commented Feb 13, 2023

@PreetAngadSingh
image
please check these errors

@PreetAngadSingh
Copy link
Contributor Author

PreetAngadSingh commented Feb 13, 2023 via email

@Alonexc
Copy link
Contributor

Alonexc commented Feb 13, 2023

Thanks @mike_xwm I will do the changes by the end of the day today.

On Mon, Feb 13, 2023 at 7:05 AM, mike_xwm @.> wrote: @PreetAngadSingh https://github.com/PreetAngadSingh [image: image] https://user-images.githubusercontent.com/13237619/218453270-c47a9199-4af4-4f8e-a5ca-4243d5f6ddae.png please check these errors — Reply to this email directly, view it on GitHub <#3131 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGBJBP7MQLHRX7PHWCVZETWXIPQ3ANCNFSM6AAAAAAUZZVPYE . You are receiving this because you were mentioned.Message ID: @.>

@PreetAngadSingh Hello,you can refer to the figure below, the NPE of the Headers does not seem to be under control.
image

@xwm1992 xwm1992 changed the title Issue #3106 Null check for dataContentMap in HttpProtocolAdaptor.java [ISSUE #3106] Null check for dataContentMap in HttpProtocolAdaptor.java Feb 14, 2023
@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Merging #3131 (28fbd32) into master (c3403f6) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

❗ Current head 28fbd32 differs from pull request most recent head 7db1e6d. Consider uploading reports for the commit 7db1e6d to get more accurate results

@@             Coverage Diff              @@
##             master    #3131      +/-   ##
============================================
- Coverage     13.10%   13.09%   -0.02%     
  Complexity     1145     1145              
============================================
  Files           548      548              
  Lines         28630    28623       -7     
  Branches       2862     2858       -4     
============================================
- Hits           3751     3747       -4     
+ Misses        24556    24552       -4     
- Partials        323      324       +1     
Impacted Files Coverage Δ
...pl/consumer/ConsumeMessageConcurrentlyService.java 0.00% <0.00%> (ø)
...e/eventmesh/protocol/http/HttpProtocolAdaptor.java 5.26% <0.00%> (-0.30%) ⬇️
.../runtime/core/protocol/grpc/retry/GrpcRetryer.java 0.00% <0.00%> (ø)
.../admin/handler/QueryRecommendEventMeshHandler.java 88.88% <0.00%> (-3.71%) ⬇️
...ventmesh/client/grpc/util/EventMeshClientUtil.java 90.00% <0.00%> (-1.54%) ⬇️
.../trace/pinpoint/exporter/PinpointSpanExporter.java 68.45% <0.00%> (-0.68%) ⬇️
...untime/core/protocol/http/push/HTTPClientPool.java 0.00% <0.00%> (ø)
...otocol/meshmessage/MeshMessageProtocolAdaptor.java 3.84% <0.00%> (+0.07%) ⬆️
.../apache/eventmesh/common/config/ConfigService.java 45.00% <0.00%> (+0.55%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@mytang0 mytang0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mytang0 mytang0 merged commit 5ff6e3e into apache:master Feb 14, 2023
@PreetAngadSingh PreetAngadSingh deleted the PreetAngadSingh/Issue#3106 branch February 16, 2023 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Method invocation may produce 'NullPointerException'[HttpProtocolAdaptor]

4 participants