felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1062903 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java
Date Mon, 24 Jan 2011 18:08:09 GMT
Author: rickhall
Date: Mon Jan 24 18:08:09 2011
New Revision: 1062903

URL: http://svn.apache.org/viewvc?rev=1062903&view=rev
Log:
Check for null Bundle in logging code. (FELIX-2800)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java?rev=1062903&r1=1062902&r2=1062903&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java Mon Jan 24
18:08:09 2011
@@ -118,10 +118,20 @@ public class Logger implements ServiceLi
         Bundle bundle, ServiceReference sr, int level,
         String msg, Throwable throwable)
     {
-        String s = (sr == null) ? null : "SvcRef " + sr;
-        s = (s == null) ? null : s + " Bundle '" + bundle.getBundleId() + "'";
-        s = (s == null) ? msg : s + " " + msg;
-        s = (throwable == null) ? s : s + " (" + throwable + ")";
+        String s = "";
+        if (sr != null)
+        {
+            s = s + "SvcRef "  + sr + " ";
+        }
+        else if (bundle != null)
+        {
+            s = s + "Bundle " + bundle.toString() + " ";
+        }
+        s = s + msg;
+        if (throwable != null)
+        {
+            s = s + " (" + throwable + ")";
+        }
         switch (level)
         {
             case LOG_DEBUG:
@@ -311,4 +321,4 @@ public class Logger implements ServiceLi
             }
         }
     }
-}
\ No newline at end of file
+}



Mime
View raw message