Replace AbstractWordUtils.equals with Objects.equals

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1869705 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Axel Howind 2019-11-12 15:47:46 +00:00
parent 1794ae97c1
commit 0d4d57ace0
2 changed files with 6 additions and 13 deletions

View File

@ -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 )

View File

@ -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(";");