Re: The curse of constant fields
- From: Martin Gregorie <martin@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 15 Dec 2008 13:42:05 +0000 (UTC)
On Mon, 15 Dec 2008 01:27:29 +0000, Tom Anderson wrote:
On Sun, 14 Dec 2008, Martin Gregorie wrote:OK, so a dependency tree is needed after all.
On Sun, 14 Dec 2008 10:03:49 -0800, Mike Schilling wrote:
Arne Vajhøj wrote:
Classpath for source code is not a well defined concept.
Perhaps not. But the vast majority of code is laid out as a tree
rooted somewhere, just like class files - wouldn't that be adequate?
Or do i misunderstand?
I don't think "the vast majority of" is good enough for a tool.
Is it a problem, though? Put the full paths of all referenced source
files in the dependency database. If anything's different on the next
run, you need to recompile.
I think there's an even easier way which could easily be built into
ant.
Instead of merely compiling every class which is older than the
corresponding source file, set a target timestamp to match the most
recent class file and then recompile all classes whose sources have
been amended more recently than the target. That will sometimes do more
than the minimum amount of work, but I don't think it will ever fail to
recompile everything that needs to be recompiled.
Put these three classes in their own files:
public class Foo {
public int m() {
return 1 ;
}
}
public class Bar
public int n() {
return new Foo().m() ;
}
}
Compile them both.
Now edit Foo to read:
public class Foo {
public String m() {
return "one" ;
}
}
At this point, your algorithm would only recompile Foo, even though Bar
is now wrong, and needs to be recompiled to detect that fact.
Has a Java dependency scanner ever been made? Presumably it would be
somewhat more complex than makemake.
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
.
- Follow-Ups:
- Re: The curse of constant fields
- From: Arne Vajhøj
- Re: The curse of constant fields
- References:
- The curse of constant fields
- From: Juha Laiho
- Re: The curse of constant fields
- From: Patricia Shanahan
- Re: The curse of constant fields
- From: Arne Vajhøj
- Re: The curse of constant fields
- From: Mike Schilling
- Re: The curse of constant fields
- From: Arne Vajhøj
- Re: The curse of constant fields
- From: Mike Schilling
- Re: The curse of constant fields
- From: Tom Anderson
- Re: The curse of constant fields
- From: Arne Vajhøj
- Re: The curse of constant fields
- From: Tom Anderson
- Re: The curse of constant fields
- From: Arne Vajhøj
- Re: The curse of constant fields
- From: Mike Schilling
- Re: The curse of constant fields
- From: Martin Gregorie
- Re: The curse of constant fields
- From: Tom Anderson
- The curse of constant fields
- Prev by Date: Free Mock tests on C C++ Java EJB Hibernate Oracle SCJP OCP and many more
- Next by Date: Re: What is the difference between Java JRE 5.x and 6.x (1.5.x / 1.6.x) ???
- Previous by thread: Re: The curse of constant fields
- Next by thread: Re: The curse of constant fields
- Index(es):
Relevant Pages
|