Sonar: 'static modifier out of order with the JLS suggestions.remove No need to check for null before an instanceof; the instanceof keyword returns false when given a null argument.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1748175 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-06-13 10:55:49 +00:00
parent e29bf52845
commit b53be78aed
1 changed files with 8 additions and 4 deletions

View File

@ -54,7 +54,7 @@ public abstract class POIDocument {
protected DirectoryNode directory; protected DirectoryNode directory;
/** For our own logging use */ /** For our own logging use */
private final static POILogger logger = POILogFactory.getLogger(POIDocument.class); private static final POILogger logger = POILogFactory.getLogger(POIDocument.class);
/* Have the property streams been read yet? (Only done on-demand) */ /* Have the property streams been read yet? (Only done on-demand) */
private boolean initialized = false; private boolean initialized = false;
@ -145,10 +145,12 @@ public abstract class POIDocument {
// DocumentSummaryInformation // DocumentSummaryInformation
ps = getPropertySet(DocumentSummaryInformation.DEFAULT_STREAM_NAME); ps = getPropertySet(DocumentSummaryInformation.DEFAULT_STREAM_NAME);
if (ps != null && ps instanceof DocumentSummaryInformation) { if (ps instanceof DocumentSummaryInformation) {
dsInf = (DocumentSummaryInformation)ps; dsInf = (DocumentSummaryInformation)ps;
} else if (ps != null) { } else if (ps != null) {
logger.log(POILogger.WARN, "DocumentSummaryInformation property set came back with wrong class - ", ps.getClass()); logger.log(POILogger.WARN, "DocumentSummaryInformation property set came back with wrong class - ", ps.getClass());
} else {
logger.log(POILogger.WARN, "DocumentSummaryInformation property set came back as null");
} }
// SummaryInformation // SummaryInformation
@ -157,6 +159,8 @@ public abstract class POIDocument {
sInf = (SummaryInformation)ps; sInf = (SummaryInformation)ps;
} else if (ps != null) { } else if (ps != null) {
logger.log(POILogger.WARN, "SummaryInformation property set came back with wrong class - ", ps.getClass()); logger.log(POILogger.WARN, "SummaryInformation property set came back with wrong class - ", ps.getClass());
} else {
logger.log(POILogger.WARN, "SummaryInformation property set came back as null");
} }
// Mark the fact that we've now loaded up the properties // Mark the fact that we've now loaded up the properties