Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use String.join instead of Collectors.joining #3973

Merged
merged 2 commits into from
Dec 28, 2023
Merged

Conversation

wborn
Copy link
Member

@wborn wborn commented Dec 27, 2023

String.join results in less code when joining an Iterable or Array.

String.join results in less code when joining an Iterable or Array.

Signed-off-by: Wouter Born <github@maindrain.net>
@wborn wborn requested a review from a team as a code owner December 27, 2023 21:36
Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

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

Can you fix the typo?

@@ -48,7 +45,7 @@ public String toValue(final String string, INode node) throws ValueConverterExce
}
}
}
return Arrays.stream(ids).collect(Collectors.joining(SEPERATOR));
return String.join(SEPERATOR, ids);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return String.join(SEPERATOR, ids);
return String.join(SEPARATOR, ids);

@@ -65,7 +62,7 @@ public String toString(String value) throws ValueConverterException {
ids[i] = toEscapedString(id);
}
}
return Arrays.stream(ids).collect(Collectors.joining(SEPERATOR));
return String.join(SEPERATOR, ids);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return String.join(SEPERATOR, ids);
return String.join(SEPARATOR, ids);

Signed-off-by: Wouter Born <github@maindrain.net>
Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

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

Thanks!

@J-N-K J-N-K merged commit 0e03943 into openhab:main Dec 28, 2023
3 checks passed
@J-N-K J-N-K added the enhancement An enhancement or new feature of the Core label Dec 28, 2023
@J-N-K J-N-K added this to the 4.2 milestone Dec 28, 2023
@wborn wborn deleted the string-join branch December 28, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants