langtools/test/tools/javac/lambda/DoubleStaticImport.java
author jlahoda
Tue, 16 Aug 2016 16:43:00 +0200
changeset 40504 0a01f6710c84
parent 22448 a85fbad9d687
permissions -rw-r--r--
8078561: Error message should be generated once when -source 6 is specified Summary: Code to avoid duplicated errors about features not supported in the current source level moved to Log Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16566
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
     1
/*
22448
a85fbad9d687 8029230: Update copyright year to match last edit in jdk8 langtools repository for 2013
ksrini
parents: 16566
diff changeset
     2
 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
16566
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
     4
 *
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
     8
 *
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    14
 *
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    18
 *
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    21
 * questions.
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    22
 */
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    23
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    24
/*
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    25
 * @test
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    26
 * @bug 8009820
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    27
 * @summary AssertionError when compiling java code with two identical static imports
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    28
 * @compile DoubleStaticImport.java
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    29
 */
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    30
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    31
import static java.lang.Thread.holdsLock;
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    32
import static java.lang.Thread.holdsLock; //dup
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    33
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    34
class DoubleStaticImport {
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    35
    public void test() {
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    36
        holdsLock(null);
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    37
    }
604ce45d5f23 8009820: AssertionError when compiling java code with two identical static imports
mcimadamore
parents:
diff changeset
    38
}