Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message?

Reply
Thread Tools

Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message?

 
 
Roedy Green
Guest
Posts: n/a
 
      12-09-2011
On Fri, 9 Dec 2011 07:46:08 -0800 (PST), www <> 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.

 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      12-10-2011
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
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      12-10-2011
On Fri, 9 Dec 2011 17:47:27 -0800 (PST), Lew <>
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.

 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      12-12-2011
On Sat, 10 Dec 2011 06:14:11 -0800, Roedy Green
<> wrote:

>On Fri, 9 Dec 2011 17:47:27 -0800 (PST), Lew <>
>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
 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      12-13-2011
On 12/12/2011 3:20 PM, Gene Wirchenko wrote:
> On Sat, 10 Dec 2011 06:14:11 -0800, Roedy Green
> <> wrote:
>> On Fri, 9 Dec 2011 17:47:27 -0800 (PST), Lew<>
>> 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

 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      12-13-2011
On Mon, 12 Dec 2011 19:51:51 -0500, Arne Vajhøj <>
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to turn off those warning messages during ant build? zyng Java 34 05-07-2012 04:33 PM
Re: When running Ant on command line, how to not-show its WARNINGmessages and only show ERROR message? Lew Java 0 12-10-2011 01:46 AM
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? John B. Matthews Java 0 12-09-2011 05:19 PM
Its a bird, its a plane, no ummm, its a Ruide thunk Ruby 1 03-30-2010 11:10 AM



Advertisments