• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2016, 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 shaking2;
5 
6 public class SubClass1 extends SuperClass {
7   private int used;
8   private int alsoUsed;
9   private boolean usedBoolean;
10   private byte usedByte;
11   private char usedChar;
12   private Object usedObject;
13   private short usedShort;
14   private double usedDouble;
15 
16   private int unused;
17 
SubClass1(int used)18   public SubClass1(int used) {
19     this.used = used;
20   }
21 
SubClass1(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)22   public SubClass1(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) {
23     this.used = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
24   }
25 
26   @Override
virtualMethod()27   public void virtualMethod() {
28     System.out.println("SubClass1::virtualMethod");
29   }
30 
31   @Override
virtualMethod2(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)32   public void virtualMethod2(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) {
33     System.out.println("SubClass1::virtualMethod2 " + (a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8));
34   }
35 
36   @Override
virtualMethod3()37   public void virtualMethod3() {
38     super.virtualMethod3();
39     System.out.println("SubClass1::virtualMethod3");
40   }
41 
42   @Override
virtualMethod4(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)43   public void virtualMethod4(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) {
44     super.virtualMethod4(a1, a2, a3, a4, a5, a6, a7, a8);
45     System.out.println("SubClass1::virtualMethod4 " + (a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8));
46   }
47 
48   @Override
unusedVirtualMethod()49   public void unusedVirtualMethod() {
50     System.out.println("SubClass1::unusedVirtualMethod");
51   }
52 
53   @Override
interfaceMethod()54   public void interfaceMethod() {
55     System.out.println("SubClass1::interfaceMethod");
56   }
57 
58   @Override
interfaceMethod2()59   public void interfaceMethod2() {
60     System.out.println("SubClass1::interfaceMethod2");
61   }
62 
63   @Override
interfaceMethod3()64   public void interfaceMethod3() {
65     System.out.println("SubClass1::interfaceMethod3");
66   }
67 
68   @Override
interfaceMethod4()69   public void interfaceMethod4() {
70     System.out.println("SubClass1::interfaceMethod4");
71   }
72 
73   @Override
interfaceMethod5(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)74   public void interfaceMethod5(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) {
75     System.out.println("SubClass1::interfaceMethod5 " + (a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8));
76   }
77 
78   @Override
accessFields()79   public void accessFields() {
80     super.accessFields();
81     System.out.println("SubClass1::fields: " + used + " " + alsoUsed + " " + usedBoolean +
82         " " + usedByte + " " + usedChar + " " + usedObject + " " + usedShort + " " + usedDouble);
83     used = 1;
84     alsoUsed = 2;
85     usedBoolean = true;
86     usedByte = 3;
87     usedChar = '?';
88     usedObject = new Object();
89     usedShort = 4;
90     usedDouble = 42.42;
91   }
92 }
93