< prev index next >

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

Print this page
rev 58565 : 8238358: Implementation of JEP 371: Hidden Classes
Reviewed-by: duke
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
   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


 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             return classSignature.substring(1, classSignature.length()-1)
 429                 .replace('/', '.');








 430         }
 431 
 432         public String classSignature() {
 433             return classSignature;
 434         }
 435 
 436         String eventName() {
 437             return "ClassUnloadEvent";
 438         }
 439     }
 440 
 441     class ExceptionEventImpl extends LocatableEventImpl
 442                                              implements ExceptionEvent {
 443         private ObjectReference exception;
 444         private Location catchLocation;
 445 
 446         ExceptionEventImpl(JDWP.Event.Composite.Events.Exception evt) {
 447             super(evt, evt.requestID, evt.thread, evt.location);
 448             this.exception = evt.exception;
 449             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


 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;
 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;


< prev index next >