RFR: 8349373: Support JavaFX preview features [v3]

Michael Strauß mstrauss at openjdk.org
Thu Mar 13 03:38:58 UTC 2025


On Wed, 12 Mar 2025 14:24:08 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

> > Should we specify that the `@Deprecated` annotation on preview features be marked as `forRemoval=true`
> 
> wouldn't this send a wrong message? could we invent a new annotation `@Preview` ?

We could, but then we'd lose the integration that the `@Deprecated` annotation has in IDEs. For example, IntelliJ shows you visually that you're using a deprecated API, which helps with discoverability.

> @mstr2 I presume you initially considered something like this?

I've chosen the `@Deprecated` annotation because, according to its documentation, it's supposed to be used for this very situation:

`An element may be deprecated for any of several reasons, for example, [...] it may be changed incompatibly or removed in a future version [...]`

Notable, the annotation was used for preview APIs in JDK 12 and 13, so there is precedent.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1359#issuecomment-2719751519


More information about the openjfx-dev mailing list