Skip to content

Commit 814e95b

Browse files
committed
More magic names
1 parent bf7c94a commit 814e95b

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/main/org/apache/tools/ant/MagicNames.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private MagicNames() {
218218
* Value: {@value}
219219
*/
220220
public static final String PROJECT_HELPER_SERVICE =
221-
"META-INF/services/org.apache.tools.ant.ProjectHelper";
221+
"META-INF/services/" + PROJECT_HELPER_CLASS;
222222

223223
/**
224224
* Name of ProjectHelper reference that we add to a project.

src/main/org/apache/tools/ant/taskdefs/Definer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ public void setAntlib(String antlib) {
465465
}
466466
if (!antlib.startsWith(MagicNames.ANTLIB_PREFIX)) {
467467
throw new BuildException(
468-
"Invalid antlib attribute - it must start with antlib:");
468+
"Invalid antlib attribute - it must start with " + MagicNames.ANTLIB_PREFIX);
469469
}
470470
setURI(antlib);
471471
this.resource = antlib.substring(MagicNames.ANTLIB_PREFIX.length()).replace('.', '/')

src/tests/junit/org/apache/tools/ant/ExecutorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private Project getProject(String e, boolean f) {
9292

9393
private Project getProject(String e, boolean f, boolean k) {
9494
Project p = buildRule.getProject();
95-
p.setNewProperty("ant.executor.class", e);
95+
p.setNewProperty(MagicNames.ANT_EXECUTOR_CLASSNAME, e);
9696
p.setKeepGoingMode(k);
9797
if (f) {
9898
p.setNewProperty("failfoo", "foo");

src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
import org.apache.tools.ant.BuildException;
3939
import org.apache.tools.ant.BuildFileRule;
40+
import org.apache.tools.ant.MagicNames;
4041
import org.apache.tools.ant.util.regexp.RegexpMatcherFactory;
4142
import org.junit.After;
4243
import org.junit.Before;
@@ -182,7 +183,7 @@ public void testWithRegex() {
182183
buildRule.executeTarget("testWithRegex");
183184
// the following line has been changed from checking ant.home to ant.version
184185
// so the test will still work when run outside of an Ant script
185-
assertThat(buildRule.getFullLog(), containsString("ant.version="));
186+
assertThat(buildRule.getFullLog(), containsString(MagicNames.ANT_VERSION + "="));
186187
}
187188

188189
private void testEchoPrefixVarious(String target) throws Exception {

0 commit comments

Comments
 (0)