Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? (http://www.velocityreviews.com/forums/t806776-re-when-running-ant-on-command-line-how-to-not-show-its-warning-messages-and-only-show-error-message.html)

Roedy Green 12-09-2011 06:27 PM

Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message?
 
On Fri, 9 Dec 2011 07:46:08 -0800 (PST), www <xsli2@yahoo.com> wrote,
quoted or indirectly quoted someone who said :

>
>I am running Ant on command line, there are many, many WARNING
>messages, cluttering my screen:


those are not ANT messages. They are Javac messages. See
http://mindprod.com/jgloss/javacexe.html
to learn the option to turn off such warnings.

<!-- C O M P I L E -->
<target name="compile">
<echo message=" ::: bio ::: compiling Java tree with
target=1.5" />
<javac source="1.5" target="1.5" srcdir="com/mindprod/bio"
sourcepath="${basedir}" classpath="${basedir}" debug="on"
includeAntRuntime="false">
<compilerarg value="-Xlint:unchecked" />
<compilerarg value="-Xlint:fallthrough" />
<compilerarg value="-Xlint:deprecation" />
</javac>
</target>


Then just add the option no your compilerargs.
--
Roedy Green Canadian Mind Products
http://mindprod.com
For me, the appeal of computer programming is that
even though I am quite a klutz,
I can still produce something, in a sense
perfect, because the computer gives me as many
chances as I please to get it right.


Lew 12-10-2011 01:47 AM

Re: When running Ant on command line, how to not-show its WARNINGmessages and only show ERROR message?
 
www wrote:
> Roedy Green wrote:
> off such warnings.
> >
> > <!-- C O M P I L E -->
> > <target name="compile">
> > <echo message=" * *::: * *bio * *::: * *compiling Java tree with
> > target=1.5" />
> > * <javac source="1.5" target="1.5" srcdir="com/mindprod/bio"
> > sourcepath="${basedir}" classpath="${basedir}" debug="on"
> > includeAntRuntime="false">
> > * * <compilerarg value="-Xlint:unchecked" />
> > * * <compilerarg value="-Xlint:fallthrough" />
> > * * <compilerarg value="-Xlint:deprecation" />
> > * </javac>
> > </target>
> >
> > Then just add the option no your compilerargs.

>
> Thank you all. Can you elaborate what the three -Xlint lines above
> for?
> I have added those. In addition, I have: <javac nowarn="on" ....>
> The WARNING messages are still there. Maybe a couple of them were
> gone, I am not too sure.


Why do you think suppressing warnings is better than fixing your bugs?

Why do you think it's acceptable to leave bugs in your code?

--
Lew

Roedy Green 12-10-2011 02:14 PM

Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message?
 
On Fri, 9 Dec 2011 17:47:27 -0800 (PST), Lew <lewbloch@gmail.com>
wrote, quoted or indirectly quoted someone who said :

>
>Why do you think suppressing warnings is better than fixing your bugs?
>
>Why do you think it's acceptable to leave bugs in your code?


Because generics are so squirrelly and hard to understand.

Because, if he asks for help, he will get bawled out.

Because, he has a deadline. The code works, so he figures it is ok to
leave these warnings in place.

Because he does not have the same desire for perfection that drives
most computer programmers.
--
Roedy Green Canadian Mind Products
http://mindprod.com
For me, the appeal of computer programming is that
even though I am quite a klutz,
I can still produce something, in a sense
perfect, because the computer gives me as many
chances as I please to get it right.


Gene Wirchenko 12-12-2011 08:20 PM

Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message?
 
On Sat, 10 Dec 2011 06:14:11 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote:

>On Fri, 9 Dec 2011 17:47:27 -0800 (PST), Lew <lewbloch@gmail.com>
>wrote, quoted or indirectly quoted someone who said :
>
>>
>>Why do you think suppressing warnings is better than fixing your bugs?
>>
>>Why do you think it's acceptable to leave bugs in your code?

>
>Because generics are so squirrelly and hard to understand.
>
>Because, if he asks for help, he will get bawled out.
>
>Because, he has a deadline. The code works, so he figures it is ok to
>leave these warnings in place.
>
>Because he does not have the same desire for perfection that drives
>most computer programmers.


Because if the code were wrong, the message would be an *error*
message. A warning is just that it is possibly wrong. This means
that it might well be correct.

Sincerely,

Gene Wirchenko

Arne Vajh°j 12-13-2011 12:51 AM

Re: When running Ant on command line, how to not-show its WARNINGmessages and only show ERROR message?
 
On 12/12/2011 3:20 PM, Gene Wirchenko wrote:
> On Sat, 10 Dec 2011 06:14:11 -0800, Roedy Green
> <see_website@mindprod.com.invalid> wrote:
>> On Fri, 9 Dec 2011 17:47:27 -0800 (PST), Lew<lewbloch@gmail.com>
>> wrote, quoted or indirectly quoted someone who said :
>>> Why do you think suppressing warnings is better than fixing your bugs?
>>>
>>> Why do you think it's acceptable to leave bugs in your code?

>>
>> Because generics are so squirrelly and hard to understand.
>>
>> Because, if he asks for help, he will get bawled out.
>>
>> Because, he has a deadline. The code works, so he figures it is ok to
>> leave these warnings in place.
>>
>> Because he does not have the same desire for perfection that drives
>> most computer programmers.

>
> Because if the code were wrong, the message would be an *error*
> message. A warning is just that it is possibly wrong. This means
> that it might well be correct.


Or that it might be a problem.

The big issue with suppressing all warnings is that even though
all the old warnings may be OK then one will never see new warnings
that indeed may be a problem.

Arne


Gene Wirchenko 12-13-2011 05:49 PM

Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message?
 
On Mon, 12 Dec 2011 19:51:51 -0500, Arne Vajh°j <arne@vajhoej.dk>
wrote:

>On 12/12/2011 3:20 PM, Gene Wirchenko wrote:


[snip]

>> Because if the code were wrong, the message would be an *error*
>> message. A warning is just that it is possibly wrong. This means
>> that it might well be correct.

>
>Or that it might be a problem.


Sure. So one looks at it. "Nope, not a problem. I will insert
a comment about it." or measure, cut, nail, and test as the case may
be.

>The big issue with suppressing all warnings is that even though
>all the old warnings may be OK then one will never see new warnings
>that indeed may be a problem.


I do not like doing that for that reason.

I read a story about one program where the programmer had
suppressed error messages. The end user was complaining that the
program did not work, got the source, and found that there was no way
the code could have compiled.

Sincerely,

Gene Wirchenko


All times are GMT. The time now is 12:17 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.