Bug 54965 - Incremental compilation does twice as much work as necessary
Summary: Incremental compilation does twice as much work as necessary
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.2   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-16 10:08 EST by Adrian Colyer CLA
Modified: 2004-03-16 10:12 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Colyer CLA 2004-03-16 10:08:56 EST
When I added support for -outjar in the test harness, I was surprised to find 
duplicate entry exceptions coming from the output file writing to the outjar. I 
traced it through, and found that every source file passed to an incremental 
compile is in fact compiled twice!

The first time round we note the references, and of course each file has a 
reference to itself. Then we call "AjState.getFilesToCompile" looking to see if 
there are any further files to compile in another iteration. This method does 
not remember the set of files it just compiled, so since we have referenced each 
type we just compiled, and we have no reord of that fact, we compile them again. 
Second time around, the bytecodes are identical to the previous go, so 
recordClassFile doesn't note their dependents - and thus this time we terminate.
Comment 1 Adrian Colyer CLA 2004-03-16 10:12:03 EST
Fixed by remembering list of files we compiled on the last iteration in AjState.