input handler to a default value. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272551 13f79535-47bb-0310-9956-ffa450edef68remotes/1776816827838153613/tmp_25f451bd36ab3145e487fcb2cd5c62c571e5b602
| @@ -69,6 +69,7 @@ import org.apache.tools.ant.types.FilterSet; | |||||
| import org.apache.tools.ant.types.FilterSetCollection; | import org.apache.tools.ant.types.FilterSetCollection; | ||||
| import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
| import org.apache.tools.ant.util.JavaEnvUtils; | import org.apache.tools.ant.util.JavaEnvUtils; | ||||
| import org.apache.tools.ant.input.DefaultInputHandler; | |||||
| import org.apache.tools.ant.input.InputHandler; | import org.apache.tools.ant.input.InputHandler; | ||||
| /** | /** | ||||
| @@ -209,6 +210,7 @@ public class Project { | |||||
| */ | */ | ||||
| public Project() { | public Project() { | ||||
| fileUtils = FileUtils.newFileUtils(); | fileUtils = FileUtils.newFileUtils(); | ||||
| inputHandler = new DefaultInputHandler(); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -1470,7 +1472,7 @@ public class Project { | |||||
| */ | */ | ||||
| public void setFileLastModified(File file, long time) | public void setFileLastModified(File file, long time) | ||||
| throws BuildException { | throws BuildException { | ||||
| if (JavaEnvUtils.getJavaVersion() == JavaEnvUtils.JAVA_1_1) { | |||||
| if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { | |||||
| log("Cannot change the modification time of " + file | log("Cannot change the modification time of " + file | ||||
| + " in JDK 1.1", Project.MSG_WARN); | + " in JDK 1.1", Project.MSG_WARN); | ||||
| return; | return; | ||||
| @@ -54,6 +54,9 @@ | |||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import org.apache.tools.ant.input.DefaultInputHandler; | |||||
| import org.apache.tools.ant.input.InputHandler; | |||||
| import org.apache.tools.ant.input.PropertyFileInputHandler; | |||||
| import org.apache.tools.ant.types.*; | import org.apache.tools.ant.types.*; | ||||
| import java.io.File; | import java.io.File; | ||||
| @@ -219,6 +222,15 @@ public class ProjectTest extends TestCase { | |||||
| assertEquals(DummyTaskWithNonVoidExecute.class, p.getTaskDefinitions().get("NonVoidExecute")); | assertEquals(DummyTaskWithNonVoidExecute.class, p.getTaskDefinitions().get("NonVoidExecute")); | ||||
| } | } | ||||
| public void testInputHandler() { | |||||
| InputHandler ih = p.getInputHandler(); | |||||
| assertNotNull(ih); | |||||
| assertTrue(ih instanceof DefaultInputHandler); | |||||
| InputHandler pfih = new PropertyFileInputHandler(); | |||||
| p.setInputHandler(pfih); | |||||
| assertSame(pfih, p.getInputHandler()); | |||||
| } | |||||
| private class DummyTaskPrivate extends Task { | private class DummyTaskPrivate extends Task { | ||||
| public DummyTaskPrivate() {} | public DummyTaskPrivate() {} | ||||
| public void execute() {} | public void execute() {} | ||||