rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

Use constants or objects with specific values to call equals

Open zhaohai666 opened this issue 3 years ago • 3 comments

Make sure set the target branch to develop

What is the purpose of the change

The equals method of an object is easy to throw a null pointer. You should use a constant or an object with a certain value to call equals.

Brief changelog

Use constants or objects with specific values to call equals

Verifying this change

Scanning through the tool has fixed this issue

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • [x] Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • [x] Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • [x] Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.

zhaohai666 avatar Aug 09 '21 02:08 zhaohai666

Coverage Status

Coverage increased (+0.1%) to 54.206% when pulling 67ebc460c212ccbe14673a6ace283edb2713752e on zhaohai1299002788:dev-constants-equals into 44bdeedad2d0e28717f5012d375d12af76305bb5 on apache:develop.

coveralls avatar Aug 09 '21 06:08 coveralls

Codecov Report

Merging #3235 (67ebc46) into develop (44bdeed) will decrease coverage by 0.11%. The diff coverage is 15.78%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3235      +/-   ##
=============================================
- Coverage      48.07%   47.95%   -0.12%     
+ Complexity      4573     4557      -16     
=============================================
  Files            552      554       +2     
  Lines          36521    36523       +2     
  Branches        4818     4818              
=============================================
- Hits           17557    17515      -42     
- Misses         16749    16789      +40     
- Partials        2215     2219       +4     
Impacted Files Coverage Δ
.../rocketmq/broker/offset/ConsumerOffsetManager.java 15.70% <ø> (ø)
...cketmq/broker/processor/QueryMessageProcessor.java 5.71% <0.00%> (ø)
.../broker/subscription/SubscriptionGroupManager.java 70.58% <ø> (ø)
...ache/rocketmq/broker/topic/TopicConfigManager.java 59.07% <ø> (ø)
...ketmq/client/consumer/DefaultLitePullConsumer.java 74.53% <ø> (ø)
...ocketmq/client/consumer/DefaultMQPullConsumer.java 33.33% <ø> (ø)
...ocketmq/client/consumer/DefaultMQPushConsumer.java 54.54% <ø> (ø)
...client/consumer/store/RemoteBrokerOffsetStore.java 64.86% <ø> (ø)
...g/apache/rocketmq/client/impl/MQClientAPIImpl.java 12.18% <0.00%> (ø)
...pl/consumer/ConsumeMessageConcurrentlyService.java 48.54% <ø> (+0.97%) :arrow_up:
... and 75 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 44bdeed...67ebc46. Read the comment docs.

codecov-commenter avatar Aug 10 '21 03:08 codecov-commenter

Please submit an issue first, pr associate this issue

odbozhou avatar Aug 10 '21 05:08 odbozhou