[antlr-interest] GCJ
Robert Colquhoun
rjc at trump.net.au
Tue Jul 15 04:14:14 PDT 2003
At 08:54 AM 15/07/2003 +0100, Pete Forman wrote:
>At 2003-07-15 10:36 +1000, Robert Colquhoun wrote:
> > > >As soon as you make a java change you need to recalculate the dependency
> > > >tree using some tool. That's not happening with the configure/make
> stuff
> > > >at the moment there is only the original dependencies.
> > >
> > >The Java compiler handles dependencies internally. If you compile
> > >just one file then all the .java files it references are compiled as
> > >well (including indirect references) if they have no .class. It is
> > >often enough just to name those files with a main() on javac's command
> > >line.
> >
> >Can get in trouble though if you compile one file that has a dependency
> >which already has a class file available....it doesnt check to see if the
> >dependency source is out of date with respect to its class file unless the
> >dependency itself is also specified on the command line.
>
>Not true. Here's a simple example of it working.
And here is another example:
public class A {
public static void main(String[] args) {
System.out.println("B.value = " + B.value);
}
}
public class B {
public static final int value = C.value;
}
public class C {
public static final int value = 1;
}
C:\test>javac A.java
C:\test>java A
C.value = 1
C:\test>notepad C.java <--change C.value to 2
C:\test>javac A.java
C:\test>java A
C.value = 1
C:\test>
Things get worse as soon as interfaces, Class.forName(), reflection, custom
class loaders etc start getting used.
- Robert
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list