Xlint:unchecked compilation error?

Hello,

when i try to compile the following code as part of a servlet application , the following Xlint:unchecked error occurs.I cant understand since I am using jdk1.5 or is it referring to generics in collections?if so could anyone pls reply how to fix it.Thanks in advance.

****************************************************************************

import java.util.*;

public class BeerExpert{

public List getBrands(String color) {

List brands = new ArrayList();

if(color.equals("amber"))

{

brands.add("Jack Amber");

brands.add("Red Moose");

}

else

{

brands.add("Jail Pale Aile");

}

return (brands);

}

}

**************************************************************************

C:\javac BeerExpert.java

Note: BeerExpert.java uses unchecked or unsafe operations.

Note :Recompile with -Xlint:unchecked for details.

[958 byte] By [jawalearnera] at [2007-10-3 0:46:36]
# 1

> C:\javac BeerExpert.java

> Note: BeerExpert.java uses unchecked or unsafe

> operations.

> Note :Recompile with -Xlint:unchecked for details.

Yes it is referring to generics. The first step is to "Recompile with -Xlint:unchecked for details." like the compiler told you to do. That is

javac -Xlint:unchecked BeerExpert.java

BillKriegera at 2007-7-14 17:41:27 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...