test/runtime/contended/HasNonStatic.java

Tue, 28 Jan 2014 14:56:01 -0800

author
katleman
date
Tue, 28 Jan 2014 14:56:01 -0800
changeset 6578
2fdc8a2268d2
parent 0
f90c822e73f8
permissions
-rw-r--r--

Added tag jdk8u5-b06 for changeset 956c0e048ef2

     1 /*
     2  * Copyright (c) 2013, 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  */
    24 import java.io.BufferedReader;
    25 import java.io.InputStreamReader;
    26 import java.lang.Class;
    27 import java.lang.String;
    28 import java.lang.System;
    29 import java.lang.management.ManagementFactory;
    30 import java.lang.management.RuntimeMXBean;
    31 import java.util.ArrayList;
    32 import java.util.List;
    33 import java.util.concurrent.CyclicBarrier;
    34 import java.util.regex.Matcher;
    35 import java.util.regex.Pattern;
    36 import java.lang.reflect.Field;
    37 import java.lang.reflect.Modifier;
    38 import sun.misc.Unsafe;
    39 import sun.misc.Contended;
    41 /*
    42  * @test
    43  * @bug     8015270
    44  * @summary \@Contended: fix multiple issues in the layout code
    45  *
    46  * @run main/othervm -XX:-RestrictContended HasNonStatic
    47  */
    48 public class HasNonStatic {
    50     public static void main(String[] args) throws Exception {
    51         R1 r1 = new R1();
    52         R2 r2 = new R2();
    53         R3 r3 = new R3();
    54         R4 r4 = new R4();
    55     }
    57     public static class R1 {
    58         @Contended
    59         Object o;
    60     }
    62     @Contended
    63     public static class R2 {
    64         Object o;
    65     }
    67     @Contended
    68     public static class R3 {
    69     }
    71     public static class R4 extends R3 {
    72     }
    74 }

mercurial