Dealing With This Generics Bug
<p>I need a little help in generics in the following code:</p>

<pre><code>public &lt;T extends Comparable&lt;T&gt;&gt; int insertionSort(T[] a) {
   // throw new RuntimeException("not implemented");
      final int L = a.length;
      int compares = 0;

      for(int i = 1; i &lt; L; i++){
          for(int j = i; j &gt; 0 &amp;&amp; a[j].compareTo(a[j - 1]) &lt; 0; j--){

              Comparable tmp = a[j];   // PROBLEM HERE
              a[j] = a[j - 1];
              a[j - 1] = tmp;       // PROBLEM HERE

              compares++;
          }
      }

    return compares;
  }
</code></pre>

<p>// PROBLEM HERE
those two lines in the code are fault and need help in fixing them.</p>

<p>thanks</p>

<p><strong>edit</strong></p>

<p>the errors are i can't make the assignments</p>
