Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Logback: the reliable, generic, fast and flexible logging framework. Copyright (C) 1999-2011, QOS.ch. All rights reserved. This program and the accompanying materials are dual-licensed under either the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation or (per the licensee's choosing) under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.
 
 package ch.qos.logback.classic.spi;
 
 
 
 public class ThrowableProxy implements IThrowableProxy {
 
   private Throwable throwable;
   private String className;
   private String message;
   // package-private because of ThrowableProxyUtil
   // package-private because of ThrowableProxyUtil
   int commonFrames;
   private ThrowableProxy cause;
 
   private boolean calculatedPackageData = false;
 
   private static final Method GET_SUPPRESSED_METHOD;
 
   static {
     Method method = null;
     try {
       method = Throwable.class.getMethod("getSuppressed");
     } catch (NoSuchMethodException e) {
       // ignore, will get thrown in Java < 7
     }
      = method;
   }
 
   private static final ThrowableProxy[] NO_SUPPRESSED=new ThrowableProxy[0];
 
   public ThrowableProxy(Throwable throwable) {
    
     this. = throwable;
     this. = throwable.getClass().getName();
     this. = throwable.getMessage();
     this. = ThrowableProxyUtil.steArrayToStepArray(throwable
         .getStackTrace());
     
     Throwable nested = throwable.getCause();
     
     if (nested != null) {
       this. = new ThrowableProxy(nested);
       this.. = ThrowableProxyUtil
           .findNumberOfCommonFrames(nested.getStackTrace(),
               );
     }
     if( != null) {
       // this will only execute on Java 7
       try {
         Object obj = .invoke(throwable);
         if(obj instanceof Throwable[]) {
           Throwable[] throwableSuppressed = (Throwable[]) obj;
           if(throwableSuppressed.length > 0) {
              = new ThrowableProxy[throwableSuppressed.length];
             for(int i=0;i<throwableSuppressed.length;i++) {
               this.[i] = new ThrowableProxy(throwableSuppressed[i]);
               this.[i]. = ThrowableProxyUtil
                   .findNumberOfCommonFrames(throwableSuppressed[i].getStackTrace(),
                       );
             }
           }
         }
       } catch (IllegalAccessException e) {
         // ignore
       } catch (InvocationTargetException e) {
         // ignore
       }
     }
 
   }
 
 
   public Throwable getThrowable() {
     return ;
   }
 
   public String getMessage() {
     return ;
   }
 
  /*
   * (non-Javadoc)
   * 
   * @see ch.qos.logback.classic.spi.IThrowableProxy#getClassName()
   */
  public String getClassName() {
    return ;
  }
  }
  public int getCommonFrames() {
    return ;
  }
  /*
   * (non-Javadoc)
   * 
   * @see ch.qos.logback.classic.spi.IThrowableProxy#getCause()
   */
  public IThrowableProxy getCause() {
    return ;
  }
  public IThrowableProxy[] getSuppressed() {
    return ;
  }
    // if original instance (non-deserialized), and packagingDataCalculator
    // is not already initialized, then create an instance.
    // here we assume that (throwable == null) for deserialized instances
    if ( != null &&  == null) {
    }
  }
  public void calculatePackagingData() {
    if () {
      return;
    }
    if (pdc != null) {
       = true;
      pdc.calculate(this);
    }
  }
  public void fullDump() {
    StringBuilder builder = new StringBuilder();
      String string = step.toString();
      builder.append(.).append(string);
      ThrowableProxyUtil.subjoinPackagingData(builderstep);
      builder.append(.);
    }
    ..println(builder.toString());
  }
New to GrepCode? Check out our FAQ X