pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1825138 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/ValidationResult.java
Date Fri, 23 Feb 2018 17:10:40 GMT
Author: tilman
Date: Fri Feb 23 17:10:40 2018
New Revision: 1825138

URL: http://svn.apache.org/viewvc?rev=1825138&view=rev
Log:
PDFBOX-4122: make errorCode final, remove code that is never used because errorCode is never
null (if it was, it would throw NPE in the constructor)

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/ValidationResult.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/ValidationResult.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/ValidationResult.java?rev=1825138&r1=1825137&r2=1825138&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/ValidationResult.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/ValidationResult.java
Fri Feb 23 17:10:40 2018
@@ -174,7 +174,7 @@ public class ValidationResult
          * Error identifier. This error code can be used as identifier to internationalize
the logging message using
          * i18n.
          */
-        private String errorCode;
+        private final String errorCode;
 
         /**
          * Error details
@@ -436,11 +436,7 @@ public class ValidationResult
             {
                 ValidationError ve = (ValidationError) o;
                 // check errorCode
-                if (errorCode == null && ve.errorCode != null)
-                {
-                    return false;
-                }
-                else if (!errorCode.equals(ve.errorCode))
+                if (!errorCode.equals(ve.errorCode))
                 {
                     return false;
                 }
@@ -463,13 +459,11 @@ public class ValidationResult
                 }
                 // check warning
                 return isWarning == ve.isWarning;
-
             }
             else
             {
                 return false;
             }
         }
-
     }
 }



Mime
View raw message