Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@565104 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
073153dd37
7 changed files with 31 additions and 23 deletions
  1. +2
    -2
      src/main/org/apache/tools/ant/IntrospectionHelper.java
  2. +1
    -0
      src/main/org/apache/tools/ant/Project.java
  3. +23
    -16
      src/main/org/apache/tools/ant/PropertyHelper.java
  4. +1
    -0
      src/main/org/apache/tools/ant/dispatch/DispatchUtils.java
  5. +2
    -1
      src/main/org/apache/tools/ant/helper/ProjectHelper2.java
  6. +2
    -1
      src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
  7. +0
    -3
      src/main/org/apache/tools/ant/listener/TimestampedLogger.java

+ 2
- 2
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -1530,8 +1530,8 @@ public final class IntrospectionHelper {
if (matchedDefinitionClass != null) {
throw new BuildException(
"ambiguous: restricted definitions for "
+ componentName + " " +
matchedDefinitionClass + " and " + exposedClass);
+ componentName + " "
+ matchedDefinitionClass + " and " + exposedClass);
}
matchedDefinitionClass = exposedClass;
definition = d;


+ 1
- 0
src/main/org/apache/tools/ant/Project.java View File

@@ -1648,6 +1648,7 @@ public class Project implements ResourceFactory {

/**
* Get the Project instance associated with the specified object.
* @param o the object to query.
* @return Project instance, if any.
* @since Ant 1.7.1
*/


+ 23
- 16
src/main/org/apache/tools/ant/PropertyHelper.java View File

@@ -108,7 +108,8 @@ public class PropertyHelper implements Cloneable {
};

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();
if (s.indexOf("${", index) == index) {
int end = s.indexOf('}', index);
@@ -124,19 +125,23 @@ public class PropertyHelper implements Cloneable {
};

/** 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 PropertyHelper next;
@@ -164,7 +169,7 @@ public class PropertyHelper implements Cloneable {
*/
protected PropertyHelper() {
add(TO_STRING);
add(SKIP_$$);
add(SKIP_DOUBLEDOLLAR);
add(DEFAULT_EXPANDER);
}

@@ -457,8 +462,10 @@ public class PropertyHelper implements Cloneable {
}

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) {
continue;
}


+ 1
- 0
src/main/org/apache/tools/ant/dispatch/DispatchUtils.java View File

@@ -27,6 +27,7 @@ import java.lang.reflect.Method;
/**
* Determines and Executes the action method for the task.
*/
// CheckStyle:HideUtilityClassConstructorCheck OFF - (bc)
public class DispatchUtils {
/**
* Determines and Executes the action method for the task.


+ 2
- 1
src/main/org/apache/tools/ant/helper/ProjectHelper2.java View File

@@ -965,7 +965,8 @@ public class ProjectHelper2 extends ProjectHelper {
// be namespaced, need to extract the name
// and convert from qualified name to uri/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;
int index = value.indexOf(":");
if (index >= 0) {


+ 2
- 1
src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java View File

@@ -397,7 +397,8 @@ public class ProjectHelperImpl extends ProjectHelper {
baseDir = value;
} else {
throw new SAXParseException(
"Unexpected attribute \"" + attrs.getName(i) + "\"", helperImpl.locator);
"Unexpected attribute \"" + attrs.getName(i)
+ "\"", helperImpl.locator);
}
}



+ 0
- 3
src/main/org/apache/tools/ant/listener/TimestampedLogger.java View File

@@ -20,9 +20,6 @@ package org.apache.tools.ant.listener;

import org.apache.tools.ant.DefaultLogger;

import java.util.Date;
import java.text.DateFormat;

/**
* Like a normal logger, except with timed outputs
*/


Loading…
Cancel
Save