After following a Slick2D tutorial on custom fonts, it provided me with the following code to initialise it:
titleFont.addAsciiGlyphs();
titleFont.addGlyphs(400, 600);
titleFont.getEffects().add(new ColorEffect()); //Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized
titleFont.loadGlyphs();
Eclipse throws the commented warning on that line. Can you please answer with a replacement to line 3 with whatever Eclipse is asking me to put in there.
That warning is telling you the list returned by getEffects() is not parameterized. It is of type List. Since that list is inside the Slick library, you can’t really do anything about that warning. Just carry on.
Here is the source code, I’m guessing you are using Unicode font: https://bob.newdawnsoftware.com/repos/slick/trunk/Slick/src/org/newdawn/slick/UnicodeFont.java
You can see for yourself that the effects are stored in a List rather than being parameterized.
I was wrong in my initial comment, the error isn’t because of type erasure, its because the effects list is raw. See this: What is a raw type and why shouldn't we use it?