qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject [1/3] qpid-broker-j git commit: QPID-8081: [Broker-J] [Logback] Defensive guard against null activeFile
Date Fri, 02 Feb 2018 12:53:07 GMT
Repository: qpid-broker-j
Updated Branches:
  refs/heads/7.0.x 90d7b41f0 -> 87e9c7f41


QPID-8081: [Broker-J] [Logback] Defensive guard against null activeFile


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/d0736c51
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/d0736c51
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/d0736c51

Branch: refs/heads/7.0.x
Commit: d0736c518f85495ce43a9c1d480693b93eef8c70
Parents: 7d39879
Author: Keith Wall <kwall@apache.org>
Authored: Fri Feb 2 12:17:40 2018 +0000
Committer: Keith Wall <kwall@apache.org>
Committed: Fri Feb 2 12:31:56 2018 +0000

----------------------------------------------------------------------
 .../apache/qpid/server/logging/logback/AppenderUtils.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/d0736c51/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/AppenderUtils.java
----------------------------------------------------------------------
diff --git a/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/AppenderUtils.java
b/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/AppenderUtils.java
index 16fd87d..2de5161 100644
--- a/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/AppenderUtils.java
+++ b/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/AppenderUtils.java
@@ -116,7 +116,7 @@ public class AppenderUtils
     {
         private final boolean _rollOnRestart;
         private final FileSize _maxFileSize;
-        private boolean _isFirst = true;
+        private volatile boolean _isFirst = true;
 
         public DailyTriggeringPolicy(boolean isRollOnRestart, String maxFileSize)
         {
@@ -141,7 +141,7 @@ public class AppenderUtils
             if (_rollOnRestart && _isFirst)
             {
                 _isFirst = false;
-                if (activeFile.exists() && activeFile.length() == 0)
+                if (activeFile != null && activeFile.exists() && activeFile.length()
== 0)
                 {
                     computeNextCheck();
                     return false;
@@ -161,7 +161,7 @@ public class AppenderUtils
     {
         private final boolean _rollOnRestart;
         private final FileSize _maxFileSize;
-        private boolean _isFirst = true;
+        private volatile boolean _isFirst = true;
 
         public SizeTriggeringPolicy(boolean isRollOnRestart, String maxFileSize)
         {
@@ -177,7 +177,7 @@ public class AppenderUtils
             if (_rollOnRestart && _isFirst)
             {
                 _isFirst = false;
-                return activeFile.exists() && activeFile.length() != 0l;
+                return activeFile != null && activeFile.exists() && activeFile.length()
!= 0;
             }
             else
             {
@@ -193,7 +193,7 @@ public class AppenderUtils
 
     static class SimpleRollingPolicy extends FixedWindowRollingPolicy
     {
-        private int _maxFiles;
+        private final int _maxFiles;
 
         public SimpleRollingPolicy(int maxHistory)
         {


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


Mime
View raw message