JDK-8157508 : Add (since="9", forRemoval=true) to @Deprecated annotation on HostServices.getWebContext
  • Type: Bug
  • Component: javafx
  • Sub-Component: application-lifecycle
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-05-21
  • Updated: 2016-11-16
  • Resolved: 2016-11-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Description
JDK-8156963 added the @Deprecated annotation to the HostServices.getWebContext method. We also need to add (since = "9", forRemoval=true) to the annotation, but cannot do so until we move to a newer version of JDK 9 that supports the "since" and "forRemoval" properties on the annotation.

Once we do upgrade to a newer compiler, the fix will be:

diff --git a/modules/graphics/src/main/java/javafx/application/HostServices.java
 b/modules/graphics/src/main/java/javafx/application/HostServices.java
--- a/modules/graphics/src/main/java/javafx/application/HostServices.java
+++ b/modules/graphics/src/main/java/javafx/application/HostServices.java
@@ -154,7 +154,7 @@
      * @deprecated This method is deprecated as of JDK 9 because the
      * {@link java.applet.Applet Applet} API is deprecated.
      */
-    @Deprecated // FIXME: (since = "9")
+    @Deprecated(since="9", forRemoval=true)
     public final JSObject getWebContext() {
         return delegate.getWebContext();
     }

Comments
Changeset: 14c18a3cebd7 Author: ckyang Date: 2016-11-16 07:55 -0800 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/14c18a3cebd7
16-11-2016

+1
16-11-2016

Please review the proposed fix as suggested. I have verified and tested it with newer JDK 9 that a compiler warning did show if used: warning: [removal] getWebContext() in HostServices has been deprecated and marked for removal http://cr.openjdk.java.net/~ckyang/JDK-8157508/webrev.00/
16-11-2016