I have a strange problem with Eclipse Galileo.
I set Java 1.6 as my JRE. On this line of code
List templates = new ArrayList ();
I see
Try to remove import antlr.collections.List;
and click Ctr+space to use java.util
I changed the import
import javax.swing.text.html.HTMLDocument.Iterator;
to
import java.util.Iterator;
then it worked for me
put the entry "JRE System Library..." at the top in project, properties, java build path, order and export
For those, who will get there from Google: the problem was with cryptix library. When I removed it from java build path the project is compiled sucesfully.
use "import java.util.List"
instead of default import "import antlr.collections.List;"
and use the JRE5 or above for generic support of collection API....
for example:
public class AClass<T extends Object>
{
public HashMap<String, String> myMap;
}
if I write:
public class BClass
{
private AClass aClass = new AClass();
public void test()
{
aClass.get("test");
//return Object class
}
}
but if I write:
public class BClass
{
private AClass<?,?> aClass = new AClass<?,?>();
public void test()
{
aClass.get("test");
//return String class
}
}