1 23 24 package org.objectweb.fractal.julia.asm; 25 26 import java.io.PrintStream ; 27 import java.io.PrintWriter ; 28 29 33 34 public class ClassGenerationException extends ClassNotFoundException { 35 36 39 40 private Throwable exception; 41 42 45 46 private String classDescriptor; 47 48 56 57 public ClassGenerationException ( 58 final Throwable exception, 59 final String classDescriptor, 60 final String message) 61 { 62 super("Cannot generate the " + classDescriptor + " class. " + message); 63 this.exception = exception; 64 this.classDescriptor = classDescriptor; 65 } 66 67 public Throwable getException () { 68 return exception; 69 } 70 71 76 77 public String getClassDescriptor () { 78 return classDescriptor; 79 } 80 81 84 85 public void printStackTrace () { 86 if (exception != null) { 87 System.err.println(this); 88 exception.printStackTrace(); 89 } else { 90 super.printStackTrace(); 91 } 92 } 93 94 99 100 public void printStackTrace (final PrintStream s) { 101 if (exception != null) { 102 s.println(this); 103 exception.printStackTrace(s); 104 } else { 105 super.printStackTrace(s); 106 } 107 } 108 109 114 115 public void printStackTrace (final PrintWriter s) { 116 if (exception != null) { 117 s.write(this + "\n"); 118 exception.printStackTrace(s); 119 } else { 120 super.printStackTrace(s); 121 } 122 } 123 } 124 | Popular Tags |