JDK-8303188 : (fs) Deprecate com.sun.nio.file.SensitivityWatchEventModifier for removal
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.nio
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 21
  • Submitted: 2023-02-24
  • Updated: 2023-03-02
  • Resolved: 2023-03-02
Related Reports
CSR :  
Description
Summary
-------

Deprecate `com.sun.nio.file.SensitivityWatchEventModifier` in the `jdk.unsupported` module.

Problem
-------

This `enum` is only used by the polling implementation of `java.nio.file.WatchService WatchService`.  The polling `WatchService` is used only on macOS and likely to be removed in a future release when a version based on the native file event notification facility becomes available.

Solution
--------

Deprecate `com.sun.nio.file.SensitivityWatchEventModifier`. This will notify any users and provide an opportunity for them to cease use of this API.

Specification
-------------

            --- a/src/jdk.unsupported/share/classes/com/sun/nio/file/SensitivityWatchEventModifier.java
            +++ b/src/jdk.unsupported/share/classes/com/sun/nio/file/SensitivityWatchEventModifier.java
    @@ -30,13 +30,22 @@
    
     /**
      * Defines the <em>sensitivity levels</em> when registering objects with a
      * watch service implementation that polls the file system.
      *
    + * @deprecated
    + * The sensitivity levels were historically used by polling-based
    + * {@link java.nio.file.WatchService WatchService} implementations to configure
    + * the polling interval. They are are no longer used. The {@code WatchService}
    + * implementations in the JDK ignore these {@link java.nio.file.WatchEvent
    + * WatchEvent} modifiers if they are specified when registering a directory
    + * to be watched.
    + *
      * @since 1.7
      */
    
    +@Deprecated(since="21", forRemoval = true)
Comments
Moving to Approved.
02-03-2023