Re: How Javac works
- From: Dale King <DaleWKing@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 23 Jul 2005 05:08:54 GMT
Roedy Green wrote:
On Sat, 16 Jul 2005 02:49:01 GMT, Dale King <DaleWKing@xxxxxxxxxxxxxxxxxxxx> wrote or quoted :
That doesn't mean everything is rebuilt. Consider if I have three java files so that A depends on B and B depends on C. If A and C are out of date but B is not and you compile A.java then C will not get rebuilt. If B were out of date then all three would be compiled.
there are two reasons for a class file to be out of date:
obvious -- its date is not after the source file date.
I really wish the world would move beyond this fantasy that the dates on files only go forward and not backwards. This notion of just doing a greater than comparison between the source and the object is not sufficient in my mind for a build system.
I have this problem now at work. In this case it is with C++ and make. I can check things out from ClearCase and build. But if I decide that I don't want to check the changes in and just revert back to what is in ClearCase, I'll uncheckout the file but the file date goes back to the date it was checked in. Make won't rebuild the file because it went back in time.
The problem is that to solve this you must save information about the build to overcome this. For every generated file you would have to keep a record of its timestamp and the timestamp of all its dependencies. Then when building again if any timestamp has changed then you rebuild.
subtle -- some class file it depends on has changed, e.g. a method changed from m( char ) to m( int ), or the value of some static final has changed, e.g. flipping DEBUGGING = true to DEBUGGING = false. The code to call it needs to be regenerated.
Javac will handle obvious, but not the subtle, right?
If you compile A.java it will recompile any file that A references whose class file is older than its source. The issue is that it doesn't spider its way out to anything beyond a file that is up to date.
So while A may depend on B and B is up to date with its source file there may be a hundred files that B depends on that are out of date but they won't be checked because the analysis stops at B because B was up to date.
> Bush crime family lost/embezzled $3 trillion from Pentagon. > Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
Please stop repeating this off-topic lie that has no business in this group!
-- Dale King .
- Follow-Ups:
- Re: How Javac works
- From: Mike Schilling
- Re: How Javac works
- References:
- How Javac works
- From: Roedy Green
- Re: How Javac works
- From: E.Otter
- Re: How Javac works
- From: Dale King
- Re: How Javac works
- From: Roedy Green
- How Javac works
- Prev by Date: Re: getResource can't find file???
- Next by Date: Re: In praise of Eclipse
- Previous by thread: Re: How Javac works
- Next by thread: Re: How Javac works
- Index(es):
Relevant Pages
|