1 /* |
1 /* |
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 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. |
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 * @library /tools/lib /tools/javac/lib ../lib |
32 * @library /tools/lib /tools/javac/lib ../lib |
33 * @build toolbox.ToolBox InMemoryFileManager TestResult TestBase |
33 * @build toolbox.ToolBox InMemoryFileManager TestResult TestBase |
34 * @build AccessToPrivateSiblingsTest SyntheticTestDriver ExpectedClass ExpectedClasses |
34 * @build AccessToPrivateSiblingsTest SyntheticTestDriver ExpectedClass ExpectedClasses |
35 * @run main SyntheticTestDriver AccessToPrivateSiblingsTest 1 |
35 * @run main SyntheticTestDriver AccessToPrivateSiblingsTest |
36 */ |
36 */ |
37 |
37 |
38 /** |
38 /** |
39 * Access from sibling classes to sibling classes. |
39 * Access from sibling classes to sibling classes. |
40 * Synthetic members: |
40 * Synthetic members: |
48 */ |
48 */ |
49 @ExpectedClass(className = "AccessToPrivateSiblingsTest", expectedMethods = "<init>()") |
49 @ExpectedClass(className = "AccessToPrivateSiblingsTest", expectedMethods = "<init>()") |
50 @ExpectedClass(className = "AccessToPrivateSiblingsTest$Inner1", |
50 @ExpectedClass(className = "AccessToPrivateSiblingsTest$Inner1", |
51 expectedMethods = {"function()", "<init>(AccessToPrivateSiblingsTest)"}, |
51 expectedMethods = {"function()", "<init>(AccessToPrivateSiblingsTest)"}, |
52 expectedFields = "var", |
52 expectedFields = "var", |
53 expectedNumberOfSyntheticMethods = 4, |
|
54 expectedNumberOfSyntheticFields = 1) |
53 expectedNumberOfSyntheticFields = 1) |
55 @ExpectedClass(className = "AccessToPrivateSiblingsTest$Inner2", |
54 @ExpectedClass(className = "AccessToPrivateSiblingsTest$Inner2", |
56 expectedMethods = "<init>(AccessToPrivateSiblingsTest)", |
55 expectedMethods = "<init>(AccessToPrivateSiblingsTest)", |
57 expectedNumberOfSyntheticFields = 1) |
56 expectedNumberOfSyntheticFields = 1) |
58 @ExpectedClass(className = "AccessToPrivateSiblingsTest$Inner3", |
57 @ExpectedClass(className = "AccessToPrivateSiblingsTest$Inner3", |
59 expectedMethods = {"<init>()", "function()", "staticFunction()", "<clinit>()"}, |
58 expectedMethods = {"<init>()", "function()", "staticFunction()", "<clinit>()"}, |
60 expectedFields = {"var", "staticVar"}, |
59 expectedFields = {"var", "staticVar"}) |
61 expectedNumberOfSyntheticMethods = 4) |
|
62 @ExpectedClass(className = "AccessToPrivateSiblingsTest$Inner4", |
60 @ExpectedClass(className = "AccessToPrivateSiblingsTest$Inner4", |
63 expectedMethods = {"<init>()", "function()", "staticFunction()"}, |
61 expectedMethods = {"<init>()", "function()", "staticFunction()"}, |
64 expectedFields = {"var", "staticVar"}, |
62 expectedFields = {"var", "staticVar"}) |
65 expectedNumberOfSyntheticMethods = 4) |
|
66 public class AccessToPrivateSiblingsTest { |
63 public class AccessToPrivateSiblingsTest { |
67 |
64 |
68 private class Inner1 { |
65 private class Inner1 { |
69 private Inner1() {} |
66 private Inner1() {} |
70 private int var; |
67 private int var; |