View Single Post
Old 01-23-2007, 10:28 PM   PM User | #1
TunesRus90
New to the CF scene

 
Join Date: Jan 2007
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
TunesRus90 is an unknown quantity at this point
Unchecked or Unsafe Operations

Hello, I am relatively new to Java, but I have a friend whose helping me however, I have run into a problem that he doesn't know how to fix. I get an warning when I compile, but it seems like everything is working still. The Warning says:

Note: [classpath...]/EditorGUI.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

As I said, it seems like my program still works, but is there some way to get rid of this warning? Am I doing something wrong? I found out which line causes the warning, and I googled the error, but as I'm somewhat new to Java, I was unable to take what I found and apply it to my program. Here is the different parts of code associated with the warning.

In the top part of my class where I declare all my variables, I declare this:
Code:
public ArrayList<TagInstance> bitmTags;
//TagInstance is another one of my classes, which I wish to create an array of
Then I instantiate the ArrayList later on.
Code:
bitmTags = new ArrayList<TagInstance>();
And finally, here is the line that causes the warning, because when I comment it out, I don't get the warning, but I need to use this function to make my program work like I want it to.
Code:
Collections.sort(bitmTags);
Is there something I am doing wrong, and is there some way to get rid of this warning, or should I just live with it, seeing as my program still works even when I get the warning?
TunesRus90 is offline   Reply With Quote