author | jjg |
Thu, 31 Mar 2016 15:20:50 -0700 | |
changeset 36778 | e04318f39f92 |
parent 36526 | 3b41f1c69604 |
permissions | -rw-r--r-- |
16968 | 1 |
/* |
36526 | 2 |
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
16968 | 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 |
|
32337 | 7 |
* published by the Free Software Foundation. |
16968 | 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 |
*/ |
|
23 |
||
24 |
/* |
|
25 |
* @test |
|
26 |
* @bug 8010659 |
|
27 |
* @summary Javac Crashes while building OpenJFX |
|
26100 | 28 |
* @library /tools/lib |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
26100
diff
changeset
|
29 |
* @modules jdk.compiler/com.sun.tools.javac.api |
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
26100
diff
changeset
|
30 |
* jdk.compiler/com.sun.tools.javac.main |
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
31 |
* @build toolbox.ToolBox toolbox.JavacTask |
16968 | 32 |
* @run main CompilerCrashWhenMixingBinariesAndSourcesTest |
33 |
*/ |
|
34 |
||
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
35 |
import toolbox.JavacTask; |
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
36 |
import toolbox.ToolBox; |
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
37 |
|
16968 | 38 |
public class CompilerCrashWhenMixingBinariesAndSourcesTest { |
39 |
private static final String ASource = |
|
40 |
"class A {\n" + |
|
41 |
" void test() {new B(){};}\n" + |
|
42 |
"}"; |
|
43 |
private static final String BSource = |
|
44 |
"class B extends C {}"; |
|
45 |
private static final String CSource = |
|
46 |
"class C extends D {\n" + |
|
47 |
" String m(int i) {return null;}\n" + |
|
48 |
"}"; |
|
49 |
private static final String DSource = |
|
50 |
"class D {\n" + |
|
51 |
" Object m(int i) {return null;}\n" + |
|
52 |
"}"; |
|
53 |
||
26100 | 54 |
public static void main(String[] args) throws Exception { |
55 |
ToolBox tb = new ToolBox(); |
|
56 |
||
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
57 |
new JavacTask(tb) |
26100 | 58 |
.sources(ASource, BSource, CSource, DSource) |
59 |
.run(); |
|
16968 | 60 |
|
26100 | 61 |
tb.deleteFiles("A.class", "A$1.class", "C.class", "D.class"); |
16968 | 62 |
|
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
63 |
new JavacTask(tb) |
26100 | 64 |
.classpath(".") |
65 |
.sources(ASource, CSource, DSource) |
|
66 |
.run(); |
|
16968 | 67 |
} |
68 |
} |