Bug 54965

Summary: Incremental compilation does twice as much work as necessary
Product: [Tools] AspectJ Reporter: Adrian Colyer <adrian.colyer>
Component: CompilerAssignee: Adrian Colyer <adrian.colyer>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.2   
Target Milestone: 1.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.