David Brazdil | 11b67b2 | 2018-01-18 16:41:40 +0000 | [diff] [blame] | 1 | Test whether hidden API access flags are being enforced. The test is composed of |
| 2 | two JARs. The first (parent) defines methods and fields and the second (child) |
Orion Hodson | 198a27e | 2018-04-06 15:41:28 +0100 | [diff] [blame] | 3 | tries to access them with reflection/JNI/MethodHandles or link against them. |
| 4 | Note that the first is compiled twice - once with and once without hidden access |
| 5 | flags. |
David Brazdil | 11b67b2 | 2018-01-18 16:41:40 +0000 | [diff] [blame] | 6 | |
| 7 | The test then proceeds to exercise the following combinations of class loading: |
| 8 | (a) Both parent and child dex loaded with PathClassLoader, parent's class loader |
| 9 | is the child's class loader's parent. Access flags should not be enforced as |
| 10 | the parent does not belong to boot class path. |
| 11 | (b) Parent is appended to boot class path, child is loaded with PathClassLoader. |
| 12 | In this situation child should not be able to access hidden methods/fields |
| 13 | of the parent. |
| 14 | (c) Both parent and child are appended to boot class path. Restrictions should |
| 15 | not apply as hidden APIs are accessible within the boundaries of the boot |
| 16 | class path. |