isEmpty | “扫黄”
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user