1 /* |
1 /* |
2 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
29 * @modules jdk.compiler/com.sun.tools.javac.api |
29 * @modules jdk.compiler/com.sun.tools.javac.api |
30 * jdk.compiler/com.sun.tools.javac.main |
30 * jdk.compiler/com.sun.tools.javac.main |
31 * jdk.jdeps/com.sun.tools.classfile |
31 * jdk.jdeps/com.sun.tools.classfile |
32 * @build toolbox.ToolBox InMemoryFileManager TestResult TestBase |
32 * @build toolbox.ToolBox InMemoryFileManager TestResult TestBase |
33 * @build InnerClassesInInnerClassTestBase InnerClassesTestBase |
33 * @build InnerClassesInInnerClassTestBase InnerClassesTestBase |
34 * @run main InnerClassesInInnerEnumTest |
34 * @run main InnerClassesInInnerEnumTest true |
|
35 * @run main InnerClassesInInnerEnumTest false |
35 */ |
36 */ |
|
37 |
|
38 import java.util.Arrays; |
|
39 import java.util.List; |
36 |
40 |
37 public class InnerClassesInInnerEnumTest extends InnerClassesInInnerClassTestBase { |
41 public class InnerClassesInInnerEnumTest extends InnerClassesInInnerClassTestBase { |
38 |
42 |
|
43 final boolean expectSyntheticClass; |
|
44 |
|
45 public InnerClassesInInnerEnumTest(boolean expectSyntheticClass) { |
|
46 this.expectSyntheticClass = expectSyntheticClass; |
|
47 } |
|
48 |
39 public static void main(String[] args) throws TestFailedException { |
49 public static void main(String[] args) throws TestFailedException { |
40 InnerClassesTestBase test = new InnerClassesInInnerEnumTest(); |
50 boolean expectSyntheticClass = Boolean.parseBoolean(args[0]); |
|
51 InnerClassesTestBase test = new InnerClassesInInnerEnumTest(expectSyntheticClass); |
41 test.test("InnerClassesSrc$Inner", "Inner", "1"); |
52 test.test("InnerClassesSrc$Inner", "Inner", "1"); |
42 } |
53 } |
43 |
54 |
44 @Override |
55 @Override |
45 public void setProperties() { |
56 public void setProperties() { |
46 setOuterOtherModifiers(Modifier.EMPTY, Modifier.STATIC); |
57 setOuterOtherModifiers(Modifier.EMPTY, Modifier.STATIC); |
47 setOuterClassType(ClassType.ENUM); |
58 setOuterClassType(ClassType.ENUM); |
48 setInnerClassType(ClassType.CLASS); |
59 setInnerClassType(ClassType.CLASS); |
49 setHasSyntheticClass(true); |
60 setHasSyntheticClass(expectSyntheticClass); |
50 setPrefix("Inner {;"); |
61 setPrefix("Inner {;"); |
51 setSuffix("}"); |
62 setSuffix("}"); |
52 } |
63 } |
|
64 |
|
65 @Override |
|
66 protected List<String> getCompileOptions() { |
|
67 return !expectSyntheticClass ? |
|
68 super.getCompileOptions() : |
|
69 Arrays.asList("-source", "10", "-target", "10"); |
|
70 } |
53 } |
71 } |