< prev index next >

src/jdk.jdi/share/classes/com/sun/tools/jdi/EventSetImpl.java

Print this page
rev 58768 : 8238358: Implementation of JEP 371: Hidden Classes
Reviewed-by: alanb, cjplummer, coleenp, dholmes, dlong, forax, jlahoda, psandoz, plevart, vromero
Contributed-by: mandy.chung@oracle.com, lois.foltan@oracle.com, david.holmes@oracle.com, harold.seigel@oracle.com, serguei.spitsyn@oracle.com, alex.buckley@oracle.com, jamsheed.c.m@oracle.com, jan.lahoda@oracle.com, amy.lu@oracle.com
rev 58769 : [mq]: type-descriptor-name


 408         }
 409 
 410         public ReferenceType referenceType() {
 411             return referenceType;
 412         }
 413 
 414         String eventName() {
 415             return "ClassPrepareEvent";
 416         }
 417     }
 418 
 419     class ClassUnloadEventImpl extends EventImpl implements ClassUnloadEvent {
 420         private String classSignature;
 421 
 422         ClassUnloadEventImpl(JDWP.Event.Composite.Events.ClassUnload evt) {
 423             super(evt, evt.requestID);
 424             this.classSignature = evt.signature;
 425         }
 426 
 427         public String className() {

 428             String name = classSignature.substring(1, classSignature.length() - 1);
 429             int index = name.indexOf(".");  // check if it's a hidden class
 430             if (index < 0) {
 431                 name = name.replace('/', '.');
 432             } else {
 433                 // the class name of a hidden class is <binary-name> + "/" + <suffix>
 434                 name = name.substring(0, index).replace('/', '.') + "/" +
 435                          name.substring(index + 1, name.length());

 436             }
 437             return name;
 438         }
 439 
 440         public String classSignature() {
 441             return classSignature;
 442         }
 443 
 444         String eventName() {
 445             return "ClassUnloadEvent";
 446         }
 447     }
 448 
 449     class ExceptionEventImpl extends LocatableEventImpl
 450                                              implements ExceptionEvent {
 451         private ObjectReference exception;
 452         private Location catchLocation;
 453 
 454         ExceptionEventImpl(JDWP.Event.Composite.Events.Exception evt) {
 455             super(evt, evt.requestID, evt.thread, evt.location);
 456             this.exception = evt.exception;
 457             this.catchLocation = evt.catchLocation;




 408         }
 409 
 410         public ReferenceType referenceType() {
 411             return referenceType;
 412         }
 413 
 414         String eventName() {
 415             return "ClassPrepareEvent";
 416         }
 417     }
 418 
 419     class ClassUnloadEventImpl extends EventImpl implements ClassUnloadEvent {
 420         private String classSignature;
 421 
 422         ClassUnloadEventImpl(JDWP.Event.Composite.Events.ClassUnload evt) {
 423             super(evt, evt.requestID);
 424             this.classSignature = evt.signature;
 425         }
 426 
 427         public String className() {
 428             // trim leading "L" and trailing ";"
 429             String name = classSignature.substring(1, classSignature.length() - 1);
 430             int index = name.indexOf(".");  // check if it is a hidden class
 431             if (index < 0) {
 432                 return name.replace('/', '.');
 433             }  else {
 434                 // map the type descriptor from: "L" + N + "." + <suffix> + ";"
 435                 // to class name: N.replace('/', '.') + "/" + <suffix>
 436                 return name.substring(0, index).replace('/', '.')
 437                         + "/" + name.substring(index + 1);
 438             }

 439         }
 440 
 441         public String classSignature() {
 442             return classSignature;
 443         }
 444 
 445         String eventName() {
 446             return "ClassUnloadEvent";
 447         }
 448     }
 449 
 450     class ExceptionEventImpl extends LocatableEventImpl
 451                                              implements ExceptionEvent {
 452         private ObjectReference exception;
 453         private Location catchLocation;
 454 
 455         ExceptionEventImpl(JDWP.Event.Composite.Events.Exception evt) {
 456             super(evt, evt.requestID, evt.thread, evt.location);
 457             this.exception = evt.exception;
 458             this.catchLocation = evt.catchLocation;


< prev index next >