langtools/test/tools/javac/T8010659/CompilerCrashWhenMixingBinariesAndSourcesTest.java
author juh
Tue, 25 Jun 2013 14:31:29 -0700
changeset 18551 882a3948c6e6
parent 16968 19f0da2d3143
child 26100 bb7dd001d190
permissions -rw-r--r--
8017325: Cleanup of the javadoc <code> tag in java.security.cert Summary: Convert javadoc <code>...</code> and <tt>...</tt> tags to {@code ...} Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16968
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
     1
/*
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
     4
 *
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    10
 *
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    15
 * accompanied this code).
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    16
 *
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    20
 *
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    23
 * questions.
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    24
 */
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    25
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    26
/*
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    27
 * @test
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    28
 * @bug 8010659
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    29
 * @summary Javac Crashes while building OpenJFX
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    30
 * @library /tools/javac/lib
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    31
 * @build ToolBox
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    32
 * @run main CompilerCrashWhenMixingBinariesAndSourcesTest
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    33
 */
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    34
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    35
public class CompilerCrashWhenMixingBinariesAndSourcesTest {
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    36
    private static final String ASource =
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    37
            "class A {\n" +
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    38
            "        void test() {new B(){};}\n" +
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    39
            "}";
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    40
    private static final String BSource =
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    41
            "class B extends C {}";
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    42
    private static final String CSource =
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    43
            "class C extends D {\n" +
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    44
            "        String m(int i) {return null;}\n" +
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    45
            "}";
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    46
    private static final String DSource =
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    47
            "class D {\n" +
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    48
            "        Object m(int i) {return null;}\n" +
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    49
            "}";
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    50
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    51
    public static void main (String[] args) throws Exception{
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    52
        ToolBox.JavaToolArgs javacParams = new ToolBox.JavaToolArgs()
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    53
                .setSources(ASource, BSource, CSource, DSource);
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    54
        ToolBox.javac(javacParams);
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    55
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    56
        ToolBox.rm("A.class");
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    57
        ToolBox.rm("A$1.class");
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    58
        ToolBox.rm("C.class");
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    59
        ToolBox.rm("D.class");
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    60
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    61
        javacParams = new ToolBox.JavaToolArgs()
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    62
                .setOptions("-cp", ".")
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    63
                .setSources(ASource, CSource, DSource);
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    64
        ToolBox.javac(javacParams);
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    65
    }
19f0da2d3143 8010659: Javac Crashes while building OpenJFX
vromero
parents:
diff changeset
    66
}