< prev index next >

test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java

Print this page
rev 56806 : 8232684: Make switch expressions final
Reviewed-by: TBD

@@ -74,23 +74,20 @@
         if (!result.isSuccess()) {
             System.err.printf("Diagnostics: %s%nTemplate: %s%n", diags.errorKeys(), sourceFiles.stream().map(p -> p.snd).collect(toList()));
         }
     }
 
-    private static String[] PREVIEW_OPTIONS = {"--enable-preview", "-source",
-                                               Integer.toString(Runtime.version().feature())};
-
     private void program(String... constructs) {
         String s = "class C { static boolean cond = false; static int x = 0; void m() { # } }";
         for (String c : constructs)
             s = s.replace("#", c);
         addSourceFile("C.java", new StringTemplate(s));
     }
 
     private void assertOK(String... constructs) {
         reset();
-        addCompileOptions(PREVIEW_OPTIONS);
+        addCompileOptions();
         program(constructs);
         try {
             compile();
         }
         catch (IOException e) {

@@ -99,11 +96,11 @@
         assertCompileSucceeded();
     }
 
     private void assertOKWithWarning(String warning, String... constructs) {
         reset();
-        addCompileOptions(PREVIEW_OPTIONS);
+        addCompileOptions();
         program(constructs);
         try {
             compile();
         }
         catch (IOException e) {

@@ -112,11 +109,11 @@
         assertCompileSucceededWithWarning(warning);
     }
 
     private void assertFail(String expectedDiag, String... constructs) {
         reset();
-        addCompileOptions(PREVIEW_OPTIONS);
+        addCompileOptions();
         program(constructs);
         try {
             compile();
         }
         catch (IOException e) {
< prev index next >