< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetClassModifiers/getclmdf006.java

Print this page

  1 /*
  2  * Copyright (c) 2003, 2018, 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.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */

 37             System.err.println("Could not load getclmdf006 library");
 38             System.err.println("java.library.path:"
 39                 + System.getProperty("java.library.path"));
 40             throw ule;
 41         }
 42     }
 43 
 44     native static void check(Class cls, int mod);
 45     native static int getRes();
 46 
 47     public static void main(String args[]) {
 48         args = nsk.share.jvmti.JVMTITest.commonInit(args);
 49 
 50         // produce JCK-like exit status.
 51         System.exit(run(args, System.out) + JCK_STATUS_BASE);
 52     }
 53 
 54     public static int run(String args[], PrintStream out) {
 55         check(getclmdf006a.class, 0);
 56         check(getclmdf006b.class, Modifier.FINAL);
 57         check(getclmdf006c.class, Modifier.ABSTRACT);
 58         check(getclmdf006d.class, Modifier.INTERFACE | Modifier.ABSTRACT);
 59         check(getclmdf006e.class, Modifier.PUBLIC | Modifier.INTERFACE |
 60                                   Modifier.ABSTRACT);
 61         check(Inner01.class, Modifier.PUBLIC);
 62         check(Inner02.class, Modifier.PUBLIC | Modifier.FINAL);
 63         check(Inner03.class, Modifier.PUBLIC | Modifier.ABSTRACT);
 64         check(Inner04.class, Modifier.PRIVATE);
 65         check(Inner05.class, Modifier.PRIVATE | Modifier.FINAL);
 66         check(Inner06.class, Modifier.PRIVATE | Modifier.ABSTRACT);
 67         check(Inner07.class, Modifier.PROTECTED);
 68         check(Inner08.class, Modifier.PROTECTED | Modifier.FINAL);
 69         check(Inner09.class, Modifier.PROTECTED | Modifier.ABSTRACT);
 70         check(Inner10.class, Modifier.STATIC);
 71         check(Inner11.class, Modifier.STATIC | Modifier.FINAL);
 72         check(Inner12.class, Modifier.STATIC | Modifier.ABSTRACT);

 73         check(Inner13.class, Modifier.PUBLIC | Modifier.STATIC);
 74         check(Inner14.class, Modifier.PUBLIC | Modifier.STATIC |
 75                              Modifier.FINAL);
 76         check(Inner15.class, Modifier.PUBLIC | Modifier.STATIC |
 77                              Modifier.ABSTRACT);
 78         check(Inner16.class, Modifier.PRIVATE | Modifier.STATIC);
 79         check(Inner17.class, Modifier.PRIVATE | Modifier.STATIC |
 80                              Modifier.FINAL);
 81         check(Inner18.class, Modifier.PRIVATE | Modifier.STATIC |
 82                              Modifier.ABSTRACT);
 83         check(Inner19.class, Modifier.PROTECTED | Modifier.STATIC);
 84         check(Inner20.class, Modifier.PROTECTED | Modifier.STATIC |
 85                              Modifier.FINAL);
 86         check(Inner21.class, Modifier.PROTECTED | Modifier.STATIC |
 87                              Modifier.ABSTRACT);
 88         check(Inner22.class, Modifier.STATIC | Modifier.INTERFACE |
 89                              Modifier.ABSTRACT);
 90         check(Inner23.class, Modifier.PUBLIC | Modifier.STATIC |
 91                              Modifier.INTERFACE | Modifier.ABSTRACT);
 92         check(Inner24.class, Modifier.PRIVATE | Modifier.STATIC |
 93                              Modifier.INTERFACE | Modifier.ABSTRACT);
 94         check(Inner25.class, Modifier.PROTECTED | Modifier.STATIC |
 95                              Modifier.INTERFACE | Modifier.ABSTRACT);
 96         return getRes();
 97     }
 98 
 99     public class Inner01 {}
100     public final class Inner02 {}
101     public abstract class Inner03 {}
102     private class Inner04 {}
103     private final class Inner05 {}
104     private abstract class Inner06 {}
105     protected class Inner07 {}
106     protected final class Inner08 {}
107     protected abstract class Inner09 {}

  1 /*
  2  * Copyright (c) 2003, 2022, 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.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */

 37             System.err.println("Could not load getclmdf006 library");
 38             System.err.println("java.library.path:"
 39                 + System.getProperty("java.library.path"));
 40             throw ule;
 41         }
 42     }
 43 
 44     native static void check(Class cls, int mod);
 45     native static int getRes();
 46 
 47     public static void main(String args[]) {
 48         args = nsk.share.jvmti.JVMTITest.commonInit(args);
 49 
 50         // produce JCK-like exit status.
 51         System.exit(run(args, System.out) + JCK_STATUS_BASE);
 52     }
 53 
 54     public static int run(String args[], PrintStream out) {
 55         check(getclmdf006a.class, 0);
 56         check(getclmdf006b.class, Modifier.FINAL);
 57         check(getclmdf006c.class, Modifier.ABSTRACT | Modifier.PERMITS_VALUE);
 58         check(getclmdf006d.class, Modifier.INTERFACE | Modifier.ABSTRACT);
 59         check(getclmdf006e.class, Modifier.PUBLIC | Modifier.INTERFACE |
 60                                   Modifier.ABSTRACT);
 61         check(Inner01.class, Modifier.PUBLIC);
 62         check(Inner02.class, Modifier.PUBLIC | Modifier.FINAL);
 63         check(Inner03.class, Modifier.PUBLIC | Modifier.ABSTRACT);
 64         check(Inner04.class, Modifier.PRIVATE);
 65         check(Inner05.class, Modifier.PRIVATE | Modifier.FINAL);
 66         check(Inner06.class, Modifier.PRIVATE | Modifier.ABSTRACT);
 67         check(Inner07.class, Modifier.PROTECTED);
 68         check(Inner08.class, Modifier.PROTECTED | Modifier.FINAL);
 69         check(Inner09.class, Modifier.PROTECTED | Modifier.ABSTRACT);
 70         check(Inner10.class, Modifier.STATIC);
 71         check(Inner11.class, Modifier.STATIC | Modifier.FINAL);
 72         check(Inner12.class, Modifier.STATIC | Modifier.ABSTRACT |
 73                              Modifier.PERMITS_VALUE);
 74         check(Inner13.class, Modifier.PUBLIC | Modifier.STATIC);
 75         check(Inner14.class, Modifier.PUBLIC | Modifier.STATIC |
 76                              Modifier.FINAL);
 77         check(Inner15.class, Modifier.PUBLIC | Modifier.STATIC |
 78                              Modifier.ABSTRACT | Modifier.PERMITS_VALUE);
 79         check(Inner16.class, Modifier.PRIVATE | Modifier.STATIC);
 80         check(Inner17.class, Modifier.PRIVATE | Modifier.STATIC |
 81                              Modifier.FINAL);
 82         check(Inner18.class, Modifier.PRIVATE | Modifier.STATIC |
 83                              Modifier.ABSTRACT | Modifier.PERMITS_VALUE);
 84         check(Inner19.class, Modifier.PROTECTED | Modifier.STATIC);
 85         check(Inner20.class, Modifier.PROTECTED | Modifier.STATIC |
 86                              Modifier.FINAL);
 87         check(Inner21.class, Modifier.PROTECTED | Modifier.STATIC |
 88                              Modifier.ABSTRACT | Modifier.PERMITS_VALUE);
 89         check(Inner22.class, Modifier.STATIC | Modifier.INTERFACE |
 90                              Modifier.ABSTRACT);
 91         check(Inner23.class, Modifier.PUBLIC | Modifier.STATIC |
 92                              Modifier.INTERFACE | Modifier.ABSTRACT);
 93         check(Inner24.class, Modifier.PRIVATE | Modifier.STATIC |
 94                              Modifier.INTERFACE | Modifier.ABSTRACT);
 95         check(Inner25.class, Modifier.PROTECTED | Modifier.STATIC |
 96                              Modifier.INTERFACE | Modifier.ABSTRACT);
 97         return getRes();
 98     }
 99 
100     public class Inner01 {}
101     public final class Inner02 {}
102     public abstract class Inner03 {}
103     private class Inner04 {}
104     private final class Inner05 {}
105     private abstract class Inner06 {}
106     protected class Inner07 {}
107     protected final class Inner08 {}
108     protected abstract class Inner09 {}
< prev index next >