Skip to content

Commit 3a69dfb

Browse files
author
Vicente Romero
committed
8245652: some tests at RecordCompilationTests are resetting the wrong compilation options
Reviewed-by: darcy
1 parent 6ee76b6 commit 3a69dfb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test/langtools/tools/javac/records/RecordCompilationTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ public void testCheckInitializationOrderInCompactConstructor() throws Exception
960960
}
961961

962962
public void testAcceptRecordId() {
963+
String[] previousOptions = getCompileOptions();
963964
String[] testOptions = {/* no options */};
964965
setCompileOptions(testOptions);
965966
assertOKWithWarning("compiler.warn.restricted.type.not.allowed.preview",
@@ -969,10 +970,11 @@ public void testAcceptRecordId() {
969970
" }\n" +
970971
" class record {}\n" +
971972
"}");
972-
setCompileOptions(PREVIEW_OPTIONS);
973+
setCompileOptions(previousOptions);
973974
}
974975

975976
public void testAnnos() throws Exception {
977+
String[] previousOptions = getCompileOptions();
976978
String srcTemplate =
977979
"""
978980
import java.lang.annotation.*;
@@ -1127,7 +1129,7 @@ record R(@Anno String s) {}
11271129
}
11281130

11291131
// let's reset the default compiler options for other tests
1130-
setCompileOptions(PREVIEW_OPTIONS);
1132+
setCompileOptions(previousOptions);
11311133
}
11321134

11331135
private void checkTypeAnno(ClassFile classFile,

0 commit comments

Comments
 (0)