I am trying to understand how well incremental compilation can apply to a large Java project which uses many static public constants. This is the following behavior I am seeing, and I’d like to know if this is expected
- A clean build compiles ~12k classes
- I change a single
public staticconstant to private in a class referenced in many places in the code
- The incremental compilation kicks in but ~7k classes are compiled
The class I make the change to in step 2 is referenced in about 100 classes not 7k. However, those ~100 classes reference other classes that also have
public static constants.
I am surprised by the high number of classes still being compiled after a one line change. It appears that all classes with
public static constants are recompiled regardless of their relationship to the changed file/class. Is this a correct understanding? And if so is there any future improvements coming in this area?