Project: AspectJ
Bug 54965 Incremental compilation does twice as much work as necessary
Reported: 2004-03-16 10:08:56 | Status: resolved fixed

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.

Files changed in fix:
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java