We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Recompile with -Xlint:unchecked for details: what
Page Index Toggle Pages: 1
Recompile with -Xlint:unchecked for details: what? (Read 1417 times)
Recompile with -Xlint:unchecked for details: what?
Jul 31st, 2008, 12:31pm
 
Hi, when using Arraylist I get those two notes:

Quote:
Note: /tmp/build14842.tmp/Temporary_4192_8100.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.


That doesn't affect the program, but I was wondering what it was.
Re: Recompile with -Xlint:unchecked for details: w
Reply #1 - Jul 31st, 2008, 2:03pm
 
AFAIK, it's all about generics and 1.5 syntax. Some explanations I found on the net :

Quote:
You may recall that, when using collections of objects, casts are often required to specify the type being used. By specifying a generic, the correct type is returned, thus eliminating the need for certain casts. You will cover generics in much more detail in the near future.

However, the reason that generics come up at this point is because they are at the heart of the warning message you received in the previous compile. The error message indicates that the add() method performs an unchecked operation. myList.add("One");

You are, in fact, adding a String to this ArrayList; however, you have not specified the type of the parameter in the definition of the ArrayList. ArrayList myList = new ArrayList();

Note that, in the previous line of code, you have used original syntax (pre Java SE 1.5) when declaring the myList. Thus, any legacy code written prior to Java SE 1.5 will result in the warnings.

from http://articles.directorym.net/Objects_and_Collections_ArrayLists_Raleigh_NC-r92...

But since Processing - in its actual version - doesn't allow 1.5 syntax and the use of generics, just don't care about this warning.
Re: Recompile with -Xlint:unchecked for details: w
Reply #2 - Jul 31st, 2008, 2:32pm
 
Alright, thanks a lot.
Haven't understood everything but thanks you for that.

Page Index Toggle Pages: 1