Skip to content

format hellomessage with hex#3

Open
317787106 wants to merge 5 commits intohotfix/add_log_supportfrom
hotfix/fix_print_hellomessage
Open

format hellomessage with hex#3
317787106 wants to merge 5 commits intohotfix/add_log_supportfrom
hotfix/fix_print_hellomessage

Conversation

@317787106
Copy link
Copy Markdown
Owner

No description provided.

String[] lines = helloMessage.toString().split("\n");
StringBuilder sb = new StringBuilder();
for (String line : lines) {
if (line.contains("nodeId")) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is it possible that using string matching may unintentionally replace unrelated content? I think it's not a good way for 3 reasons:1. If there are multiple fields containing "nodeId" in different contexts 2. If helloMessage add a new filed which name contains "nodeId" 3. If the proto toString() format changes in future?

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.

3 participants