You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2016/06/13 10:55:49 UTC

svn commit: r1748175 - /poi/trunk/src/java/org/apache/poi/POIDocument.java

Author: onealj
Date: Mon Jun 13 10:55:49 2016
New Revision: 1748175

URL: http://svn.apache.org/viewvc?rev=1748175&view=rev
Log:
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.

Modified:
    poi/trunk/src/java/org/apache/poi/POIDocument.java

Modified: poi/trunk/src/java/org/apache/poi/POIDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/POIDocument.java?rev=1748175&r1=1748174&r2=1748175&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/POIDocument.java (original)
+++ poi/trunk/src/java/org/apache/poi/POIDocument.java Mon Jun 13 10:55:49 2016
@@ -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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org