ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: static final string.
Date Fri, 28 Sep 2001 07:08:51 GMT
Have a look at the optional <depend> task.  I think it will solve this
particular issue.

    Erik


----- Original Message -----
From: "Tarun Garg" <tarung@induslogic.com>
To: "ant" <ant-user@jakarta.apache.org>
Sent: Thursday, September 27, 2001 11:17 PM
Subject: static final string.


> 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[])
>     {
>         System.out.println(A.mesg);
>     }
> }
>
> Now when I change the mesg in class A to "hello world", Ant recompiles
only
> the class A as A.java 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 ?
>
>
>


Mime
View raw message