- fixed "Equals method should not assume anything about the type of its argument"
- see http://findbugs.sourceforge.net/bugDescriptions.html#BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@
1568861 13f79535-47bb-0310-9956-
ffa450edef68
@Override
public boolean equals(Object obj) {
+ if (!(obj instanceof GUID)) return false;
GUID other = (GUID) obj;
- if (obj == null || !(obj instanceof GUID))
- return false;
return _d1 == other._d1 && _d2 == other._d2
&& _d3 == other._d3 && _d4 == other._d4;
}
DocumentEntry nativeEntry = \r
(DocumentEntry)directory.getEntry(OLE10_NATIVE);\r
byte[] data = new byte[nativeEntry.getSize()];\r
- directory.createDocumentInputStream(nativeEntry).read(data);\r
+ int readBytes = directory.createDocumentInputStream(nativeEntry).read(data);\r
+ assert(readBytes == data.length);\r
\r
return new Ole10Native(data, 0);\r
}
==================================================================== */
package org.apache.poi.ss.format;
-import org.apache.poi.ss.format.CellFormatPart.PartHandler;
-
import java.text.DecimalFormat;
import java.text.FieldPosition;
import java.util.BitSet;
import java.util.TreeSet;
import java.util.regex.Matcher;
+import org.apache.poi.ss.format.CellFormatPart.PartHandler;
+
/**
* This class implements printing out a value using a number format.
*
delEndPos + adjust; // delete end point in current
if (modPos < modEndPos) {
- if (nextChange.toAdd == "")
+ if ("".equals(nextChange.toAdd))
output.delete(modPos, modEndPos);
else {
char fillCh = nextChange.toAdd.charAt(0);
-->\r
<FindBugsFilter>\r
<Match>\r
- <Bug pattern="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE,MS_PKGPROTECT,MS_MUTABLE_ARRAY"/>\r
+ <Bug code="EI,EI2" pattern="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE,MS_PKGPROTECT,MS_MUTABLE_ARRAY"/>\r
</Match>\r
</FindBugsFilter>
\ No newline at end of file
public boolean equals( Object obj )
{
- if ( obj == null )
- {
- return false;
- }
+ if (!(obj instanceof ListFormatOverrideLevel)) return false;
ListFormatOverrideLevel lfolvl = (ListFormatOverrideLevel) obj;
boolean lvlEquality = false;
if ( _lvl != null )
@Override
public boolean equals( Object obj )
{
- if ( obj == null )
- return false;
+ if (!(obj instanceof ListLevel)) return false;
ListLevel lvl = (ListLevel) obj;
return lvl._lvlf.equals( this._lvlf )
@Override
public boolean equals( Object o )
{
+ if (!(o instanceof SEPX)) return false;
SEPX sepx = (SEPX) o;
if ( super.equals( o ) )
{