A
Andreas Leitgeb
Say, I've got two classes A and B, one of which (A)
contains "static final" fields, the other (B)
references these fields. Now the compiler doesn't
use references, but includes the values from A
directly in B.
Now suppose some of these fields in A are changed.
What is the usual "trick" to make sure that all
"B"-type classes are recompiled, when an "A"-type
class has changed?
Is the only sensible way really to remove *all*
..class files and have *all* files recompiled, or
does there exist some trick to let the compiler
know these dependencies, and do the right thing?
Seemingly, it didn't do it last time I had to
change such an "A"-type class.
Does there perhaps exist a thirdparty-tool, (a la
makedepends & make for C++) that makes sure that
really all neccessary recompilations are performed?
As it seems, the class-file for "B" doesn't even
have any mention of "A" (unless it also uses other
fields or methods of A, of course).
As a programmer I'd rather not have to think about
manually removing .class-files that are no longer
up-to-date.
PS: I'm bound to still work with java 1.4, but if
such a feature exists for newer versions, I'd
still also like to know.
contains "static final" fields, the other (B)
references these fields. Now the compiler doesn't
use references, but includes the values from A
directly in B.
Now suppose some of these fields in A are changed.
What is the usual "trick" to make sure that all
"B"-type classes are recompiled, when an "A"-type
class has changed?
Is the only sensible way really to remove *all*
..class files and have *all* files recompiled, or
does there exist some trick to let the compiler
know these dependencies, and do the right thing?
Seemingly, it didn't do it last time I had to
change such an "A"-type class.
Does there perhaps exist a thirdparty-tool, (a la
makedepends & make for C++) that makes sure that
really all neccessary recompilations are performed?
As it seems, the class-file for "B" doesn't even
have any mention of "A" (unless it also uses other
fields or methods of A, of course).
As a programmer I'd rather not have to think about
manually removing .class-files that are no longer
up-to-date.
PS: I'm bound to still work with java 1.4, but if
such a feature exists for newer versions, I'd
still also like to know.