ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: svn commit: r486161 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/HasFreeSpace.java
Date Tue, 12 Dec 2006 14:34:03 GMT
> + if (JavaEnvUtils.isAtLeastJavaVersion("1.6")) {
> +  //reflection to avoid bootstrap/build problems
> +  String j6FileUtils = "org.apache.tools.ant.util.java16.Java6FileUtils";
> +  ReflectWrapper w = new ReflectWrapper(..., j6FileUtils);
> +  long free = ((Long)w.invoke("freeSpace", String.class, partition)).longValue();
> +  return free >= StringUtils.parseHumanSizes(needed);

Kev, I'd have expected the reflection to be on the new File method in
jdk6, not on an Ant class that depends on jdk6+. Because this means
this new Ant class must be compiled with jdk6+, or cross-compiled
against a jdk6+ rt.jar.

So more something like (assuming a File#freeSpace method):

> +  ReflectWrapper w = new ReflectWrapper(..., "java.io.File");
> +  long free = ((Long)w.invoke("freeSpace", String.class, partition)).longValue();
> +  return free >= StringUtils.parseHumanSizes(needed);

Am I missing something? AFAIK, Ant 1.7 will not be built with jdk6. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message