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 e61e346436
commit 4a85959d45

View File

@ -54,7 +54,7 @@ public abstract class POIDocument {
protected DirectoryNode directory;
/** 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) */
private boolean initialized = false;
@ -145,18 +145,22 @@ public abstract class POIDocument {
// DocumentSummaryInformation
ps = getPropertySet(DocumentSummaryInformation.DEFAULT_STREAM_NAME);
if (ps != null && ps instanceof DocumentSummaryInformation) {
if (ps instanceof DocumentSummaryInformation) {
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());
} else {
logger.log(POILogger.WARN, "DocumentSummaryInformation property set came back as null");
}
// SummaryInformation
ps = getPropertySet(SummaryInformation.DEFAULT_STREAM_NAME);
if (ps instanceof SummaryInformation) {
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());
} else {
logger.log(POILogger.WARN, "SummaryInformation property set came back as null");
}
// Mark the fact that we've now loaded up the properties