javac: how to get the FULL errors/warnings list?

M

Miguel Farah

I was recently appointed to fix a big source code repository [6000+
Java
files], which -due to poor discipline by the previous manager- is
heavily inconsistent. Its biggest problem is that the source code,
taken
*as is* from our versioning system manager, won't compile. My problem
here is that compiling with javac/ant yields 100 errors displayed on
screen, and any further output is cut off. I need to see ALL the error
messages at once, but I haven't been able to find the javac option to
display unlimited error messages.

This ALSO happens with the warnings, which are cut out at 200, but I
know there are many more (mostly "this class/method has been
deprecated"
messages).

I've tried searching for command-line options in both javac and ant's
online documentations, but haven't found what I need.

I'm using Sun's JVM 1.4.2 and ant 1.5.2 (I know, they're both a bit
old,
but that's what I'm stuck with).

Thanks in advance.
 
A

Andrew McDonagh

Miguel said:
I was recently appointed to fix a big source code repository [6000+
Java
files], which -due to poor discipline by the previous manager- is
heavily inconsistent. Its biggest problem is that the source code,
taken
*as is* from our versioning system manager, won't compile. My problem
here is that compiling with javac/ant yields 100 errors displayed on
screen, and any further output is cut off. I need to see ALL the error
messages at once, but I haven't been able to find the javac option to
display unlimited error messages.

This ALSO happens with the warnings, which are cut out at 200, but I
know there are many more (mostly "this class/method has been
deprecated"
messages).

I've tried searching for command-line options in both javac and ant's
online documentations, but haven't found what I need.

I'm using Sun's JVM 1.4.2 and ant 1.5.2 (I know, they're both a bit
old,
but that's what I'm stuck with).

Thanks in advance.


There's very little use in seeing every compile error, thats why they
don't show them.

Fixing one of them, and this usually will fix several others. So start
with the first error and fix that, then re-compile and tackle the next
error, rinse & repeat....

I'd imagine that if the source won't compile, then its likely that the
documentation to go along with the design is also out of date, so it
would be worth looking for a tool that can reverse engineer the code
into UML.

Borland's Together application can do this for Java very well, someone
else may know something similar thats free or cheaper...
 
M

Miguel Farah

There's very little use in seeing every compile error, thats why they
don't show them.

I need that to be able to write up an "estimated" time to fix the
problem.
More so with the warnings, as the project to erase the dependency
warnings has a budget and therefore requires knowing how much time
will it take.
Fixing one of them, and this usually will fix several others. So start
with the first error and fix that, then re-compile and tackle the next
error, rinse & repeat....

It's what I'm doing, but I'd love to be able how much more do I need to
fix. :-/
 
J

jason

Eclipse has an option in the "Problems" to allow you to see every error
and warning. You can also sort and filter all the problems.
 
M

Mike Schilling

Miguel Farah said:
I need that to be able to write up an "estimated" time to fix the
problem.
More so with the warnings, as the project to erase the dependency
warnings has a budget and therefore requires knowing how much time
will it take.

You don't need more bad news, I'm sure, but ...

There's no reason to expect that code which doesn't compile will actually
work well once the compilation bugs are fixed, and I'm guessing that a
regime that couldn't keep the code at least building wasn't good about
enforcing testing procedures. So if it were me, I'd estimate how long it
would take to code everything from scratch, and if feeling exceptionally
optimistic, cut that in half.
 
L

Luke Meyers

Miguel said:
I need that to be able to write up an "estimated" time to fix the
problem.

My organization is as metrics-hungry as any (I work for a certain large
North American aerospace company which does defense contracting), so I
can certainly appreciate the pressure one feels to produce such
numbers. However, the nature of compilation errors is such that it
would be wholly inaccurate, and even unethical IMHO, to take the
current number of compilation errors and represent it as a metric of
how much work is left to be done.

I'm sure what I'm about to say is basically obvious to anyone who's
spent several hours burning down compilation errors, but I don't know
how else to put it. When your compiler encounters a syntax error, it
may do one of several things:

1. Isolate the error as a local problem and proceed to the next
section of code.
2. Get horribly confused and give up, not even looking at the rest of
the code.
3. Turn what a human would consider a "single error" into a godawful
long cascade of errors, which goes away as soon as you "kill the head
vampire."
4. Seg fault (well, it happens...).

Since any of these may be the case for any given error, it's basically
absurd to take the error count at any given time and pretend it means
something. It doesn't. If you're not convinced, try (once you figure
out how to display all of them -- as someone else mentioned, Eclipse
handles this great) plotting a little histogram of errors over time.
If it doesn't fluctuate wildly... well, it will fluctuate wildly, so
I'll just optimize out what I was going to say (hooray for branch
prediction in everyday speech).
More so with the warnings, as the project to erase the dependency
warnings has a budget and therefore requires knowing how much time
will it take.

Warnings are another story. They are generally independent, isolated,
deterministic, and easy for the compiler to recover from. That said,
there is still something of a multiplicity problem. For example, I
recently did some work converting a codebase from 1.4 to 1.5, which
mostly entailed getting rid of generics warnings. The common case is
that you get a single container which should be generic, and generate a
warning everywhere it's used. But you fix the definition of the
container (one line of code), and the whole mess goes away in one swell
foop.

So, a "total warnings" metric may be pretty fuzzy, and not a great
predictor of the actual amount of work required. But it can at least
be counted upon to be more or less monotonically decreasing, which
ought to be enough to satisfy your bosses.

Of course, you could try explaining all this to them, but I imagine
they'll just tell you to go pound SLOC.

Luke
 
R

Roedy Green

My organization is as metrics-hungry as any (I work for a certain large
North American aerospace company which does defense contracting


How the hell do you sleep at night. You are like a bullet maker for
the Mafia. Your planes kill kids. You are even worse than the
bastards who build nukes. There is at least a chance their products
won't be used.
 
A

Andrew McDonagh

Roedy said:
How the hell do you sleep at night. You are like a bullet maker for
the Mafia. Your planes kill kids. You are even worse than the
bastards who build nukes. There is at least a chance their products
won't be used.

Off topic roedy
 
R

Roedy Green

Off topic roedy

It is on topic in that he might be puzzled why I stop helping him, and
I hope everyone else does to. If you aid him, there is blood on your
hands too.
 
R

Roedy Green

Off topic roedy

Come now. If it is on topic whether students who leave their
assignments to the last second deserve aid, surely it is on topic to
discus whether those who work for defence contractors deserve aid.

I find the latter many times less deserving of aid. The student hurts
only himself. The defence employee hurts others. Students con you into
doing their assignments for them. US defence workers are conning you
into a criminal enterprise, namely the Iraq war declared illegal by
the UN. Granted the Iraq war itself is off topic. I have a blog if
you want to sound off on it or try the newsgroup alt.bush.politics.
see http://mindprod.com/politics/iraq.html.
 
A

Andrew McDonagh

Roedy said:
It is on topic in that he might be puzzled why I stop helping him, and
I hope everyone else does to. If you aid him, there is blood on your
hands too.

Luke wasn't the OP, Miguel was so Luke doesn't need your 'help'...

Therefore, yes you are way off topic.
 
A

Andrew McDonagh

Roedy said:
Come now. If it is on topic whether students who leave their
assignments to the last second deserve aid, surely it is on topic to
discus whether those who work for defence contractors deserve aid.
Like I said in the last message....

Perhaps you would better 'help' people here by actually reading the
posts and then flaming the right people.

Luke wasn't the OP asking for help, he was giving a reply to Miguel.

I find the latter many times less deserving of aid. The student hurts
only himself. The defence employee hurts others. Students con you into
doing their assignments for them. US defence workers are conning you
into a criminal enterprise, namely the Iraq war declared illegal by
the UN. Granted the Iraq war itself is off topic. I have a blog if
you want to sound off on it or try the newsgroup alt.bush.politics.
see http://mindprod.com/politics/iraq.html.


What you find deserving or not is of no interest to anyone here but
yourself.
 
R

Roedy Green

Luke wasn't the OP, Miguel was so Luke doesn't need your 'help'...

After this initial discussion as to why, Luke is going into the filter
file so I won't accidentally help him on any matter. I request
everyone do likewise until he gets a proper job. Others don't have to
be so public about it as I am being.

You simply must not co-operate with that sort of wrongdoing. If you
do, you become part of it.

..
 
R

Roedy Green

What you find deserving or not is of no interest to anyone here but
yourself.

I think Luke would be curious why I would plonk him. He deserves to
know why.
 
R

Roedy Green

Luke wasn't the OP, Miguel was so Luke doesn't need your 'help'...

This is irrelevant. I was not explaining why I was withholding
information Luke would find interesting about Miguel's problem, but
why for the foreseeable future would ignore all of Luke's requests for
information (or his responses for that matter).

Your objections are based more on your politics than your concern for
protocol.
 
M

Miguel Farah

I work at a BANK. You know, those evil bastards
that retain people's money and then "have system-wide
problems" when they want their coins & bills back.

Excuse me for wanting to do things properly, you troll. :p
 
A

Andrew McDonagh

Roedy said:
This is irrelevant. I was not explaining why I was withholding
information Luke would find interesting about Miguel's problem, but
why for the foreseeable future would ignore all of Luke's requests for
information (or his responses for that matter).

Your objections are based more on your politics than your concern for
protocol.

bollocks! I haven't stated my politics - God you are full of shit
 
M

Miguel Farah

You don't need more bad news, I'm sure, but ...

In an ODD way might be good, as this means job security for an
entire year or more. ;-)

There's no reason to expect that code which doesn't compile will actually
work well once the compilation bugs are fixed, and I'm guessing that a
regime that couldn't keep the code at least building wasn't good about
enforcing testing procedures. So if it were me, I'd estimate how long it
would take to code everything from scratch, and if feeling exceptionally
optimistic, cut that in half.

I'm extremely tempted to do so... but that's a huge project in itself.

On the other hand...
 
A

Andrew McDonagh

Roedy said:
After this initial discussion as to why, Luke is going into the filter
file so I won't accidentally help him on any matter. I request
everyone do likewise until he gets a proper job. Others don't have to
be so public about it as I am being.

You simply must not co-operate with that sort of wrongdoing. If you
do, you become part of it.

..

I request you stop using this ng for your political belief delivery,
lets keep to java eh?

(besides, you paying taxes funds those companies so indirectly.....sod
it can't be arsed to argue with a moron like you....


Andrew
'Even plants have feelings' ...yep, some nice and crunchy, some not so,
a bit like meat - yum!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top