style: use proper spelling (#5436)

checkstyle: fix typos, style

Co-authored-by: alxkm <alx@alx.com>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
This commit is contained in:
Alex Klymenko
2024-08-30 08:50:14 +02:00
committed by GitHub
parent d189c3a719
commit 87cf89192b
7 changed files with 18 additions and 19 deletions

View File

@ -13,7 +13,6 @@ public final class ReverseWordsInString {
* @param s the input string
* @return A string created by reversing the order of the words in {@code s}
*/
public static String reverseWordsInString(final String s) {
var words = s.trim().split("\\s+");
Collections.reverse(Arrays.asList(words));

View File

@ -15,13 +15,13 @@ public final class Upper {
}
/**
* Converts all of the characters in this {@code String} to upper case
* Converts all the characters in this {@code String} to upper case
*
* @param s the string to convert
* @return the {@code String}, converted to uppercase.
*/
public static String toUpperCase(String s) {
if (s == null || "".equals(s)) {
if (s == null || s.isEmpty()) {
return s;
}
char[] values = s.toCharArray();