Z
zyng
Hi:
When I run ant, a lot of warnings are printed out on the screen. It is verydaunting. It makes new people to feel, as first response, this is broken. But actually, the build is successful. I pasted a few warning messages below. In our real code, there are hundreds of them.
[javac] /abc/efg/MyTools.java:125: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
[javac] recursiveDirectoriesToBuild.add(workingDir);
[javac] ^
[javac] /abc/efg/MyTools.java:212: warning: [unchecked] unchecked call to Vector(java.util.Collection<? extends E>) as a member of the raw type java.util.Vector
[javac] return new Vector(v2);
.....
I know one solution, the basic solution, is to going to the code and use Java Annotation feature to add "Ignore Warning etc" at those places. But there are so many places and the code were written by different people. We don't want to modify the code! I am wondering if ant has a feature to turn off the warning messages.
This is my ant script to build:
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${build.dir}" compiler="modern"fork="yes" debug="on">
<classpath refid="project.classpath"/>
<compilerarg value="-Xlint"/>
</javac>
</target>
To be honest, I do not know the feature "-Xlint" etc.
Thank you very much.
When I run ant, a lot of warnings are printed out on the screen. It is verydaunting. It makes new people to feel, as first response, this is broken. But actually, the build is successful. I pasted a few warning messages below. In our real code, there are hundreds of them.
[javac] /abc/efg/MyTools.java:125: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
[javac] recursiveDirectoriesToBuild.add(workingDir);
[javac] ^
[javac] /abc/efg/MyTools.java:212: warning: [unchecked] unchecked call to Vector(java.util.Collection<? extends E>) as a member of the raw type java.util.Vector
[javac] return new Vector(v2);
.....
I know one solution, the basic solution, is to going to the code and use Java Annotation feature to add "Ignore Warning etc" at those places. But there are so many places and the code were written by different people. We don't want to modify the code! I am wondering if ant has a feature to turn off the warning messages.
This is my ant script to build:
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${build.dir}" compiler="modern"fork="yes" debug="on">
<classpath refid="project.classpath"/>
<compilerarg value="-Xlint"/>
</javac>
</target>
To be honest, I do not know the feature "-Xlint" etc.
Thank you very much.