From: Javen O'Neal Date: Mon, 13 Jun 2016 10:55:49 +0000 (+0000) Subject: Sonar: 'static modifier out of order with the JLS suggestions.remove No need to check... X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4a85959d45bf9e5b8f2305f21a3b50ac243ced8f;p=poi.git 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 --- diff --git a/src/java/org/apache/poi/POIDocument.java b/src/java/org/apache/poi/POIDocument.java index 7235958ddf..68ed3c1769 100644 --- a/src/java/org/apache/poi/POIDocument.java +++ b/src/java/org/apache/poi/POIDocument.java @@ -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