Denis Vnukov | f9e4b57 | 2017-05-30 08:00:40 -0700 | [diff] [blame] | 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 trywithresources; |
| 5 | |
| 6 | public 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 | } |