Skip to content

Commit

Permalink
dbeaver/pro#3893 extract whitespace pattern to common utils
Browse files Browse the repository at this point in the history
  • Loading branch information
n5a5 committed Dec 23, 2024
1 parent 7b6bd39 commit 7f84899
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
* Common utils
*/
public class CommonUtils {
/**
* A pattern that matches one or more whitespace characters.
*/
public static final Pattern WHITESPACE_PATTERN = Pattern.compile("\\s+");

public static final char PARAGRAPH_CHAR = (char) 182;

Expand Down Expand Up @@ -873,7 +877,7 @@ public static String trim(String str) {
}

public static String compactWhiteSpaces(String str) {

Check warning on line 879 in modules/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java

View workflow job for this annotation

GitHub Actions / Check / Lint

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./modules/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java:879:5: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)
return str.replaceAll("\\s+", " ");
return WHITESPACE_PATTERN.matcher(str).replaceAll(" ");
}

public static String getSingleLineString(String displayString) {

Check warning on line 883 in modules/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java

View workflow job for this annotation

GitHub Actions / Check / Lint

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./modules/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java:883:5: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)
Expand Down

0 comments on commit 7f84899

Please sign in to comment.