compiling with the Xlint:unchecked switch
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alan_Shiers
Posted On:   Tuesday, January 30, 2007 11:32 AM

HI there, When I compile my project using ANT the compiler states the following: compile: [javac] Compiling 2 source files to :Scholastic_Hibernate uildclasses [javac] Note: C:Scholastic_HibernatesrcjavascholasticmodelsCompany.java uses unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. My build.xml file has the following: destdir="${build.classes.dir}" classpathref="project.classpath"/> Is there an attribute for the javac tag that forces compilation with the switch -Xlint:unchecked? I need to get the   More>>

HI there,

When I compile my project using ANT the compiler states the following:



			
compile:

[javac] Compiling 2 source files to :Scholastic_Hibernate uildclasses

[javac] Note: C:Scholastic_HibernatesrcjavascholasticmodelsCompany.java
uses unchecked or unsafe operations.

[javac] Note: Recompile with -Xlint:unchecked for details.


My build.xml file has the following:











destdir="${build.classes.dir}"

classpathref="project.classpath"/>





Is there an attribute for the javac tag that forces compilation with the switch -Xlint:unchecked? I need to get the details from the compiler so that I can fix the problem.



Alan    <<Less

Re: compiling with the Xlint:unchecked switch

Posted By:   Robert_Lybarger  
Posted On:   Tuesday, January 30, 2007 08:30 PM

I think you use a nested "compilerarg" element, something like . With that said, this probably relates to 1.5 generics stuff; you can just compile the class on your own (outside of ant) with the -X... arg to see the message, and you can likely suppress the compiler from giving you this message at all using the appropriate annotation, probably in this case by putting @SuppressWarnings("unchecked") on either the class as a whole or on just the troublesome method(s) it/themselves.
About | Sitemap | Contact