diff options
author | Javen O'Neal <onealj@apache.org> | 2017-10-18 14:40:56 +0000 |
---|---|---|
committer | Javen O'Neal <onealj@apache.org> | 2017-10-18 14:40:56 +0000 |
commit | 2a0aac8ea50a146ac7119f9d04d57d1e283e189e (patch) | |
tree | 5ef3d68099459ce901507496f383111f3f4a9290 /src | |
parent | 3a7e3846d5df2c348fc803a8124dbde50e8b56e1 (diff) | |
download | poi-2a0aac8ea50a146ac7119f9d04d57d1e283e189e.tar.gz poi-2a0aac8ea50a146ac7119f9d04d57d1e283e189e.zip |
cleanup for r1812470: avoid NPEs from string.isEmpty()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812532 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java | 2 | ||||
-rw-r--r-- | src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java b/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java index 34842a5bd3..d66ef83397 100644 --- a/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java +++ b/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java @@ -478,7 +478,7 @@ public class ToHtml { CellFormat cf = CellFormat.getInstance( style.getDataFormatString()); CellFormatResult result = cf.apply(cell); - content = result.text; + content = result.text; //never null if (content.isEmpty()) { content = " "; } diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java index 8ceec105e2..f19f1ac562 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java @@ -169,8 +169,8 @@ public abstract class BaseTestCellComment { assertNotNull("Cells in the second column have comments", sheet.getCellComment(new CellAddress(rownum, 1))); assertEquals("Yegor Kozlov", comment.getAuthor()); - assertFalse("cells in the second column have not empyy notes", - comment.getString().getString().isEmpty()); + assertTrue("cells in the second column should have non-empty notes", + !comment.getString().getString().isEmpty()); assertEquals(rownum, comment.getRow()); assertEquals(cell.getColumnIndex(), comment.getColumn()); } |