Skip to content
Permalink
Browse files
8257591: Remove suppression of record preview related warnings in jav…
…a.lang

Reviewed-by: chegar
  • Loading branch information
FrauBoes committed Dec 3, 2020
1 parent 66a2e70 commit b170c8376d683a18acf786ac69a462da0dbf1386
Showing 6 changed files with 10 additions and 16 deletions.
@@ -269,7 +269,6 @@ public String toString() {
*
* @since 1.8
*/
@SuppressWarnings("preview")
public String toGenericString() {
if (isPrimitive()) {
return toString();
@@ -3548,7 +3547,6 @@ private static <U> Constructor<U>[] copyConstructors(Constructor<U>[] arg) {
private native Method[] getDeclaredMethods0(boolean publicOnly);
private native Constructor<T>[] getDeclaredConstructors0(boolean publicOnly);
private native Class<?>[] getDeclaredClasses0();
@SuppressWarnings("preview")
private native RecordComponent[] getRecordComponents0();
private native boolean isRecord0();

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2020, 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
@@ -57,7 +57,6 @@ public final class RecordComponent implements AnnotatedElement {
private transient FieldRepository genericInfo;
private byte[] annotations;
private byte[] typeAnnotations;
@SuppressWarnings("preview")
private RecordComponent root;

// only the JVM can create record components
@@ -189,7 +188,6 @@ private Map<Class<? extends Annotation>, Annotation> declaredAnnotations() {
if ((declAnnos = declaredAnnotations) == null) {
synchronized (this) {
if ((declAnnos = declaredAnnotations) == null) {
@SuppressWarnings("preview")
RecordComponent root = this.root;
if (root != null) {
declAnnos = root.declaredAnnotations();
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, 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
@@ -72,7 +72,6 @@ private ObjectMethods() { }

static {
try {
@SuppressWarnings("preview")
Class<ObjectMethods> OBJECT_METHODS_CLASS = ObjectMethods.class;
MethodHandles.Lookup publicLookup = MethodHandles.publicLookup();
MethodHandles.Lookup lookup = MethodHandles.lookup();
@@ -21,10 +21,10 @@
* questions.
*/

/**
/*
* @test
* @bug 8238358 8247444
* @run testng/othervm --enable-preview UnreflectTest
* @run testng/othervm UnreflectTest
* @summary Test Lookup::unreflectSetter and Lookup::unreflectVarHandle on
* trusted final fields (declared in hidden classes and records)
*/
@@ -99,7 +99,6 @@ static record TestRecord(int i) {
* Test Lookup::unreflectSetter and Lookup::unreflectVarHandle that
* cannot write the value of a non-static final field in a record class
*/
@SuppressWarnings("preview")
public void testFieldsInRecordClass() throws Throwable {
assertTrue(TestRecord.class.isRecord());
Object o = new TestRecord(1);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2020, 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
@@ -25,8 +25,8 @@
* @test
* @bug 8235369
* @summary Security manager checks for record related core reflection
* @compile --enable-preview -source ${jdk.version} RecordPermissionsTest.java
* @run testng/othervm/java.security.policy=allPermissions.policy --enable-preview RecordPermissionsTest
* @compile RecordPermissionsTest.java
* @run testng/othervm/java.security.policy=allPermissions.policy RecordPermissionsTest
*/

import java.net.URL;
@@ -25,9 +25,9 @@
* @test
* @bug 8235369 8235550 8247444
* @summary reflection test for records
* @compile --enable-preview -source ${jdk.version} RecordReflectionTest.java
* @run testng/othervm --enable-preview RecordReflectionTest
* @run testng/othervm/java.security.policy=allPermissions.policy --enable-preview RecordReflectionTest
* @compile RecordReflectionTest.java
* @run testng/othervm RecordReflectionTest
* @run testng/othervm/java.security.policy=allPermissions.policy RecordReflectionTest
*/

import java.lang.annotation.*;

1 comment on commit b170c83

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on b170c83 Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.