]> source.dussan.org Git - poi.git/commitdiff
convert "".equals(string) to string.isEmpty()
authorJaven O'Neal <onealj@apache.org>
Wed, 18 Oct 2017 08:22:51 +0000 (08:22 +0000)
committerJaven O'Neal <onealj@apache.org>
Wed, 18 Oct 2017 08:22:51 +0000 (08:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812470 13f79535-47bb-0310-9956-ffa450edef68

src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java
src/testcases/org/apache/poi/ss/formula/functions/BaseTestFunctionsFromSpreadsheet.java
src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java

index d266b7475e06819c1945463ebde763343c7c0d17..34842a5bd32ca95b80af9bf22ec00a5e99974264 100644 (file)
@@ -479,7 +479,7 @@ public class ToHtml {
                                 style.getDataFormatString());
                         CellFormatResult result = cf.apply(cell);
                         content = result.text;
-                        if ("".equals(content)) {
+                        if (content.isEmpty()) {
                             content = "&nbsp;";
                         }
                     }
index e2f48252749b598e59ccb0937ba3ad1d4bd3aa84..70b3cd4c2b26ae9ee679d69353ee73444253b5c3 100644 (file)
@@ -798,7 +798,7 @@ public class TestSignatureInfo {
 
     private static File copy(File input) throws IOException {
         String extension = input.getName().replaceAll(".*?(\\.[^.]+)?$", "$1");
-        if (extension == null || "".equals(extension)) {
+        if (extension == null || extension.isEmpty()) {
             extension = ".zip";
         }
 
index 724a432657be3299431acd0a55f19cd8e58461f3..88b52493ea9f775b1b8b8fde12a97bfc7ca0043a 100644 (file)
@@ -127,7 +127,7 @@ public abstract class BaseTestFunctionsFromSpreadsheet {
             String rowComment = getCellTextValue(r, SS.COLUMN_ROW_COMMENT, "row comment");
 
             String testName = (currentGroupComment+'\n'+rowComment).replace("null", "").trim().replace("\n", " - ");
-            if ("".equals(testName)) {
+            if (testName.isEmpty()) {
                 testName = evalCell.getCellFormula();
             }
             
index 535094ff055224263fe181adf2dc896b075e8d82..8ceec105e21a0d7534e289a3c92458a9af4b870e 100644 (file)
@@ -170,7 +170,7 @@ public abstract class BaseTestCellComment {
 
             assertEquals("Yegor Kozlov", comment.getAuthor());
             assertFalse("cells in the second column have not empyy notes",
-                    "".equals(comment.getString().getString()));
+                    comment.getString().getString().isEmpty());
             assertEquals(rownum, comment.getRow());
             assertEquals(cell.getColumnIndex(), comment.getColumn());
         }