I write a Groovy script and I need to access a field that has a private access modifier. This works fine but generates a warning:
Access to <field_name> exceeds its access rights
I want to supress this warning. What value of
@SuppressWarnings annotation do I have to use in order to achieve it?
@SuppressWarnings("all") and it works fine but I would like to have more granular control over suppressions. I've also tried
@SuppressWarnings("AccessingNonPublicFieldOfAnotherObject") but it has no effect.
Below how this warning looks in IntelliJ:
Unfortunately automatic hint doesn't suggest any sensible solution: