I’m getting java:S1191 reported by SonarLint in Intellij for the usage of com.sun.net.httpserver.HttpServer. I think this is a false-positive after reading JEP 403: Strongly Encapsulate JDK Internals:
Exported com.sun APIs
Most com.sun.* packages in the JDK are for internal use, but a few are supported for external use. These supported packages were exported in JDK 9 and will continue to be exported, so you can continue to program against their public APIs. They will, however, no longer be open. Examples include
The Compiler Tree API in the jdk.compiler module,
The HTTP Server API in the jdk.httpserver module,
The SCTP API in the jdk.sctp module, and
JDK-specific extensions to the NIO API in the com.sun.nio.file package of the jdk.unsupported module
Since you’re on the latest version of SonarLint for IntelliJ, that should be the most up-to-date implementation of the rule. So I’ve flagged this for the language experts to take a look at.