title: java warning: Varargs method could cause heap pollution from non-reifiable varargs parameter
body: <p>I am using IntelliJ IDEA with javac on JDK 1.8.  I have the following code:</p>
  
  <pre><code>class Test&lt;T extends Throwable&gt;
  {
      @SafeVarargs
      final void varargsMethod( Collection&lt;T&gt;... varargs )
      {
          arrayMethod( varargs );
      }
  
      void arrayMethod( Collection&lt;T&gt;[] args )
      {
      }
  }
  </code></pre>
  
  <p>IntelliJ IDEA does not highlight anything in the above code as a warning.  However, when compiling, the following line appears in the "Make" tab of the "Messages" view:</p>
  
  <blockquote>
    <p>Warning:(L, C) java: Varargs method could cause heap pollution from
    non-reifiable varargs parameter varargs</p>
  </blockquote>
  
  <p>Note #1: I have already specified <code>@SafeVarargs</code>.</p>
  
  <p>Note #2: <code>Warning:(L,C)</code> points to <code>varargs</code> being passed as an argument to <code>arrayMethod()</code></p>
  
  <p>Assuming that I know what I am doing, and supposing that I am pretty sure that there will be no heap pollution or that I promise that I will not call this method in some funky way which might result in heap pollution, <strong><em>what do I need to do to suppress this warning message?</em></strong></p>
  
  <p><strong><em>NOTE:</em></strong> There is a multitude of questions on stackoverflow regarding varargs methods, but it appears that there is none that addresses this specific problem.  As a matter of fact, the entire interwebz appear to be rather poor in answers to this particular question.</p>