Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #10625 > unrolled thread
| Started by | www <xsli2@yahoo.com> |
|---|---|
| First post | 2011-12-09 07:46 -0800 |
| Last post | 2011-12-09 17:46 -0800 |
| Articles | 11 — 7 participants |
Back to article view | Back to comp.lang.java.programmer
When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? www <xsli2@yahoo.com> - 2011-12-09 07:46 -0800
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? "John B. Matthews" <nospam@nospam.invalid> - 2011-12-09 12:19 -0500
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? Roedy Green <see_website@mindprod.com.invalid> - 2011-12-09 10:27 -0800
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? www <xsli2@yahoo.com> - 2011-12-09 11:59 -0800
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? Lew <lewbloch@gmail.com> - 2011-12-09 17:47 -0800
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? ilAn <idonot@wantspam.net> - 2011-12-10 03:55 +0200
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? Roedy Green <see_website@mindprod.com.invalid> - 2011-12-10 06:14 -0800
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? Gene Wirchenko <genew@ocis.net> - 2011-12-12 12:20 -0800
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? Arne Vajhøj <arne@vajhoej.dk> - 2011-12-12 19:51 -0500
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? Gene Wirchenko <genew@ocis.net> - 2011-12-13 09:49 -0800
Re: When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? Lew <lewbloch@gmail.com> - 2011-12-09 17:46 -0800
| From | www <xsli2@yahoo.com> |
|---|---|
| Date | 2011-12-09 07:46 -0800 |
| Subject | When running Ant on command line, how to not-show its WARNING messages and only show ERROR message? |
| Message-ID | <769dffa0-4077-4a3a-ad9a-57c5f5028cd8@l19g2000yqc.googlegroups.com> |
Hi:
I am running Ant on command line, there are many, many WARNING
messages, cluttering my screen:
[javac] xx.java:48: warning: [unchecked] unchecked call to
<K1,V1>build(com.google.common.cache.CacheLoader<? super K1,V1>) as a
member of the raw type com.google.common.cache.CacheBuilder
[javac] return builder.build(new
CacheLoader<LocationAndDataTypeIdentifier, IdentifierZipFileHandler>()
[javac] ^
[javac] www.java:48: warning: [unchecked] unchecked conversion
[javac] found : com.google.common.cache.Cache
[javac] required:
com.google.common.cache.Cache<ohd.hseb.hefs.pe.tools.LocationAndDataTypeIdentifier,ohd.hseb.hefs.pe.acceptance.IdentifierZipFileHandler>
...
[javac] 1 error
[javac] 52 warnings
BUILD FAILED
/a/b/c/build.xml:106: Compile failed; see the compiler error output
for details.
I hope to make these warning message go away. I cannot see the
compiler error either. There is no a output file. Should the error be
on the screen?
Thank you very much.
[toc] | [next] | [standalone]
| From | "John B. Matthews" <nospam@nospam.invalid> |
|---|---|
| Date | 2011-12-09 12:19 -0500 |
| Message-ID | <nospam-DA59DE.12193009122011@news.aioe.org> |
| In reply to | #10625 |
In article <769dffa0-4077-4a3a-ad9a-57c5f5028cd8@l19g2000yqc.googlegroups.com>, www <xsli2@yahoo.com> wrote: > Hi: > > I am running Ant on command line, there are many, many WARNING > messages, cluttering my screen: > > [javac] xx.java:48: warning: [unchecked] unchecked call to > <K1,V1>build(com.google.common.cache.CacheLoader<? super K1,V1>) as a > member of the raw type com.google.common.cache.CacheBuilder > [javac] return builder.build(new > CacheLoader<LocationAndDataTypeIdentifier, IdentifierZipFileHandler>() > [javac] ^ > [javac] www.java:48: warning: [unchecked] unchecked conversion > [javac] found : com.google.common.cache.Cache > [javac] required: com.google.common.cache.Cache ... > > ... > > [javac] 1 error > [javac] 52 warnings > > BUILD FAILED > /a/b/c/build.xml:106: Compile failed; see the compiler error output > for details. > > I hope to make these warning message go away. I see in the documentation that the build.compiler.warnings command line option is deprecated, but the javac nowarn attribute is available. <http://ant.apache.org/manual/Tasks/javac.html> Why not suppress the warnings with an annotation? Comment on the provably correct ones and mark the others TODO. > I cannot see the compiler error either. There is no a output file. > Should the error be on the screen? Did you re-direct stderr? -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews>
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2011-12-09 10:27 -0800 |
| Message-ID | <lkk4e7ph9e2g63cfibf915fn7qfo644n1c@4ax.com> |
| In reply to | #10625 |
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.
[toc] | [prev] | [next] | [standalone]
| From | www <xsli2@yahoo.com> |
|---|---|
| Date | 2011-12-09 11:59 -0800 |
| Message-ID | <8523a48b-1f30-4fd9-961c-6d2eb1ce61f7@q9g2000yqe.googlegroups.com> |
| In reply to | #10629 |
On Dec 9, 1:27 pm, Roedy Green <see_webs...@mindprod.com.invalid>
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.
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2011-12-09 17:47 -0800 |
| Message-ID | <8070867.1485.1323481647192.JavaMail.geo-discussion-forums@prez15> |
| In reply to | #10632 |
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
[toc] | [prev] | [next] | [standalone]
| From | ilAn <idonot@wantspam.net> |
|---|---|
| Date | 2011-12-10 03:55 +0200 |
| Message-ID | <m28vmlqjfu.fsf@wantspam.net> |
| In reply to | #10635 |
Lew <lewbloch@gmail.com> writes: > www wrote: >> Roedy Green wrote: >> off such warnings. >> > <snip> >> >> >> 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? My guess is a lack of pride is his work. > > Why do you think it's acceptable to leave bugs in your code? My guess is so he can move on to his next kludge. -- ilAn
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2011-12-10 06:14 -0800 |
| Message-ID | <87q6e75arb1kit6pba8u79gcaq5cloiv47@4ax.com> |
| In reply to | #10635 |
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.
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-12 12:20 -0800 |
| Message-ID | <1doce7hdheo9ch1hs4ircu17hp5hu85l2h@4ax.com> |
| In reply to | #10647 |
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
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2011-12-12 19:51 -0500 |
| Message-ID | <4ee6a1a6$0$294$14726298@news.sunsite.dk> |
| In reply to | #10680 |
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
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-13 09:49 -0800 |
| Message-ID | <dq3fe7lqf6uunfm7u27fl07juf1efl1fmq@4ax.com> |
| In reply to | #10687 |
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
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2011-12-09 17:46 -0800 |
| Message-ID | <8577219.1484.1323481573410.JavaMail.geo-discussion-forums@prez15> |
| In reply to | #10625 |
www wrote: > I am running Ant on command line, there are many, many WARNING > messages, cluttering my screen: That's because there are many, many bad code idioms cluttering up your program. > [javac] xx.java:48: warning: [unchecked] unchecked call to > <K1,V1>build(com.google.common.cache.CacheLoader<? super K1,V1>) as a > member of the raw type com.google.common.cache.CacheBuilder > [javac] return builder.build(new > CacheLoader<LocationAndDataTypeIdentifier, IdentifierZipFileHandler>() > [javac] ^ > [javac] www.java:48: warning: [unchecked] unchecked conversion ... such as improper generic conversions. I'm guessing there's a type relationship problem between the 'CacheLoader' reference you showed us and the return type of the method, which you declined to show us. > [javac] found : com.google.common.cache.Cache > [javac] required: > com.google.common.cache.Cache<ohd.hseb.hefs.pe.tools.LocationAndDataTypeIdentifier,ohd.hseb.hefs.pe.acceptance.IdentifierZipFileHandler> > > ... > > [javac] 1 error > [javac] 52 warnings > > BUILD FAILED > /a/b/c/build.xml:106: Compile failed; see the compiler error output > for details. > > I hope to make these warning message go away. I cannot see the > compiler error either. There is no a output file. Should the error be > on the screen? You show us some of the error messages that you say "clutter up your screen". Doesn't that count as "on the screen"? What do you mean "no a output file"? Ant reports all javac output in its output. Since you show us some of your output, I conclude that the thing you want to see is in your output, just not in the part you deigned to share. I've used Ant lots of times to compile, build and run Java programs. The output shows up on the screen just as you showed it, every time, unless redirected. The output is the literal output of the 'javac' compiler, in the case of compilation, and therefore contains all the information you can get to track down your many, many bugs. -- Lew
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web