< prev index next >

test/langtools/tools/javac/switchexpr/CRT.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 46,55 **** --- 46,57 ---- public class CRT { public static void main(String... args) throws Exception { new CRT().run(); } + private static final String SOURCE_VERSION = Integer.toString(Runtime.version().feature()); + private ToolBox tb = new ToolBox(); private void run() throws Exception { doTest(" private String convert(int i) {\n" + " String res;" +
*** 149,159 **** tb.createDirectories(classes); tb.cleanDirectory(classes); new JavacTask(tb) .options("-Xjcov", "--enable-preview", ! "-source", "13") .outdir(classes) .sources("public class Test {\n" + code + "}\n") .run() --- 151,161 ---- tb.createDirectories(classes); tb.cleanDirectory(classes); new JavacTask(tb) .options("-Xjcov", "--enable-preview", ! "-source", SOURCE_VERSION) .outdir(classes) .sources("public class Test {\n" + code + "}\n") .run()
< prev index next >