| 1 | package com.jsql.view.swing.util; | |
| 2 | ||
| 3 | import com.jsql.util.StringUtil; | |
| 4 | import org.apache.commons.lang3.StringUtils; | |
| 5 | ||
| 6 | public class UiStringUtil { | |
| 7 | ||
| 8 | private UiStringUtil() { | |
| 9 | // Utility class | |
| 10 | } | |
| 11 | | |
| 12 | public static String detectUtf8Html(String text) { | |
| 13 |
1
1. detectUtf8Html : replaced return value with "" for com/jsql/view/swing/util/UiStringUtil::detectUtf8Html → NO_COVERAGE |
return UiStringUtil.detectUtf8Html(text, false); |
| 14 | } | |
| 15 | | |
| 16 | public static String detectUtf8HtmlNoWrap(String text) { | |
| 17 |
1
1. detectUtf8HtmlNoWrap : replaced return value with "" for com/jsql/view/swing/util/UiStringUtil::detectUtf8HtmlNoWrap → NO_COVERAGE |
return UiStringUtil.detectUtf8Html(text, true); |
| 18 | } | |
| 19 | | |
| 20 | public static String detectUtf8Html(String text, boolean nowrap) { | |
| 21 | // Fix #35217: NullPointerException on getBytes() | |
| 22 |
1
1. detectUtf8Html : negated conditional → NO_COVERAGE |
if (text == null) { |
| 23 | return StringUtils.EMPTY; | |
| 24 | } | |
| 25 | | |
| 26 | // Decode bytes for potentially UTF8 chars | |
| 27 | // Required by asian and hindi chars, otherwise wrong display in database tree | |
| 28 | String result = text; | |
| 29 |
1
1. detectUtf8Html : negated conditional → NO_COVERAGE |
if (StringUtil.containsNonStandardScripts(text)) { |
| 30 |
1
1. detectUtf8Html : negated conditional → NO_COVERAGE |
result = I18nViewUtil.formatNonLatin(text, nowrap ? "white-space:nowrap;" : StringUtils.EMPTY); |
| 31 | } | |
| 32 |
1
1. detectUtf8Html : replaced return value with "" for com/jsql/view/swing/util/UiStringUtil::detectUtf8Html → NO_COVERAGE |
return result; |
| 33 | } | |
| 34 | } | |
Mutations | ||
| 13 |
1.1 |
|
| 17 |
1.1 |
|
| 22 |
1.1 |
|
| 29 |
1.1 |
|
| 30 |
1.1 |
|
| 32 |
1.1 |