Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1452123 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 12 years ago
parent
commit
eb46493de0
6 changed files with 26 additions and 6 deletions
  1. +1
    -2
      src/main/org/apache/tools/ant/filters/FixCrLfFilter.java
  2. +1
    -1
      src/main/org/apache/tools/ant/filters/util/ChainReaderHelper.java
  3. +21
    -0
      src/main/org/apache/tools/ant/taskdefs/condition/IsLastModified.java
  4. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/image/Image.java
  5. +1
    -1
      src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java
  6. +1
    -1
      src/main/org/apache/tools/ant/types/selectors/TokenizedPattern.java

+ 1
- 2
src/main/org/apache/tools/ant/filters/FixCrLfFilter.java View File

@@ -262,8 +262,7 @@ public final class FixCrLfFilter extends BaseParamFilterReader implements Chaina
// Change all EOL characters to match the calculated EOL string. If
// configured to do so, append a trailing EOL so that the file ends on
// a EOL.
if (eol != CrLf.ASIS)
{
if (eol != CrLf.ASIS) {
in = new NormalizeEolFilter(in, calculateEolString(eol), getFixlast());
}



+ 1
- 1
src/main/org/apache/tools/ant/filters/util/ChainReaderHelper.java View File

@@ -198,7 +198,7 @@ public final class ChainReaderHelper {
* Deregisters Classloaders from the project so GC can remove them later.
*/
private static void cleanUpClassLoaders(List<AntClassLoader> loaders) {
for (Iterator<AntClassLoader> it = loaders.iterator(); it.hasNext(); ) {
for (Iterator<AntClassLoader> it = loaders.iterator(); it.hasNext();) {
it.next().cleanup();
}
}


+ 21
- 0
src/main/org/apache/tools/ant/taskdefs/condition/IsLastModified.java View File

@@ -80,6 +80,7 @@ public class IsLastModified extends ProjectComponent implements Condition {

/**
* The resource to test.
* @param r the resource to test
*/
public void add(Resource r) {
if (resource != null) {
@@ -90,6 +91,7 @@ public class IsLastModified extends ProjectComponent implements Condition {

/**
* The type of comparison to test.
* @param mode the mode of comparison.
*/
public void setMode(CompareMode mode) {
this.mode = mode;
@@ -97,6 +99,8 @@ public class IsLastModified extends ProjectComponent implements Condition {

/**
* Argument validation.
* @throws BuildException if the required attributes are not supplied or
* if there is an inconsistency in the attributes.
*/
protected void validate() throws BuildException {
if (millis >= 0 && dateTime != null) {
@@ -114,6 +118,8 @@ public class IsLastModified extends ProjectComponent implements Condition {
/**
* Calculate timestamp as millis either based on millis or
* dateTime (and pattern) attribute.
* @return time in milliseconds
* @throws BuildException if the date cannot be parsed.
*/
protected long getMillis() throws BuildException {
if (millis >= 0) {
@@ -145,6 +151,11 @@ public class IsLastModified extends ProjectComponent implements Condition {
return 0;
}

/**
* evaluate the condition
* @return true or false depending on the compoarison mode and the time of the resource
* @throws BuildException
*/
public boolean eval() throws BuildException {
validate();
long expected = getMillis();
@@ -170,6 +181,9 @@ public class IsLastModified extends ProjectComponent implements Condition {
throw new BuildException("Unknown mode " + mode.getValue());
}

/**
* describes comparison modes.
*/
public static class CompareMode extends EnumeratedAttribute {
private static final String EQUALS_TEXT = "equals";
private static final String BEFORE_TEXT = "before";
@@ -179,10 +193,17 @@ public class IsLastModified extends ProjectComponent implements Condition {

private static final CompareMode EQUALS = new CompareMode(EQUALS_TEXT);

/**
* creates a CompareMode instance of type equals
*/
public CompareMode() {
this(EQUALS_TEXT);
}

/**
* creates a comparemode instance
* @param s one of the authorized values for comparemode
*/
public CompareMode(String s) {
super();
setValue(s);


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/image/Image.java View File

@@ -213,7 +213,7 @@ public class Image extends MatchingTask {
* the directory.
* @since Ant 1.8.0
*/
public int processDir(final File srcDir, final String srcNames[],
public int processDir(final File srcDir, final String[] srcNames,
final File dstDir, final FileNameMapper mapper) {
int writeCount = 0;



+ 1
- 1
src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java View File

@@ -47,7 +47,7 @@ public class TokenizedPath {
private static final boolean[] CS_THEN_NON_CS = new boolean[] {true, false};

private final String path;
private final String tokenizedPath[];
private final String[] tokenizedPath;

/**
* Initialize the TokenizedPath by parsing it.


+ 1
- 1
src/main/org/apache/tools/ant/types/selectors/TokenizedPattern.java View File

@@ -38,7 +38,7 @@ public class TokenizedPattern {
new TokenizedPattern("", new String[0]);

private final String pattern;
private final String tokenizedPattern[];
private final String[] tokenizedPattern;

/**
* Initialize the PathPattern by parsing it.


Loading…
Cancel
Save