Capturing ghost dependencies in Java sources

By: Giovanni Lagorio


All non trivial applications consist of many sources, which usually depend on each other. For this reason, a change to some sources may affect the compilation of other (unchanged) sources. Hence, the recompilation must be propagated to the unchanged sources that depend on the changed ones, in order to obtain the same result a global recompilation would produce. Most IDEs (Integrated Development Environments) provide smart dependency checking; that is, they automate the task of finding these dependencies and propagating the recompilation when an application is rebuilt. In this paper we study the problem of extracting dependency information from Java sources and propose an encoding of these dependency information as regular expressions. This encoding is both compact to store and fast to check. Furthermore, our technique detects a particular kind of dependencies, which we call ghost dependencies, that popular tools, even commercial ones, fail to detect. Because of this failure, some required recompilations are not triggered by these tools and the result of their incremental recompilations is not equivalent to the recompilation of all sources.

Cite as:

Giovanni Lagorio, “Capturing ghost dependencies in Java sources”, Journal of Object Technology, Volume 3, no. 11 (December 2004), pp. 77-95, doi:10.5381/jot.2004.3.11.a4.

PDF | HTML | DOI | BiBTeX | Tweet this | Post to CiteULike | Share on LinkedIn