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

Discussion in 'Java' started by Roedy Green, Dec 9, 2011.

  1. Roedy Green

    Roedy Green Guest

    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.
     
    Roedy Green, Dec 9, 2011
    #1
    1. Advertising

  2. Roedy Green

    Lew Guest

    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
     
    Lew, Dec 10, 2011
    #2
    1. Advertising

  3. Roedy Green

    Roedy Green Guest

    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.
     
    Roedy Green, Dec 10, 2011
    #3
  4. 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
     
    Gene Wirchenko, Dec 12, 2011
    #4
  5. Roedy Green

    Arne Vajhøj Guest

    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
    > <> 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
     
    Arne Vajhøj, Dec 13, 2011
    #5
  6. 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
     
    Gene Wirchenko, Dec 13, 2011
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John B. Matthews
    Replies:
    0
    Views:
    757
    John B. Matthews
    Dec 9, 2011
  2. Lew
    Replies:
    0
    Views:
    679
  3. thunk
    Replies:
    1
    Views:
    315
    thunk
    Mar 30, 2010
  4. thunk
    Replies:
    0
    Views:
    487
    thunk
    Apr 1, 2010
  5. zyng
    Replies:
    34
    Views:
    3,948
    Gene Wirchenko
    May 7, 2012
Loading...

Share This Page