Our program uses native libraries through JNA, some of those calls are passing com.sun.jna.Pointer
and com.sun.jna.ptr.PointerByReference
.
When analyzing such code with sonar, it gives a "Major code smell" squid:S1191 - Classes from "sun.*" packages should not be used
.
Sonar's docs specifically mention import com.sun.jna.Native;
as noncompliant code, but does not provide any alternatives.
From googling squid:1191
, it seems that many users think this rule is too strict (no to mention that you can't annotate imports to suppress the warning).
As I understand, this rule is originated in Java's FAQ, which also doesn't give any alternative APIs for JNA.
Should I just ignore the issue (or find a workaround to suppressing it), or are we really doing something wrong here?