mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
use isEmpty
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1925002 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b3d0fe52d3
commit
92d4a8d86d
@ -4644,7 +4644,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet, OoxmlSheetEx
|
||||
|
||||
StringBuilder rng = new StringBuilder();
|
||||
rng.append(c);
|
||||
if(rng.length() > 0 && r.length() > 0) {
|
||||
if(rng.length() > 0 && !r.isEmpty()) {
|
||||
rng.append(',');
|
||||
}
|
||||
rng.append(r);
|
||||
|
||||
@ -144,13 +144,13 @@ public class XWPFWordExtractor implements POIXMLTextExtractor {
|
||||
// Add comments
|
||||
XWPFCommentsDecorator decorator = new XWPFCommentsDecorator(paragraph, null);
|
||||
String commentText = decorator.getCommentText();
|
||||
if (commentText.length() > 0) {
|
||||
if (!commentText.isEmpty()) {
|
||||
text.append(commentText).append('\n');
|
||||
}
|
||||
|
||||
// Do endnotes and footnotes
|
||||
String footnameText = paragraph.getFootnoteText();
|
||||
if (footnameText != null && footnameText.length() > 0) {
|
||||
if (footnameText != null && !footnameText.isEmpty()) {
|
||||
text.append(footnameText).append('\n');
|
||||
}
|
||||
|
||||
|
||||
@ -112,7 +112,7 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun {
|
||||
NodeList kids = t.getDomNode().getChildNodes();
|
||||
for (int n = 0; n < kids.getLength(); n++) {
|
||||
if (kids.item(n) instanceof Text) {
|
||||
if (text.length() > 0) {
|
||||
if (!text.isEmpty()) {
|
||||
text.append("\n");
|
||||
}
|
||||
text.append(kids.item(n).getNodeValue());
|
||||
@ -148,7 +148,7 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun {
|
||||
*/
|
||||
static void preserveSpaces(XmlString xs) {
|
||||
String text = xs.getStringValue();
|
||||
if (text != null && text.length() >= 1
|
||||
if (text != null && !text.isEmpty()
|
||||
&& (Character.isWhitespace(text.charAt(0)) || Character.isWhitespace(text.charAt(text.length()-1)))) {
|
||||
try (XmlCursor c = xs.newCursor()) {
|
||||
c.toNextToken();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user