Home | History | Annotate | Download | only in src
      1 /*
      2  * Copyright (C) 2012 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 /**
     18  * Create a hierarchy of interfaces to check if that overflows the LinearAlloc
     19  * with iftable entries.
     20  */
     21 public class Main {
     22     interface A1 {}
     23     interface A2 {}
     24     interface A3 {}
     25     interface A4 {}
     26     interface A5 {}
     27 
     28     interface B1 extends A1, A2, A3, A4, A5 {}
     29     interface B2 extends A1, A2, A3, A4, A5 {}
     30     interface B3 extends A1, A2, A3, A4, A5 {}
     31     interface B4 extends A1, A2, A3, A4, A5 {}
     32     interface B5 extends A1, A2, A3, A4, A5 {}
     33 
     34     interface C1 extends B1, B2, B3, B4, B5 {}
     35     interface C2 extends B1, B2, B3, B4, B5 {}
     36     interface C3 extends B1, B2, B3, B4, B5 {}
     37     interface C4 extends B1, B2, B3, B4, B5 {}
     38     interface C5 extends B1, B2, B3, B4, B5 {}
     39 
     40     interface D1 extends C1, C2, C3, C4, C5 {}
     41     interface D2 extends C1, C2, C3, C4, C5 {}
     42     interface D3 extends C1, C2, C3, C4, C5 {}
     43     interface D4 extends C1, C2, C3, C4, C5 {}
     44     interface D5 extends C1, C2, C3, C4, C5 {}
     45 
     46     interface E1 extends D1, D2, D3, D4, D5 {}
     47     interface E2 extends D1, D2, D3, D4, D5 {}
     48     interface E3 extends D1, D2, D3, D4, D5 {}
     49     interface E4 extends D1, D2, D3, D4, D5 {}
     50     interface E5 extends D1, D2, D3, D4, D5 {}
     51 
     52     interface F1 extends E1, E2, E3, E4, E5 {}
     53     interface F2 extends E1, E2, E3, E4, E5 {}
     54     interface F3 extends E1, E2, E3, E4, E5 {}
     55     interface F4 extends E1, E2, E3, E4, E5 {}
     56     interface F5 extends E1, E2, E3, E4, E5 {}
     57 
     58     interface G1 extends F1, F2, F3, F4, F5 {}
     59     interface G2 extends F1, F2, F3, F4, F5 {}
     60     interface G3 extends F1, F2, F3, F4, F5 {}
     61     interface G4 extends F1, F2, F3, F4, F5 {}
     62     interface G5 extends F1, F2, F3, F4, F5 {}
     63 
     64     interface H1 extends G1, G2, G3, G4, G5 {}
     65     interface H2 extends G1, G2, G3, G4, G5 {}
     66     interface H3 extends G1, G2, G3, G4, G5 {}
     67     interface H4 extends G1, G2, G3, G4, G5 {}
     68     interface H5 extends G1, G2, G3, G4, G5 {}
     69 
     70     interface Z extends H1, H2, H3, H4, H5 {}
     71 
     72     public static void main(String[] args) {
     73         Z instance = new Z() {};
     74         System.out.println("A new instance of Z was created successfully");
     75     }
     76 }
     77