blob: 10a96f9ae6be11a400b1f9e3198fbbc1a4c1992d [file] [log] [blame]
Denis Vnukovf9e4b572017-05-30 08:00:40 -07001// 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 trywithresources;
5
6public class TryWithResourcesDesugaredTests extends TryWithResources {
7 private boolean isAndroid() {
8 try {
9 Class.forName("dalvik.system.VMRuntime");
10 return true;
11 } catch (Exception ignored) {
12 }
13 return false;
14 }
15
16 @Override
17 boolean desugaredCodeRunningOnJvm() {
18 return !isAndroid();
19 }
20
21 public static void main(String[] args) throws Exception {
22 new TryWithResourcesDesugaredTests().test();
23 }
24}