> On May 8, 2020, at 12:41 PM, Donal Evans <doev...@pivotal.io> wrote:
> 
> Is there a consensus on what constitutes a benign warning? I think the only
> times I use @SuppressWarnings is in parameterized tests to suppress the
> unused method warning for the parameters method, or for unchecked casts, as
> below:
> 
> PartitionedRegion detailRegion1 = mock(PartitionedRegion.class);
> when(cache.getRegion(regionPath1)).thenReturn(detailRegion1);
> 
> where the thenReturn() would complain, since it's expecting to return a
> Region<Object, Object>.
> 
> Would these be considered things that could safely just be ignored (and so
> for which I can turn off inspection), or is the use of @SuppressWarnings
> here warranted?

This is a legitimate suppression. There is no other way to correct the 
dysfunctional nature of Java Generics than to @SuppressWarnings. In this case 
though only that statement should be suppressed. 

-Jake

Reply via email to