I am using IntelliJ IDEA with javac on JDK 1.8. I have the following code:
class Test
{
@SafeVarargs
final void varargsMe
This might explain the reason why. I just copied it from Effective Java 2nd Edition, Item 25. Hopefully, it can help.
The prohibition on generic array creation can be annoying. It means, for example, that it’s not generally possible for a generic type to return an array of its element type (but see Item 29 for a partial solution). It also means that you can get confusing warnings when using varargs methods (Item 42) in combination with generic types. This is because every time you invoke a varargs method, an array is created to hold the varargs parameters. If the element type of this array is not reifiable, you get a warning. There is little you can do about these warnings other than to suppress them (Item 24), and to avoid mixing generics and varargs in your APIs.