Another Interesting Java 1.5 Quirk

<cebmailbox-trijug-/[email protected]>
Newsgroups gmane.org.user-groups.trijug.juglist
Message-ID <[email protected]>
The following program will compile and run with the expected output:
   
  public class TestGeneric {
 public static void main(String[] args) {
  String s = "hello world";
  Class c = s.getClass();
  if (c.isAssignableFrom(String.class)) {
   System.out.println("Yep");
  }
 }
}
   
  but during compile, spits out the following warning:
   
  Type safety: The method isAssignableFrom(Class) belongs to the raw type Class. References to generic type Class<T> should be parameterized.
   
  I get this using my own generic classes and it is usually a mistake made on usage I can fix.  I just cannot imagine the fix here.  I bet it is a DUH, but anyway...HELP?
   
  -Chris

_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.