title: Bound mismatch error using Generics
body: <p>When I tried to compile my previous java 1.4 code in 1.5 I got this generics Bound mismatch problem. The code is given below </p>
  
  <pre><code>try {
      ArrayList simplePrincipals = new ArrayList(
              ((java.util.Collection) (subject.getPrincipals(Class
                      .forName("com.efunds.security.jaas.SimplePrincipal")))));
      if (simplePrincipals.size() &gt; 0) {
          ((SimplePrincipal) simplePrincipals.get(0))
                  .setPermissions(webPerm);
      }
  }
  </code></pre>
  
  <p><strong>the error is :</strong></p>
  
  <blockquote>
    <p>Bound mismatch: The generic method <code>getPrincipals(Class&lt;T&gt;)</code> of type Subject is not applicable for the arguments <code>(Class&lt;capture#1-
         of ?&gt;)</code>. The inferred type <code>capture#1-of ?</code> is not a valid substitute for the bounded parameter <code>&lt;T extends Principal&gt;</code></p>
  </blockquote>