[logback-dev] svn commit: r1835 - logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/spi

noreply.ceki at qos.ch noreply.ceki at qos.ch
Wed Oct 15 18:58:23 CEST 2008


Author: ceki
Date: Wed Oct 15 18:58:23 2008
New Revision: 1835

Modified:
   logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/spi/PackagingDataCalculator.java

Log:
Under certain special circumstances (reproducible under Continuum on Linux)
the callerClass computed by R.getCaller class can be null.

Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/spi/PackagingDataCalculator.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/spi/PackagingDataCalculator.java	(original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/spi/PackagingDataCalculator.java	Wed Oct 15 18:58:23 2008
@@ -10,7 +10,6 @@
 package ch.qos.logback.classic.spi;
 
 import java.net.URL;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -83,23 +82,10 @@
         callerClass = Reflection.getCallerClass(localFirstCommon + i
             - missfireCount + 1);
       }
-
-
-
       StackTraceElementProxy step = stepArray[stepFirstCommon + i];
       String stepClassname = step.ste.getClassName();
 
-      if (callerClass == null) {
-        System.out.println("***********************************");
-        System.out.println("localFirstCommon=" + localFirstCommon + ", i=" + i
-            + ", missfireCount=" + missfireCount);
-        System.out.println("sum=" + (localFirstCommon + i - missfireCount + 1));
-        System.out.println("stepClassname="+stepClassname);
-        t.printStackTrace();
-        System.out.println(Arrays.toString(stepArray));
-      }
-      
-      if (stepClassname.equals(callerClass.getName())) {
+      if (callerClass != null && stepClassname.equals(callerClass.getName())) {
         lastExactClassLoader = callerClass.getClassLoader();
         if (firsExactClassLoader == null) {
           firsExactClassLoader = callerClass.getClassLoader();


More information about the logback-dev mailing list