Skip to content

Commit b170c83

Browse files
author
Julia Boes
committed
8257591: Remove suppression of record preview related warnings in java.lang
Reviewed-by: chegar
1 parent 66a2e70 commit b170c83

File tree

6 files changed

+10
-16
lines changed

6 files changed

+10
-16
lines changed

src/java.base/share/classes/java/lang/Class.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ public String toString() {
269269
*
270270
* @since 1.8
271271
*/
272-
@SuppressWarnings("preview")
273272
public String toGenericString() {
274273
if (isPrimitive()) {
275274
return toString();
@@ -3548,7 +3547,6 @@ private static <U> Constructor<U>[] copyConstructors(Constructor<U>[] arg) {
35483547
private native Method[] getDeclaredMethods0(boolean publicOnly);
35493548
private native Constructor<T>[] getDeclaredConstructors0(boolean publicOnly);
35503549
private native Class<?>[] getDeclaredClasses0();
3551-
@SuppressWarnings("preview")
35523550
private native RecordComponent[] getRecordComponents0();
35533551
private native boolean isRecord0();
35543552

src/java.base/share/classes/java/lang/reflect/RecordComponent.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -57,7 +57,6 @@ public final class RecordComponent implements AnnotatedElement {
5757
private transient FieldRepository genericInfo;
5858
private byte[] annotations;
5959
private byte[] typeAnnotations;
60-
@SuppressWarnings("preview")
6160
private RecordComponent root;
6261

6362
// only the JVM can create record components
@@ -189,7 +188,6 @@ private Map<Class<? extends Annotation>, Annotation> declaredAnnotations() {
189188
if ((declAnnos = declaredAnnotations) == null) {
190189
synchronized (this) {
191190
if ((declAnnos = declaredAnnotations) == null) {
192-
@SuppressWarnings("preview")
193191
RecordComponent root = this.root;
194192
if (root != null) {
195193
declAnnos = root.declaredAnnotations();

src/java.base/share/classes/java/lang/runtime/ObjectMethods.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -72,7 +72,6 @@ private ObjectMethods() { }
7272

7373
static {
7474
try {
75-
@SuppressWarnings("preview")
7675
Class<ObjectMethods> OBJECT_METHODS_CLASS = ObjectMethods.class;
7776
MethodHandles.Lookup publicLookup = MethodHandles.publicLookup();
7877
MethodHandles.Lookup lookup = MethodHandles.lookup();

test/jdk/java/lang/invoke/unreflect/UnreflectTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
* questions.
2222
*/
2323

24-
/**
24+
/*
2525
* @test
2626
* @bug 8238358 8247444
27-
* @run testng/othervm --enable-preview UnreflectTest
27+
* @run testng/othervm UnreflectTest
2828
* @summary Test Lookup::unreflectSetter and Lookup::unreflectVarHandle on
2929
* trusted final fields (declared in hidden classes and records)
3030
*/
@@ -99,7 +99,6 @@ static record TestRecord(int i) {
9999
* Test Lookup::unreflectSetter and Lookup::unreflectVarHandle that
100100
* cannot write the value of a non-static final field in a record class
101101
*/
102-
@SuppressWarnings("preview")
103102
public void testFieldsInRecordClass() throws Throwable {
104103
assertTrue(TestRecord.class.isRecord());
105104
Object o = new TestRecord(1);

test/jdk/java/lang/reflect/records/RecordPermissionsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
2525
* @test
2626
* @bug 8235369
2727
* @summary Security manager checks for record related core reflection
28-
* @compile --enable-preview -source ${jdk.version} RecordPermissionsTest.java
29-
* @run testng/othervm/java.security.policy=allPermissions.policy --enable-preview RecordPermissionsTest
28+
* @compile RecordPermissionsTest.java
29+
* @run testng/othervm/java.security.policy=allPermissions.policy RecordPermissionsTest
3030
*/
3131

3232
import java.net.URL;

test/jdk/java/lang/reflect/records/RecordReflectionTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
* @test
2626
* @bug 8235369 8235550 8247444
2727
* @summary reflection test for records
28-
* @compile --enable-preview -source ${jdk.version} RecordReflectionTest.java
29-
* @run testng/othervm --enable-preview RecordReflectionTest
30-
* @run testng/othervm/java.security.policy=allPermissions.policy --enable-preview RecordReflectionTest
28+
* @compile RecordReflectionTest.java
29+
* @run testng/othervm RecordReflectionTest
30+
* @run testng/othervm/java.security.policy=allPermissions.policy RecordReflectionTest
3131
*/
3232

3333
import java.lang.annotation.*;

0 commit comments

Comments
 (0)