git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@565104 13f79535-47bb-0310-9956-ffa450edef68master
@@ -1530,8 +1530,8 @@ public final class IntrospectionHelper { | |||||
if (matchedDefinitionClass != null) { | if (matchedDefinitionClass != null) { | ||||
throw new BuildException( | throw new BuildException( | ||||
"ambiguous: restricted definitions for " | "ambiguous: restricted definitions for " | ||||
+ componentName + " " + | |||||
matchedDefinitionClass + " and " + exposedClass); | |||||
+ componentName + " " | |||||
+ matchedDefinitionClass + " and " + exposedClass); | |||||
} | } | ||||
matchedDefinitionClass = exposedClass; | matchedDefinitionClass = exposedClass; | ||||
definition = d; | definition = d; | ||||
@@ -1648,6 +1648,7 @@ public class Project implements ResourceFactory { | |||||
/** | /** | ||||
* Get the Project instance associated with the specified object. | * Get the Project instance associated with the specified object. | ||||
* @param o the object to query. | |||||
* @return Project instance, if any. | * @return Project instance, if any. | ||||
* @since Ant 1.7.1 | * @since Ant 1.7.1 | ||||
*/ | */ | ||||
@@ -108,7 +108,8 @@ public class PropertyHelper implements Cloneable { | |||||
}; | }; | ||||
private static final PropertyExpander DEFAULT_EXPANDER = new PropertyExpander() { | private static final PropertyExpander DEFAULT_EXPANDER = new PropertyExpander() { | ||||
public String parsePropertyName(String s, ParsePosition pos, PropertyHelper propertyHelper) { | |||||
public String parsePropertyName( | |||||
String s, ParsePosition pos, PropertyHelper propertyHelper) { | |||||
int index = pos.getIndex(); | int index = pos.getIndex(); | ||||
if (s.indexOf("${", index) == index) { | if (s.indexOf("${", index) == index) { | ||||
int end = s.indexOf('}', index); | int end = s.indexOf('}', index); | ||||
@@ -124,19 +125,23 @@ public class PropertyHelper implements Cloneable { | |||||
}; | }; | ||||
/** dummy */ | /** dummy */ | ||||
private static final PropertyExpander SKIP_$$ = new PropertyExpander() { | |||||
/** | |||||
* {@inheritDoc} | |||||
* @see org.apache.tools.ant.PropertyHelper.PropertyExpander#parsePropertyName(java.lang.String, java.text.ParsePosition, org.apache.tools.ant.PropertyHelper) | |||||
*/ | |||||
public String parsePropertyName(String s, ParsePosition pos, PropertyHelper propertyHelper) { | |||||
int index = pos.getIndex(); | |||||
if (s.indexOf("$$", index) == index) { | |||||
pos.setIndex(++index); | |||||
private static final PropertyExpander SKIP_DOUBLE_DOLLAR | |||||
= new PropertyExpander() { | |||||
// CheckStyle:LineLengthCheck OFF see too long | |||||
/** | |||||
* {@inheritDoc} | |||||
* @see org.apache.tools.ant.PropertyHelper.PropertyExpander#parsePropertyName(java.lang.String, java.text.ParsePosition, org.apache.tools.ant.PropertyHelper) | |||||
*/ | |||||
// CheckStyle:LineLengthCheck ON | |||||
public String parsePropertyName( | |||||
String s, ParsePosition pos, PropertyHelper propertyHelper) { | |||||
int index = pos.getIndex(); | |||||
if (s.indexOf("$$", index) == index) { | |||||
pos.setIndex(++index); | |||||
} | |||||
return null; | |||||
} | } | ||||
return null; | |||||
} | |||||
}; | |||||
}; | |||||
private Project project; | private Project project; | ||||
private PropertyHelper next; | private PropertyHelper next; | ||||
@@ -164,7 +169,7 @@ public class PropertyHelper implements Cloneable { | |||||
*/ | */ | ||||
protected PropertyHelper() { | protected PropertyHelper() { | ||||
add(TO_STRING); | add(TO_STRING); | ||||
add(SKIP_$$); | |||||
add(SKIP_DOUBLEDOLLAR); | |||||
add(DEFAULT_EXPANDER); | add(DEFAULT_EXPANDER); | ||||
} | } | ||||
@@ -457,8 +462,10 @@ public class PropertyHelper implements Cloneable { | |||||
} | } | ||||
private String parsePropertyName(String value, ParsePosition pos) { | private String parsePropertyName(String value, ParsePosition pos) { | ||||
for (Iterator iter = getDelegates(PropertyExpander.class).iterator(); iter.hasNext();) { | |||||
String propertyName = ((PropertyExpander) iter.next()).parsePropertyName(value, pos, this); | |||||
for (Iterator iter = getDelegates(PropertyExpander.class).iterator(); | |||||
iter.hasNext();) { | |||||
String propertyName = ((PropertyExpander) iter.next()) | |||||
.parsePropertyName(value, pos, this); | |||||
if (propertyName == null) { | if (propertyName == null) { | ||||
continue; | continue; | ||||
} | } | ||||
@@ -27,6 +27,7 @@ import java.lang.reflect.Method; | |||||
/** | /** | ||||
* Determines and Executes the action method for the task. | * Determines and Executes the action method for the task. | ||||
*/ | */ | ||||
// CheckStyle:HideUtilityClassConstructorCheck OFF - (bc) | |||||
public class DispatchUtils { | public class DispatchUtils { | ||||
/** | /** | ||||
* Determines and Executes the action method for the task. | * Determines and Executes the action method for the task. | ||||
@@ -965,7 +965,8 @@ public class ProjectHelper2 extends ProjectHelper { | |||||
// be namespaced, need to extract the name | // be namespaced, need to extract the name | ||||
// and convert from qualified name to uri/name | // and convert from qualified name to uri/name | ||||
if (ANT_TYPE.equals(name) | if (ANT_TYPE.equals(name) | ||||
|| (ANT_CORE_URI.equals(attrUri) && ANT_TYPE.equals(attrs.getLocalName(i)))) { | |||||
|| (ANT_CORE_URI.equals(attrUri) | |||||
&& ANT_TYPE.equals(attrs.getLocalName(i)))) { | |||||
name = ANT_TYPE; | name = ANT_TYPE; | ||||
int index = value.indexOf(":"); | int index = value.indexOf(":"); | ||||
if (index >= 0) { | if (index >= 0) { | ||||
@@ -397,7 +397,8 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
baseDir = value; | baseDir = value; | ||||
} else { | } else { | ||||
throw new SAXParseException( | throw new SAXParseException( | ||||
"Unexpected attribute \"" + attrs.getName(i) + "\"", helperImpl.locator); | |||||
"Unexpected attribute \"" + attrs.getName(i) | |||||
+ "\"", helperImpl.locator); | |||||
} | } | ||||
} | } | ||||
@@ -20,9 +20,6 @@ package org.apache.tools.ant.listener; | |||||
import org.apache.tools.ant.DefaultLogger; | import org.apache.tools.ant.DefaultLogger; | ||||
import java.util.Date; | |||||
import java.text.DateFormat; | |||||
/** | /** | ||||
* Like a normal logger, except with timed outputs | * Like a normal logger, except with timed outputs | ||||
*/ | */ | ||||