summaryrefslogtreecommitdiffstats
path: root/src/scratchpad
diff options
context:
space:
mode:
authorAxel Howind <axh@apache.org>2019-11-12 15:47:46 +0000
committerAxel Howind <axh@apache.org>2019-11-12 15:47:46 +0000
commit0d4d57ace0f5a4d1dd986c78407936902b95fa5d (patch)
tree38012d0e93b28dd7c0d943534c478c78283da82b /src/scratchpad
parent1794ae97c1cb3f760b7d6d7b4789f3656e31a397 (diff)
downloadpoi-0d4d57ace0f5a4d1dd986c78407936902b95fa5d.tar.gz
poi-0d4d57ace0f5a4d1dd986c78407936902b95fa5d.zip
Replace AbstractWordUtils.equals with Objects.equals
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1869705 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad')
-rw-r--r--src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java16
-rw-r--r--src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java3
2 files changed, 6 insertions, 13 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java
index a29bd305a0..6792c358f9 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java
@@ -20,10 +20,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
+import java.util.*;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.HWPFDocumentCore;
@@ -101,8 +98,8 @@ public class AbstractWordUtils
Element element1 = (Element) node1;
Element element2 = (Element) node2;
- if ( !equals( requiredTagName, element1.getTagName() )
- || !equals( requiredTagName, element2.getTagName() ) )
+ if ( !Objects.equals( requiredTagName, element1.getTagName() )
+ || !Objects.equals( requiredTagName, element2.getTagName() ) )
return false;
NamedNodeMap attributes1 = element1.getAttributes();
@@ -122,7 +119,7 @@ public class AbstractWordUtils
attr2 = (Attr) attributes2.getNamedItem( attr1.getName() );
if ( attr2 == null
- || !equals( attr1.getTextContent(), attr2.getTextContent() ) )
+ || !Objects.equals( attr1.getTextContent(), attr2.getTextContent() ) )
return false;
}
@@ -157,11 +154,6 @@ public class AbstractWordUtils
}
}
- static boolean equals( String str1, String str2 )
- {
- return str1 == null ? str2 == null : str1.equals( str2 );
- }
-
public static String getBorderType( BorderCode borderCode )
{
if ( borderCode == null )
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java
index 91de8b1b40..784fb5028c 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java
@@ -23,6 +23,7 @@ import java.io.IOException;
import java.util.Deque;
import java.util.LinkedList;
import java.util.List;
+import java.util.Objects;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
@@ -200,7 +201,7 @@ public class WordToHtmlConverter extends AbstractWordConverter
Triplet triplet = getCharacterRunTriplet( characterRun );
if ( AbstractWordUtils.isNotEmpty( triplet.fontName )
- && !AbstractWordUtils.equals( triplet.fontName,
+ && !Objects.equals( triplet.fontName,
blockProperies.pFontName ) )
{
style.append("font-family:").append(triplet.fontName).append(";");