LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 07-19-2005, 07:40 PM   #1
Hockeyfan
Member
 
Registered: May 2004
Distribution: SuSe 10.0
Posts: 154

Rep: Reputation: 30
Need help with java warnings


I wrote a java application and when I compile I get a warning that tells me that I am doing some unsafe operations in my java code and to recompile with -Xlint:unchecked as a comand line argumennt. When I did I was able to see my warnings. I am not sure how to get rid of these warnings. I like zero errors, zero warnings. I know in the java compiler doesn't output 0 errors, 0 warnings. Here are the warnings I get when I compile:

[javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:45: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.Vector
[javac] information.add(person);
[javac] ^
[javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:76: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.Vector
[javac] information.add(array[i]);
[javac] ^
[javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:105: warning: [unchecked] unchecked conversion
[javac] found : personalInfo.logic.FNComparator
[javac] required: java.util.Comparator<? super java.lang.Object>
[javac] Arrays.sort(sort, fn);
[javac] ^
[javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:105: warning: [unchecked] unchecked method invocation: <T>sort(T[],java.util.Comparator<? super T>) in java.util.Arrays is applied to (java.lang.Object[],personalInfo.logic.FNComparator)
[javac] Arrays.sort(sort, fn);
[javac] ^
[javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:109: warning: [unchecked] unchecked conversion
[javac] found : personalInfo.logic.LNComparator
[javac] required: java.util.Comparator<? super java.lang.Object>
[javac] Arrays.sort(sort, ln);
[javac] ^
[javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:109: warning: [unchecked] unchecked method invocation: <T>sort(T[],java.util.Comparator<? super T>) in java.util.Arrays is applied to (java.lang.Object[],personalInfo.logic.LNComparator)
[javac] Arrays.sort(sort, ln);
[javac] ^
[javac] 6 warnings

If anyone knows how to get rid of these warnings please let me know

-Hockeyfan
 
Old 07-22-2005, 03:01 PM   #2
mickyg
Member
 
Registered: Oct 2004
Location: UK
Distribution: Ubuntu/Kubuntu
Posts: 245

Rep: Reputation: 30
Any chance of you posting the source code to DB.java so we can see what exactly the class is doing.

Last edited by mickyg; 07-22-2005 at 03:03 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gdk warnings BroX Slackware 5 03-13-2006 06:06 PM
Synaptic warnings snowy MEPIS 6 07-08-2005 04:40 AM
What do these warnings mean (re cdrom)? tigerflag Linux - Hardware 4 03-24-2005 07:14 PM
java compiler warnings exodist Programming 2 05-09-2004 02:42 AM
when ever i run a java gui on my redhat 9 it always dislays some warnings anjiie Programming 2 03-09-2004 02:50 PM


All times are GMT -5. The time now is 03:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration