Author: onealj
Date: Wed Oct 18 14:40:56 2017
New Revision: 1812532
URL: http://svn.apache.org/viewvc?rev=1812532&view=rev
Log:
cleanup for r1812470: avoid NPEs from string.isEmpty()
Modified:
poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java
Modified: poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java?rev=1812532&r1=1812531&r2=1812532&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
(original)
+++ poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java Wed
Oct 18 14:40:56 2017
@@ -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 = " ";
}
Modified:
poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java?rev=1812532&r1=1812531&r2=1812532&view=diff
==============================================================================
---
poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java
(original)
+++
poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java
Wed Oct 18 14:40:56 2017
@@ -169,8 +169,8 @@ public abstract class BaseTestCellCommen
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());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]