1 /*
2 * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
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 assert classSignature.startsWith("L") && classSignature.endsWith(";");
429 return classSignature.substring(1, classSignature.length()-1)
430 .replace('/', '.');
431 }
432
433 public String classSignature() {
434 return classSignature;
435 }
436
437 String eventName() {
438 return "ClassUnloadEvent";
439 }
440 }
441
442 class ExceptionEventImpl extends LocatableEventImpl
443 implements ExceptionEvent {
444 private ObjectReference exception;
445 private Location catchLocation;
446
447 ExceptionEventImpl(JDWP.Event.Composite.Events.Exception evt) {
448 super(evt, evt.requestID, evt.thread, evt.location);
449 this.exception = evt.exception;
450 this.catchLocation = evt.catchLocation;
|
1 /*
2 * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
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 assert classSignature.startsWith("L") && classSignature.endsWith(";");
429
430 // trim leading "L" and trailing ";"
431 String name = classSignature.substring(1, classSignature.length() - 1);
432 int index = name.indexOf("."); // check if it is a hidden class
433 if (index < 0) {
434 return name.replace('/', '.');
435 } else {
436 // map the type descriptor from: "L" + N + "." + <suffix> + ";"
437 // to class name: N.replace('/', '.') + "/" + <suffix>
438 return name.substring(0, index).replace('/', '.')
439 + "/" + name.substring(index + 1);
440 }
441 }
442
443 public String classSignature() {
444 return classSignature;
445 }
446
447 String eventName() {
448 return "ClassUnloadEvent";
449 }
450 }
451
452 class ExceptionEventImpl extends LocatableEventImpl
453 implements ExceptionEvent {
454 private ObjectReference exception;
455 private Location catchLocation;
456
457 ExceptionEventImpl(JDWP.Event.Composite.Events.Exception evt) {
458 super(evt, evt.requestID, evt.thread, evt.location);
459 this.exception = evt.exception;
460 this.catchLocation = evt.catchLocation;
|