blob: 84deaadd37f03e9e5fd9ce17729a3d2e8fdeedef [file] [log] [blame]
Ian Zerny0b70d822017-11-16 07:05:00 +01001// 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.
4package enclosingmethod_proguarded;
5
6public class OuterClass {
7 public class AClass {
8
9 }
10
11 public void aMethod() {
12 class AnotherClass extends AbstractClass {
13
14 @Override
15 public int anInt() {
16 return 48;
17 }
18 }
19
20 print(new AbstractClass() {
21 @Override
22 public int anInt() {
23 return 42;
24 }
25 });
26 print(new AnotherClass());
27 }
28
29 private static void print(AbstractClass anInstance) {
30 System.out.println(anInstance.anInt());
31 System.out.println(anInstance.getClass().getEnclosingClass());
32 System.out.println(anInstance.getClass().getEnclosingMethod());
33 System.out.println(anInstance.getClass().isAnonymousClass());
34 System.out.println(anInstance.getClass().isLocalClass());
35 System.out.println(anInstance.getClass().isMemberClass());
36 }
37}