Skip to content

Conversation

@fantow
Copy link
Contributor

@fantow fantow commented Jul 29, 2020

What is the purpose of the change

fix the issue#2206

Brief changelog

XX

Verifying this change

XXXX

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.

  • 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.
  • 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.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • 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.
  • 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.

Comment on lines 66 to 67
protocolByte = (byte) Integer.parseInt(protocol);
System.out.println(protocolByte);
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, we should delete these two codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The method SerializeType.valueOf() need a byte type parameter.It will get a wrong result when we put a String type parameter.

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right , just delete System.out.println(protocolByte);.

Comment on lines 69 to 71
} catch (IllegalArgumentException e) {
throw new RuntimeException("parser specified protocol error. protocol=" + protocol, e);
throw new RuntimeException("parser specified protocol error. protocol=" + serializeTypeConfigInThisServer, e);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, No need to catch the runtime exception and rethrow it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay,I will fix it.

@coveralls
Copy link

coveralls commented Jul 29, 2020

Coverage Status

Coverage increased (+0.2%) to 51.342% when pulling 4e5a953 on fantow:fix_issue#2206 into e58a6b2 on apache:develop.

@@ -0,0 +1,22 @@
package org.apache.rocketmq.remoting.protocol;
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing ASF license header

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thx,I have fixed it.

Comment on lines 70 to 72
} catch (IllegalArgumentException e) {
throw new RuntimeException("parser specified protocol error. protocol=" + protocol, e);
e.printStackTrace();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, no need to catch Runtime exception.

@RongtongJin RongtongJin added this to the 4.8.0 milestone Jul 31, 2020
@RongtongJin RongtongJin changed the title [ISSUE#2206] Fix the issue can not throw the right exception [ISSUE #2206] Fix the issue can not throw the right exception Aug 13, 2020
@imaffe imaffe self-requested a review August 19, 2020 07:06
@RongtongJin RongtongJin modified the milestones: 4.8.0, 4.8.1 Dec 4, 2020
@github-actions
Copy link

This PR is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR.

@github-actions github-actions bot added the stale label Sep 29, 2022
@github-actions
Copy link

github-actions bot commented Oct 2, 2022

This PR was closed because it has been inactive for 3 days since being marked as stale.

@github-actions github-actions bot closed this Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants