isEmpty | “扫黄”

This commit is contained in:
林万程
2023-08-31 08:03:37 +08:00
parent 54f102fdfb
commit c37148a56a
13 changed files with 20 additions and 17 deletions

View File

@@ -177,7 +177,7 @@ public abstract class BaseLangDoc extends EditorLinePainter {
}
@NotNull String cutDoc = DocFilter.cutDoc(s, lineInfo.appSettings, true);
@NotNull String filterDoc = DocFilter.filterDoc(cutDoc, lineInfo.appSettings, lineInfo.projectSettings);
if (filterDoc.trim().length() == 0) {
if (filterDoc.trim().isEmpty()) {
return null;
}
return filterDoc;

View File

@@ -31,14 +31,14 @@ public abstract class BaseTagLangDoc<DocElement> extends BaseLangDoc {
for (@NotNull String name : names) {
appendTag(lineInfo, tagStrBuilder, docElement, name);
}
if (desc.length() > 0) {
if (!desc.isEmpty()) {
if (tagStrBuilder.length() > 0) {
tagStrBuilder.insert(0, " @ ");
}
tagStrBuilder.insert(0, desc);
}
@NotNull String text = tagStrBuilder.toString().trim();
if (text.length() == 0) {
if (text.isEmpty()) {
return null;
}
return text;

View File

@@ -42,7 +42,7 @@ public class DocFilter {
}
s = s.trim();
sb.append(s);
if (s.length() > 0) {
if (!s.isEmpty()) {
sb.append(" ");
}
lineCount++;
@@ -93,7 +93,7 @@ public class DocFilter {
*/
public static void addHtml(@NotNull StringBuilder sb, @NotNull String s) {
@NotNull String deleteHtml = html2Text(s);
if (deleteHtml.length() > 0) {
if (!deleteHtml.isEmpty()) {
sb.append(deleteHtml);
}
}

View File

@@ -52,14 +52,14 @@ public class DocSkip {
}
static boolean include(@NotNull String text, @NotNull Pattern include) {
if (include.pattern().length() == 0) {
if (include.pattern().isEmpty()) {
return true;
}
return include.matcher(text).find();
}
static boolean exclude(@NotNull String text, @NotNull Pattern exclude) {
if (exclude.pattern().length() == 0) {
if (exclude.pattern().isEmpty()) {
return false;
}
return exclude.matcher(text).find();