In my class I have WeakReference field and a method accessing object referenced by this WeakReference. Since WeakReference can be implicitly nullified by garbage collector, Consulo warns me that this method could produce NullPointerException.
Since I know that producing NullPointerException is a desired behavior, I want to suppress warning for this method.
I tried to use @SuppressWarnings(“NullableProblems”) and @SuppressWarnings(“null”) which were mentioned on Stack Overflow but this doesn’t suppress specific warning. I tried explicitly adding NullPointerException to throws clause - still no success. Please suggest correct way of suppression.