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 int index = classSignature.indexOf(";");
429 if (index == classSignature.length()) {
430 // trim leading 'L' and trailing ';'
431 return classSignature.substring(1, classSignature.length() - 1)
432 .replace('/', '.');
433 } else {
434 // type descriptor of a hidden class is "L" + N + ";" + "/" + <suffix>
435 // the class name is mapped to: N.replace('/', '.') + "/" + <suffix>
436 return classSignature.substring(1, index)
437 .replace('/', '.')
438 + classSignature.substring(index+1); // skip ';'
439 }
440 }
441
442 public String classSignature() {
443 return classSignature;
444 }
445
446 String eventName() {
447 return "ClassUnloadEvent";
448 }
449 }
450
451 class ExceptionEventImpl extends LocatableEventImpl
452 implements ExceptionEvent {
453 private ObjectReference exception;
454 private Location catchLocation;
455
456 ExceptionEventImpl(JDWP.Event.Composite.Events.Exception evt) {
457 super(evt, evt.requestID, evt.thread, evt.location);
458 this.exception = evt.exception;
459 this.catchLocation = evt.catchLocation;
|