rspec/rules/S1191/java/rule.adoc
2022-02-04 16:28:24 +00:00

37 lines
892 B
Plaintext

Classes in the ``++sun.*++`` or ``++com.sun.*++`` packages are considered implementation details, and are not part of the Java API.
They can cause problems when moving to new versions of Java because there is no backwards compatibility guarantee. Similarly, they can cause problems when moving to a different Java vendor, such as OpenJDK.
Such classes are almost always wrapped by Java API classes that should be used instead.
== Noncompliant Code Example
[source,java]
----
import com.sun.jna.Native; // Noncompliant
import sun.misc.BASE64Encoder; // Noncompliant
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::parameters.adoc[]
include::highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]