< prev index next >

src/jdk.jdi/share/classes/com/sun/jdi/ClassNotLoadedException.java

Print this page
rev 60127 : 8249205: Remove unnecessary trademark symbols


  28 /**
  29  * Thrown to indicate that the requested class has
  30  * not yet been loaded through the appropriate class loader.
  31  * <p>
  32  * Due to the lazy class linking performed by many VMs, it is
  33  * possible for a field or variable to be visible in a program
  34  * before the associated class is loaded. Until the class is loaded
  35  * all that is available is a signature string. If an attempt is made to
  36  * set the value of such a field or variable from JDI, the appropriate
  37  * type checking cannot be done because the destination class has not been
  38  * loaded. The same is true for the element class of array elements.
  39  * <p>
  40  * It is not advisable to solve this problem by attempting a class load on
  41  * the fly in this case. There are two problems in having the debugger load
  42  * a class instead of waiting for it to load over the normal course
  43  * of events.
  44  * <ul>
  45  * <li>There can be no guarantee that running the appropriate class
  46  * loader won't cause a deadlock in loading the
  47  * class. Class loaders can consist of arbitrary
  48  * Java&trade; programming language code and the
  49  * class loading methods are usually synchronized. Most of the work
  50  * done by a debugger happens when threads are suspended. If another
  51  * application thread is suspended within the same class loader,
  52  *  a deadlock is very possible.
  53  * <li>Changing the order in which classes are normally loaded may either mask
  54  * or reveal bugs in the application. An unintrusive debugger should strive
  55  * to leave unchanged the behavior of the application being debugged.
  56  * </ul>
  57  * To avoid these potential problems, this exception is thrown.
  58  * <p>
  59  * Note that this exception will be thrown until the class in question
  60  * is visible to the class loader of enclosing class. (That is, the
  61  * class loader of the enclosing class must be an <i>initiating</i> class
  62  * loader for the class in question.)
  63  * See
  64  * <cite>The Java&trade; Virtual Machine Specification</cite>
  65  * for more details.
  66  *
  67  * @author Gordon Hirsch
  68  * @since  1.3
  69  */
  70 public class ClassNotLoadedException extends Exception {
  71 
  72     private static final long serialVersionUID = -6242978768444298722L;
  73 
  74     private String className;
  75 
  76     public ClassNotLoadedException(String className) {
  77         super();
  78         this.className = className;
  79     }
  80 
  81     public ClassNotLoadedException(String className, String message) {
  82         super(message);
  83         this.className = className;
  84     }


  28 /**
  29  * Thrown to indicate that the requested class has
  30  * not yet been loaded through the appropriate class loader.
  31  * <p>
  32  * Due to the lazy class linking performed by many VMs, it is
  33  * possible for a field or variable to be visible in a program
  34  * before the associated class is loaded. Until the class is loaded
  35  * all that is available is a signature string. If an attempt is made to
  36  * set the value of such a field or variable from JDI, the appropriate
  37  * type checking cannot be done because the destination class has not been
  38  * loaded. The same is true for the element class of array elements.
  39  * <p>
  40  * It is not advisable to solve this problem by attempting a class load on
  41  * the fly in this case. There are two problems in having the debugger load
  42  * a class instead of waiting for it to load over the normal course
  43  * of events.
  44  * <ul>
  45  * <li>There can be no guarantee that running the appropriate class
  46  * loader won't cause a deadlock in loading the
  47  * class. Class loaders can consist of arbitrary
  48  * Java programming language code and the
  49  * class loading methods are usually synchronized. Most of the work
  50  * done by a debugger happens when threads are suspended. If another
  51  * application thread is suspended within the same class loader,
  52  *  a deadlock is very possible.
  53  * <li>Changing the order in which classes are normally loaded may either mask
  54  * or reveal bugs in the application. An unintrusive debugger should strive
  55  * to leave unchanged the behavior of the application being debugged.
  56  * </ul>
  57  * To avoid these potential problems, this exception is thrown.
  58  * <p>
  59  * Note that this exception will be thrown until the class in question
  60  * is visible to the class loader of enclosing class. (That is, the
  61  * class loader of the enclosing class must be an <i>initiating</i> class
  62  * loader for the class in question.)
  63  * See
  64  * <cite>The Java Virtual Machine Specification</cite>
  65  * for more details.
  66  *
  67  * @author Gordon Hirsch
  68  * @since  1.3
  69  */
  70 public class ClassNotLoadedException extends Exception {
  71 
  72     private static final long serialVersionUID = -6242978768444298722L;
  73 
  74     private String className;
  75 
  76     public ClassNotLoadedException(String className) {
  77         super();
  78         this.className = className;
  79     }
  80 
  81     public ClassNotLoadedException(String className, String message) {
  82         super(message);
  83         this.className = className;
  84     }
< prev index next >