Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetClassModifiers/getclmdf006.java
40948 views
/*1* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package nsk.jvmti.GetClassModifiers;2425import java.io.PrintStream;26import java.lang.reflect.Modifier;2728public class getclmdf006 {2930final static int JCK_STATUS_BASE = 95;3132static {33try {34System.loadLibrary("getclmdf006");35} catch (UnsatisfiedLinkError ule) {36System.err.println("Could not load getclmdf006 library");37System.err.println("java.library.path:"38+ System.getProperty("java.library.path"));39throw ule;40}41}4243native static void check(Class cls, int mod);44native static int getRes();4546public static void main(String args[]) {47args = nsk.share.jvmti.JVMTITest.commonInit(args);4849// produce JCK-like exit status.50System.exit(run(args, System.out) + JCK_STATUS_BASE);51}5253public static int run(String args[], PrintStream out) {54check(getclmdf006a.class, 0);55check(getclmdf006b.class, Modifier.FINAL);56check(getclmdf006c.class, Modifier.ABSTRACT);57check(getclmdf006d.class, Modifier.INTERFACE | Modifier.ABSTRACT);58check(getclmdf006e.class, Modifier.PUBLIC | Modifier.INTERFACE |59Modifier.ABSTRACT);60check(Inner01.class, Modifier.PUBLIC);61check(Inner02.class, Modifier.PUBLIC | Modifier.FINAL);62check(Inner03.class, Modifier.PUBLIC | Modifier.ABSTRACT);63check(Inner04.class, Modifier.PRIVATE);64check(Inner05.class, Modifier.PRIVATE | Modifier.FINAL);65check(Inner06.class, Modifier.PRIVATE | Modifier.ABSTRACT);66check(Inner07.class, Modifier.PROTECTED);67check(Inner08.class, Modifier.PROTECTED | Modifier.FINAL);68check(Inner09.class, Modifier.PROTECTED | Modifier.ABSTRACT);69check(Inner10.class, Modifier.STATIC);70check(Inner11.class, Modifier.STATIC | Modifier.FINAL);71check(Inner12.class, Modifier.STATIC | Modifier.ABSTRACT);72check(Inner13.class, Modifier.PUBLIC | Modifier.STATIC);73check(Inner14.class, Modifier.PUBLIC | Modifier.STATIC |74Modifier.FINAL);75check(Inner15.class, Modifier.PUBLIC | Modifier.STATIC |76Modifier.ABSTRACT);77check(Inner16.class, Modifier.PRIVATE | Modifier.STATIC);78check(Inner17.class, Modifier.PRIVATE | Modifier.STATIC |79Modifier.FINAL);80check(Inner18.class, Modifier.PRIVATE | Modifier.STATIC |81Modifier.ABSTRACT);82check(Inner19.class, Modifier.PROTECTED | Modifier.STATIC);83check(Inner20.class, Modifier.PROTECTED | Modifier.STATIC |84Modifier.FINAL);85check(Inner21.class, Modifier.PROTECTED | Modifier.STATIC |86Modifier.ABSTRACT);87check(Inner22.class, Modifier.STATIC | Modifier.INTERFACE |88Modifier.ABSTRACT);89check(Inner23.class, Modifier.PUBLIC | Modifier.STATIC |90Modifier.INTERFACE | Modifier.ABSTRACT);91check(Inner24.class, Modifier.PRIVATE | Modifier.STATIC |92Modifier.INTERFACE | Modifier.ABSTRACT);93check(Inner25.class, Modifier.PROTECTED | Modifier.STATIC |94Modifier.INTERFACE | Modifier.ABSTRACT);95return getRes();96}9798public class Inner01 {}99public final class Inner02 {}100public abstract class Inner03 {}101private class Inner04 {}102private final class Inner05 {}103private abstract class Inner06 {}104protected class Inner07 {}105protected final class Inner08 {}106protected abstract class Inner09 {}107static class Inner10 {}108static final class Inner11 {}109static abstract class Inner12 {}110public static class Inner13 {}111public static final class Inner14 {}112public static abstract class Inner15 {}113private static class Inner16 {}114private static final class Inner17 {}115private static abstract class Inner18 {}116protected static class Inner19 {}117protected static final class Inner20 {}118protected static abstract class Inner21 {}119120interface Inner22 {}121public interface Inner23 {}122private interface Inner24 {}123protected interface Inner25 {}124}125126class getclmdf006a {}127final class getclmdf006b {}128abstract class getclmdf006c {}129interface getclmdf006d {}130131132