Home | History | Annotate | Download | only in classmerging
      1 // Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
      2 // for details. All rights reserved. Use of this source code is governed by a
      3 // BSD-style license that can be found in the LICENSE file.
      4 package classmerging;
      5 
      6 public class Test {
      7 
      8   public static void main(String... args) {
      9     GenericInterface iface = new GenericInterfaceImpl();
     10     callMethodOnIface(iface);
     11     GenericAbstractClass clazz = new GenericAbstractClassImpl();
     12     callMethodOnAbstractClass(clazz);
     13     ConflictingInterfaceImpl impl = new ConflictingInterfaceImpl();
     14     callMethodOnIface(impl);
     15     System.out.println(new SubClassThatReferencesSuperMethod().referencedMethod());
     16     System.out.println(new Outer().getInstance().method());
     17     System.out.println(new SubClass(42));
     18   }
     19 
     20   private static void callMethodOnIface(GenericInterface iface) {
     21     System.out.println(iface.method());
     22   }
     23 
     24   private static void callMethodOnAbstractClass(GenericAbstractClass clazz) {
     25     System.out.println(clazz.method());
     26     System.out.println(clazz.otherMethod());
     27   }
     28 
     29   private static void callMethodOnIface(ConflictingInterface iface) {
     30     System.out.println(iface.method());
     31     System.out.println(ClassWithConflictingMethod.conflict(null));
     32     System.out.println(OtherClassWithConflictingMethod.conflict(null));
     33   }
     34 }
     35