langtools/test/tools/javac/ExtendsAccess/ExtendsAccess.java
author jeff
Wed, 22 Jun 2011 10:10:54 -0700
changeset 9916 c35ecac744a5
parent 6150 d055fa8ced62
permissions -rw-r--r--
7057046: Add embedded license to THIRD PARTY README Reviewed-by: lana
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
 * @test  /nodynamiccopyright/
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 4087314 4087314 4785453
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary Test access checking within 'extends' and 'implements' clause.
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * @author William Maddox (maddox)
6150
d055fa8ced62 6971882: Remove -XDstdout from javac test
jjg
parents: 863
diff changeset
     6
 * @compile/fail/ref=ExtendsAccess.out -XDrawDiagnostics ExtendsAccess.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 * Should compile with errors as noted.
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
class ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
    class defaultClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
    public class publicClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
    private class privateClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
    protected class protectedClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
    static class defaultStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
    public static class publicStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
    private static class privateStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
    protected static class protectedStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
    interface defaultInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
    public interface publicInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
    private interface privateInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
    protected interface protectedInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
class ExtendsAccess111 extends publicClass { }                          // ERROR - 'publicClass' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
class ExtendsAccess112 extends defaultClass { }                         // ERROR - 'defaultClass' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
class ExtendsAccess113 extends protectedClass { }                       // ERROR - 'protectedClass' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
class ExtendsAccess114 extends privateClass { }                         // ERROR - 'privateClass' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
class ExtendsAccess1211 extends ExtendsAccess.publicClass { }           // OK - can extend inner classes (was ERROR - no enclosing instance)
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
class ExtendsAccess1221 extends ExtendsAccess.defaultClass { }          // OK - can extend inner classes (was ERROR - no enclosing instance)
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
class ExtendsAccess1231 extends ExtendsAccess.protectedClass { }        // OK - can extend inner classes (was ERROR - no enclosing instance)
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
class ExtendsAccess1241 extends ExtendsAccess.privateClass { }          // ERROR - cannot access 'privateClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
class ExtendsAccess1212 extends p.ExtendsAccess.publicClass { }         // OK - can extend inner classes (was ERROR - no enclosing instance)
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
class ExtendsAccess1222 extends p.ExtendsAccess.defaultClass { }        // ERROR - cannot access 'defaultClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
class ExtendsAccess1232 extends p.ExtendsAccess.protectedClass { }      // ERROR - cannot access 'protectedClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
class ExtendsAccess1242 extends p.ExtendsAccess.privateClass { }        // ERROR - cannot access 'privateClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
class ExtendsAccess1311 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
    class N extends publicClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
class ExtendsAccess1321 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
    class N extends defaultClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
class ExtendsAccess1331 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
    class N extends protectedClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
class ExtendsAccess1341 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
    class N extends privateClass { }                                    // ERROR - cannot access 'privateClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
class ExtendsAccess1312 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    class N extends publicClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
class ExtendsAccess1322 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
    class N extends defaultClass { }                                    // ERROR - cannot access 'defaultClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
class ExtendsAccess1332 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
    class N extends protectedClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
class ExtendsAccess1342 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    class N extends privateClass { }                                    // ERROR - cannot access 'privateClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
class ExtendsAccess1411 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    class N extends ExtendsAccess.publicClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
class ExtendsAccess1421 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
    class N extends ExtendsAccess.defaultClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
class ExtendsAccess1431 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
    class N extends ExtendsAccess.protectedClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
class ExtendsAccess1441 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    class N extends ExtendsAccess1441.protectedClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
class ExtendsAccess1451 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
    class N extends ExtendsAccess.privateClass { }                      // ERROR - cannot access 'privateClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
class ExtendsAccess1412 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
    class N extends p.ExtendsAccess.publicClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
class ExtendsAccess1422 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    class N extends p.ExtendsAccess.defaultClass { }                    // ERROR - cannot access 'defaultClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
class ExtendsAccess1432 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
    class N extends p.ExtendsAccess.protectedClass { }                  // OK (was: should be error, see JLS 6.6.2)
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
class ExtendsAccess1442 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
    class N extends ExtendsAccess1442.protectedClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
class ExtendsAccess1452 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
    class N extends p.ExtendsAccess.privateClass { }                    // ERROR - cannot access 'privateClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
class ExtendsAccess211 extends publicStaticClass { }                    // ERROR - 'publicStaticClass' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
class ExtendsAccess212 extends defaultStaticClass { }                   // ERROR - 'defaultStaticClass' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
class ExtendsAccess213 extends protectedStaticClass { }                 // ERROR - 'protectedStaticClass' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
class ExtendsAccess214 extends privateStaticClass { }                   // ERROR - 'privateStaticClass' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
class ExtendsAccess2211 extends ExtendsAccess.publicStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
class ExtendsAccess2221 extends ExtendsAccess.defaultStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
class ExtendsAccess2231 extends ExtendsAccess.protectedStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
class ExtendsAccess2241 extends ExtendsAccess.privateStaticClass { }    // ERROR - cannot access 'privateStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
class ExtendsAccess2212 extends p.ExtendsAccess.publicStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
class ExtendsAccess2222 extends p.ExtendsAccess.defaultStaticClass { }  // ERROR - cannot access 'defaultStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
class ExtendsAccess2232 extends p.ExtendsAccess.protectedStaticClass { }// ERROR - cannot access 'protectedStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
class ExtendsAccess2242 extends p.ExtendsAccess.privateStaticClass { }  // ERROR - cannot access 'privateStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
class ExtendsAccess2311 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
    class N extends publicStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
class ExtendsAccess2321 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
    class N extends defaultStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
class ExtendsAccess2331 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
    class N extends protectedStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
class ExtendsAccess2341 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
    class N extends privateStaticClass { }                      // ERROR - cannot access 'privateStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
class ExtendsAccess2312 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
    class N extends publicStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
class ExtendsAccess2322 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
    class N extends defaultStaticClass { }                      // ERROR - cannot access 'defaultStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
class ExtendsAccess2332 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
    class N extends protectedStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
class ExtendsAccess2342 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    class N extends privateStaticClass { }                      // ERROR - cannot access 'privateStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
class ExtendsAccess2411 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
    class N extends ExtendsAccess.publicStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
class ExtendsAccess2421 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
    class N extends ExtendsAccess.defaultStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
class ExtendsAccess2431 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
    class N extends ExtendsAccess.protectedStaticClass { }      // OK (was should be error, see JLS 6.6.2)
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
class ExtendsAccess2441 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    class N extends ExtendsAccess2431.protectedStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
class ExtendsAccess2451 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
    class N extends ExtendsAccess.privateStaticClass { }        // ERROR - cannot access 'privateStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
class ExtendsAccess2412 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    class N extends p.ExtendsAccess.publicStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
class ExtendsAccess2422 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
    class N extends p.ExtendsAccess.defaultStaticClass { }      // ERROR - cannot access 'defaultStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
class ExtendsAccess2432 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
    class N extends p.ExtendsAccess.protectedStaticClass { }    // OK (was: should be error, see JLS 6.6.2)
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
class ExtendsAccess2442 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    class N extends ExtendsAccess2442.protectedStaticClass { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
class ExtendsAccess2452 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
    class N extends p.ExtendsAccess.privateStaticClass { }      // ERROR - cannot access 'privateStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
class ExtendsAccess311 extends ExtendsAccess implements publicInterface { }     // ERROR - 'publicInterface' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
class ExtendsAccess312 extends ExtendsAccess implements defaultInterface { }    // ERROR - 'defaultInterface' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
class ExtendsAccess313 extends ExtendsAccess implements protectedInterface { }  // ERROR - 'protectedInterface' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
class ExtendsAccess314 extends ExtendsAccess implements privateInterface { }    // ERROR - 'privateInterface' not in scope
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
class ExtendsAccess3211 extends ExtendsAccess implements ExtendsAccess.publicInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
class ExtendsAccess3221 extends ExtendsAccess implements ExtendsAccess.defaultInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
class ExtendsAccess3231 extends ExtendsAccess implements ExtendsAccess.protectedInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
class ExtendsAccess3241 extends ExtendsAccess
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
        implements ExtendsAccess.privateInterface { }                           // ERROR - cannot access 'privateInterface'
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
class ExtendsAccess3212 extends ExtendsAccess
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
        implements p.ExtendsAccess.publicInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
class ExtendsAccess3222 extends ExtendsAccess
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
        implements p.ExtendsAccess.defaultInterface { }                         // ERROR - cannot access 'defaultStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
class ExtendsAccess3232 extends ExtendsAccess
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
        implements p.ExtendsAccess.protectedInterface { }                       // ERROR - cannot access 'protectedStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
class ExtendsAccess3242 extends ExtendsAccess
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
        implements p.ExtendsAccess.privateInterface { }                         // ERROR - cannot access 'privateInterface'
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
class ExtendsAccess331 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
    class N implements publicInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
class ExtendsAccess3321 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
    class N implements defaultInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
class ExtendsAccess3331 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
    class N implements protectedInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
class ExtendsAccess3341 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
    class N implements privateInterface { }                     // ERROR - cannot access 'privateInterface'
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
class ExtendsAccess3312 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
    class N implements publicInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
class ExtendsAccess3322 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
    class N implements defaultInterface { }                     // ERROR - cannot access 'defaultStaticClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
class ExtendsAccess3332 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
    class N implements protectedInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
class ExtendsAccess3342 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
    class N implements privateInterface { }                     // ERROR - cannot access 'privateInterface'
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
class ExtendsAccess341 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
    class N implements ExtendsAccess.publicInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
class ExtendsAccess3421 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
    class N implements ExtendsAccess.defaultInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
class ExtendsAccess3431 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
    class N implements ExtendsAccess.protectedInterface { }     // OK (was: should be error, see JLS 6.2.2)
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
class ExtendsAccess3441 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
    class N implements ExtendsAccess3441.protectedInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
class ExtendsAccess3451 extends ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
    class N implements ExtendsAccess.privateInterface { }       // ERROR - cannot access 'privateInterface'
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
class ExtendsAccess342 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
    class N implements p.ExtendsAccess.publicInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
class ExtendsAccess3422 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
    class N implements p.ExtendsAccess.defaultInterface { }     // ERROR - cannot access 'defaultClass'
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
class ExtendsAccess3432 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
    class N implements p.ExtendsAccess.protectedInterface { }   // OK (was: should be error, see JLS 6.2.2)
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
class ExtendsAccess3442 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
    class N implements ExtendsAccess3442.protectedInterface { }
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
}
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
class ExtendsAccess3452 extends p.ExtendsAccess {
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
    class N implements p.ExtendsAccess.privateInterface { }     // ERROR - cannot access 'privateInterface'
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
}