A
Axl
Just thought I'd add this note since I usually search this newsgroup
for answers and didn't find this mentioned. If anyone has any further
comments on this aspect of 1.5.0 please reply.
The "unchecked or unsafe operations" warning can result from a missing
type declaration. Warning looks like so:
Note: Parse.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Recompiling with -Xlint:unchecked can be confusing. For example using
an ArrayList may result in the following:
Parse.java:21: warning: [unchecked] unchecked call to add(E) as a
member of the raw type java.util.ArrayList
al.add(str);
Parse.java:25: warning: [unchecked] unchecked call to
<T>toArray(T[]) as a member of the raw type java.util.ArrayList
al.toArray(ary);
These lines (21 and 25 in the above example) do not need to change to
eliminate the compiler warnings. Instead change the declaration of the
ArrayList class (substitute <String> with whatever type you wish to
use):
ArrayList<String> al = new ArrayList<String>();
C'est tout,
Axl
Axl Weslowski
aweslowski_@_rpa.com
(remove_the_underscores)
for answers and didn't find this mentioned. If anyone has any further
comments on this aspect of 1.5.0 please reply.
The "unchecked or unsafe operations" warning can result from a missing
type declaration. Warning looks like so:
Note: Parse.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Recompiling with -Xlint:unchecked can be confusing. For example using
an ArrayList may result in the following:
Parse.java:21: warning: [unchecked] unchecked call to add(E) as a
member of the raw type java.util.ArrayList
al.add(str);
Parse.java:25: warning: [unchecked] unchecked call to
<T>toArray(T[]) as a member of the raw type java.util.ArrayList
al.toArray(ary);
These lines (21 and 25 in the above example) do not need to change to
eliminate the compiler warnings. Instead change the declaration of the
ArrayList class (substitute <String> with whatever type you wish to
use):
ArrayList<String> al = new ArrayList<String>();
C'est tout,
Axl
Axl Weslowski
aweslowski_@_rpa.com
(remove_the_underscores)