ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tarun Garg" <>
Subject static final string.
Date Fri, 28 Sep 2001 06:17:11 GMT
This probably is not exactly an ant issue, but some of you might have faced
it that's why I am posting it here.
I have two classes. A and B.
class A has a member in it which is declared something like:

public static final String mesg="hello";

Now class B uses this string for some purpose of its own.
Lets say it just prints the message.
class B {
public static void main(String args[])

Now when I change the mesg in class A to "hello world", Ant recompiles only
the class A as is the only file that has been modified.
Now when I run class B, the message still remains "hello".
I believe this has something to do the way compilers are implemented. I
tried both javac and jikes. Both exhibit the same behaviour.
During development it can happen that you need to change your final
variables too.
Has anybody faced this problem before ? How do you solve it ?
One solution would be that whenever somebody changes a final variable, she
informs everybody working on that project to do a clean build.
But that's not a very clean solution.
Any tips ?

View raw message