--- old/src/java.compiler/share/classes/javax/lang/model/util/Elements.java 2019-10-25 17:12:57.000000000 +0100 +++ new/src/java.compiler/share/classes/javax/lang/model/util/Elements.java 2019-10-25 17:12:56.000000000 +0100 @@ -632,17 +632,24 @@ boolean isFunctionalInterface(TypeElement type); /** + * {@preview Associated with records, a preview feature of the Java language. + * + * This method is associated with records, a preview + * feature of the Java language. Programs can only use this + * method when preview features are enabled. Preview features + * may be removed in a future release, or upgraded to permanent + * features of the Java language.} + * * Returns the record component for the given accessor. Returns null if the * given method is not a record component accessor. * * @param accessor the method for which the record component should be found. * @return the record component, or null if the given method is not an record component accessor * @since 14 - * @deprecated This method is part of a preview feature and may be removed - * if the preview feature is removed. */ - @Deprecated(forRemoval=true, since="14") - @SuppressWarnings("removal") + @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS, + essentialAPI=false) + @SuppressWarnings("preview") default RecordComponentElement recordComponentFor(ExecutableElement accessor) { if (accessor.getEnclosingElement().getKind() == ElementKind.RECORD) { for (RecordComponentElement rec : ElementFilter.recordComponentsIn(accessor.getEnclosingElement().getEnclosedElements())) {