< 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,7 +1,7 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -423,12 +423,20 @@
             super(evt, evt.requestID);
             this.classSignature = evt.signature;
         }
 
         public String className() {
-            return classSignature.substring(1, classSignature.length()-1)
-                .replace('/', '.');
+            String name = classSignature;
+            int index = name.indexOf(".");  // check if it's a hidden class
+            if (index < 0) {
+                name = name.replace('/', '.');
+            } else {
+                // the class name of a hidden class is <binary-name> + "/" + <suffix>
+                name = name.substring(0, index).replace('/', '.') + "/" +
+                         name.substring(index + 1, name.length());
+            }
+            return name;
         }
 
         public String classSignature() {
             return classSignature;
         }
< prev index next >