aspose file tools*
The moose likes Beginning Java and the fly likes Compile Xlint Errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compile Xlint Errors" Watch "Compile Xlint Errors" New topic
Author

Compile Xlint Errors

B Crosthwaite
Ranch Hand

Joined: Oct 22, 2008
Posts: 39
Hi Guys,

I am in the process of following a tutorial from the head first JSP & servlets book and i have got stuck. Hopefully someone will be able to help me.

I have copied this code from the book


When i come to compile the code i get this message in the terminal


After i recompile with -Xlint i get these messages


Does anyone have any idea where i am going wrong?

Thanks,
-Ben
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

They aren't errors but warnings.

If you read this part of the Java Tutorial I'm sure you'll get a better understanding.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Reinhard Horn
Ranch Hand

Joined: Jun 04, 2007
Posts: 31
Hi Ben,

replace

public List getBrands(String color) {

with

public List<String> getBrands(String color) {

and

List brands = new ArrayList();

with

List<String> brands = new ArrayList<String>();

and your warnings will vanish. The problem has to do with generics, which are introduced
since Java Version 1.5

Kind regards


SCJP 5, SCWCD 1.4, SCBCD 5
B Crosthwaite
Ranch Hand

Joined: Oct 22, 2008
Posts: 39
Thank you worked like a charm.

-Ben
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compile Xlint Errors