Skip to content

Conversation

@317787106
Copy link
Owner

No description provided.

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

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.

4 participants