View | Details | Raw Unified | Return to bug 63805
Collapse All | Expand All

(-)src/java/org/apache/poi/hssf/record/FontRecord.java (-6 / +5 lines)
Lines 23-28 Link Here
23
import org.apache.poi.util.LittleEndianOutput;
23
import org.apache.poi.util.LittleEndianOutput;
24
import org.apache.poi.util.StringUtil;
24
import org.apache.poi.util.StringUtil;
25
25
26
import java.util.Objects;
27
26
/**
28
/**
27
 * Title:        Font Record (0x0031) <p>
29
 * Title:        Font Record (0x0031) <p>
28
 * - describes a font in the workbook (index = 0-3,5-infinity - skip 4)<P>
30
 * - describes a font in the workbook (index = 0-3,5-infinity - skip 4)<P>
Lines 479-494 Link Here
479
		field_6_underline           == other.field_6_underline &&
481
		field_6_underline           == other.field_6_underline &&
480
		field_7_family              == other.field_7_family &&
482
		field_7_family              == other.field_7_family &&
481
		field_8_charset             == other.field_8_charset &&
483
		field_8_charset             == other.field_8_charset &&
482
		field_9_zero                == other.field_9_zero &&
484
		field_9_zero                == other.field_9_zero && 
483
        stringEquals(this.field_11_font_name, other.field_11_font_name)
485
		Objects.equals(this.field_11_font_name, other.field_11_font_name)
484
		;
486
		;
485
	}
487
	}
486
488
487
    public boolean equals(Object o) {
489
    public boolean equals(Object o) {
488
        return (o instanceof FontRecord) ? sameProperties((FontRecord)o) : false;
490
        return (o instanceof FontRecord) ? sameProperties((FontRecord)o) : false;
489
    }
491
    }
490
    
492
491
    private static boolean stringEquals(String s1, String s2) {
492
        return (s1 == s2 || (s1 != null && s1.equals(s2)));
493
    }
494
}
493
}
(-)src/java/org/apache/poi/hssf/util/HSSFColor.java (-6 / +2 lines)
Lines 17-27 Link Here
17
17
18
package org.apache.poi.hssf.util;
18
package org.apache.poi.hssf.util;
19
19
20
import java.util.Collections;
20
import java.util.*;
21
import java.util.EnumMap;
22
import java.util.HashMap;
23
import java.util.Locale;
24
import java.util.Map;
25
21
26
import org.apache.poi.ss.usermodel.Color;
22
import org.apache.poi.ss.usermodel.Color;
27
import org.apache.poi.util.Removal;
23
import org.apache.poi.util.Removal;
Lines 343-349 Link Here
343
339
344
        if (index != hssfColor.index) return false;
340
        if (index != hssfColor.index) return false;
345
        if (index2 != hssfColor.index2) return false;
341
        if (index2 != hssfColor.index2) return false;
346
        return color != null ? color.equals(hssfColor.color) : hssfColor.color == null;
342
        return Objects.equals(color, hssfColor.color);
347
    }
343
    }
348
344
349
    @Override
345
    @Override
(-)src/java/org/apache/poi/ss/util/CellReference.java (-3 / +2 lines)
Lines 20-25 Link Here
20
import static org.apache.poi.util.StringUtil.endsWithIgnoreCase;
20
import static org.apache.poi.util.StringUtil.endsWithIgnoreCase;
21
21
22
import java.util.Locale;
22
import java.util.Locale;
23
import java.util.Objects;
23
import java.util.regex.Matcher;
24
import java.util.regex.Matcher;
24
import java.util.regex.Pattern;
25
import java.util.regex.Pattern;
25
26
Lines 577-585 Link Here
577
                && _colIndex == cr._colIndex
578
                && _colIndex == cr._colIndex
578
                && _isRowAbs == cr._isRowAbs
579
                && _isRowAbs == cr._isRowAbs
579
                && _isColAbs == cr._isColAbs
580
                && _isColAbs == cr._isColAbs
580
                && ((_sheetName == null)
581
                && (Objects.equals(_sheetName, cr._sheetName));
581
                        ? (cr._sheetName == null)
582
                        : _sheetName.equals(cr._sheetName));
583
    }
582
    }
584
583
585
    @Override
584
    @Override
(-)src/ooxml/java/org/apache/poi/xssf/binary/XSSFHyperlinkRecord.java (-1 / +3 lines)
Lines 20-25 Link Here
20
import org.apache.poi.ss.util.CellRangeAddress;
20
import org.apache.poi.ss.util.CellRangeAddress;
21
import org.apache.poi.util.Internal;
21
import org.apache.poi.util.Internal;
22
22
23
import java.util.Objects;
24
23
/**
25
/**
24
 * This is a read only record that maintains information about
26
 * This is a read only record that maintains information about
25
 * a hyperlink.  In OOXML land, this information has to be merged
27
 * a hyperlink.  In OOXML land, this information has to be merged
Lines 87-93 Link Here
87
89
88
        XSSFHyperlinkRecord that = (XSSFHyperlinkRecord) o;
90
        XSSFHyperlinkRecord that = (XSSFHyperlinkRecord) o;
89
91
90
        if (cellRangeAddress != null ? !cellRangeAddress.equals(that.cellRangeAddress) : that.cellRangeAddress != null)
92
        if (!Objects.equals(cellRangeAddress, that.cellRangeAddress))
91
            return false;
93
            return false;
92
        if (relId != null ? !relId.equals(that.relId) : that.relId != null) return false;
94
        if (relId != null ? !relId.equals(that.relId) : that.relId != null) return false;
93
        if (location != null ? !location.equals(that.location) : that.location != null) return false;
95
        if (location != null ? !location.equals(that.location) : that.location != null) return false;
(-)src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java (-12 / +4 lines)
Lines 20-29 Link Here
20
import java.io.FileInputStream;
20
import java.io.FileInputStream;
21
import java.io.IOException;
21
import java.io.IOException;
22
import java.io.InputStream;
22
import java.io.InputStream;
23
import java.util.HashMap;
23
import java.util.*;
24
import java.util.Map;
25
import java.util.Set;
26
import java.util.TreeSet;
27
24
28
import org.apache.poi.hwpf.HWPFDocument;
25
import org.apache.poi.hwpf.HWPFDocument;
29
import org.apache.poi.hwpf.HWPFDocumentCore;
26
import org.apache.poi.hwpf.HWPFDocumentCore;
Lines 101-108 Link Here
101
        Element element1 = (Element) node1;
98
        Element element1 = (Element) node1;
102
        Element element2 = (Element) node2;
99
        Element element2 = (Element) node2;
103
100
104
        if ( !equals( requiredTagName, element1.getTagName() )
101
        if ( !Objects.equals( requiredTagName, element1.getTagName() )
105
                || !equals( requiredTagName, element2.getTagName() ) )
102
                || !Objects.equals( requiredTagName, element2.getTagName() ) )
106
            return false;
103
            return false;
107
104
108
        NamedNodeMap attributes1 = element1.getAttributes();
105
        NamedNodeMap attributes1 = element1.getAttributes();
Lines 122-128 Link Here
122
                attr2 = (Attr) attributes2.getNamedItem( attr1.getName() );
119
                attr2 = (Attr) attributes2.getNamedItem( attr1.getName() );
123
120
124
            if ( attr2 == null
121
            if ( attr2 == null
125
                    || !equals( attr1.getTextContent(), attr2.getTextContent() ) )
122
                    || !Objects.equals( attr1.getTextContent(), attr2.getTextContent() ) )
126
                return false;
123
                return false;
127
        }
124
        }
128
125
Lines 157-167 Link Here
157
        }
154
        }
158
    }
155
    }
159
156
160
    static boolean equals( String str1, String str2 )
161
    {
162
        return str1 == null ? str2 == null : str1.equals( str2 );
163
    }
164
165
    public static String getBorderType( BorderCode borderCode )
157
    public static String getBorderType( BorderCode borderCode )
166
    {
158
    {
167
        if ( borderCode == null )
159
        if ( borderCode == null )

Return to bug 63805