Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@474080 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
4d0478b8f8
6 changed files with 42 additions and 18 deletions
  1. +0
    -1
      src/main/org/apache/tools/ant/types/LogLevel.java
  2. +1
    -2
      src/main/org/apache/tools/ant/types/PropertySet.java
  3. +40
    -7
      src/main/org/apache/tools/ant/types/resources/CompressedResource.java
  4. +1
    -0
      src/main/org/apache/tools/ant/types/resources/PropertyResource.java
  5. +0
    -1
      src/main/org/apache/tools/ant/types/resources/Sort.java
  6. +0
    -7
      src/main/org/apache/tools/ant/types/resources/selectors/Compare.java

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

@@ -29,7 +29,6 @@ import java.io.FileOutputStream;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project; import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task; import org.apache.tools.ant.Task;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.types.EnumeratedAttribute; import org.apache.tools.ant.types.EnumeratedAttribute;


/** /**


+ 1
- 2
src/main/org/apache/tools/ant/types/PropertySet.java View File

@@ -30,7 +30,6 @@ import java.util.Vector;


import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project; import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.ResourceCollection;
import org.apache.tools.ant.types.resources.PropertyResource; import org.apache.tools.ant.types.resources.PropertyResource;
import org.apache.tools.ant.util.FileNameMapper; import org.apache.tools.ant.util.FileNameMapper;
import org.apache.tools.ant.util.regexp.RegexpMatcher; import org.apache.tools.ant.util.regexp.RegexpMatcher;
@@ -440,7 +439,7 @@ public class PropertySet extends DataType implements ResourceCollection {
static final String ALL = "all"; static final String ALL = "all";
static final String SYSTEM = "system"; static final String SYSTEM = "system";
static final String COMMANDLINE = "commandline"; static final String COMMANDLINE = "commandline";
/** @see EnumeratedAttribute#getValues() */
/** {@inheritDoc}. */
public String[] getValues() { public String[] getValues() {
return new String[] {ALL, SYSTEM, COMMANDLINE}; return new String[] {ALL, SYSTEM, COMMANDLINE};
} }


+ 40
- 7
src/main/org/apache/tools/ant/types/resources/CompressedResource.java View File

@@ -40,9 +40,14 @@ public abstract class CompressedResource extends Resource {


private Resource resource; private Resource resource;


/** no arg constructor */
public CompressedResource() { public CompressedResource() {
} }


/**
* Constructor with another resource to wrap.
* @param other the resource to wrap.
*/
public CompressedResource(ResourceCollection other) { public CompressedResource(ResourceCollection other) {
addConfigured(other); addConfigured(other);
} }
@@ -64,12 +69,21 @@ public abstract class CompressedResource extends Resource {
resource = (Resource) a.iterator().next(); resource = (Resource) a.iterator().next();
} }


/**
* Get the name of the resource.
* @return the name of the wrapped resource.
*/
public String getName() { public String getName() {
return getResource().getName(); return getResource().getName();
} }




public void setName(String name) {
/**
* Overridden, not allowed to set the name of the resource.
* @param name not used.
* @throws BuildException always.
*/
public void setName(String name) throws BuildException {
throw new BuildException("you can't change the name of a compressed" throw new BuildException("you can't change the name of a compressed"
+ " resource"); + " resource");
} }
@@ -101,7 +115,12 @@ public abstract class CompressedResource extends Resource {
return getResource().getLastModified(); return getResource().getLastModified();
} }


public void setLastModified(long lastmodified) {
/**
* Override setLastModified.
* @param lastmodified not used.
* @throws BuildException always.
*/
public void setLastModified(long lastmodified) throws BuildException {
throw new BuildException("you can't change the timestamp of a " throw new BuildException("you can't change the timestamp of a "
+ " compressed resource"); + " compressed resource");
} }
@@ -114,7 +133,12 @@ public abstract class CompressedResource extends Resource {
return getResource().isDirectory(); return getResource().isDirectory();
} }


public void setDirectory(boolean directory) {
/**
* Override setDirectory.
* @param directory not used.
* @throws BuildException always.
*/
public void setDirectory(boolean directory) throws BuildException {
throw new BuildException("you can't change the directory state of a " throw new BuildException("you can't change the directory state of a "
+ " compressed resource"); + " compressed resource");
} }
@@ -147,7 +171,12 @@ public abstract class CompressedResource extends Resource {
} }
} }


public void setSize(long size) {
/**
* Override setSize.
* @param size not used.
* @throws BuildException always.
*/
public void setSize(long size) throws BuildException {
throw new BuildException("you can't change the size of a " throw new BuildException("you can't change the size of a "
+ " compressed resource"); + " compressed resource");
} }
@@ -163,10 +192,10 @@ public abstract class CompressedResource extends Resource {
return 0; return 0;
} }
if (other instanceof CompressedResource) { if (other instanceof CompressedResource) {
return getResource().compareTo(((CompressedResource)other).getResource());
return getResource().compareTo(
((CompressedResource) other).getResource());
} }
return getResource().compareTo(other); return getResource().compareTo(other);
} }


/** /**
@@ -176,7 +205,7 @@ public abstract class CompressedResource extends Resource {
public int hashCode() { public int hashCode() {
return getResource().hashCode(); return getResource().hashCode();
} }
/** /**
* Get an InputStream for the Resource. * Get an InputStream for the Resource.
* @return an InputStream containing this Resource's content. * @return an InputStream containing this Resource's content.
@@ -242,6 +271,8 @@ public abstract class CompressedResource extends Resource {
* Is supposed to wrap the stream to allow decompression on the fly. * Is supposed to wrap the stream to allow decompression on the fly.
* *
* @param in InputStream to wrap, will never be null. * @param in InputStream to wrap, will never be null.
* @return a compressed inputstream.
* @throws IOException if there is a problem.
*/ */
protected abstract InputStream wrapStream(InputStream in) protected abstract InputStream wrapStream(InputStream in)
throws IOException; throws IOException;
@@ -250,6 +281,8 @@ public abstract class CompressedResource extends Resource {
* Is supposed to wrap the stream to allow compression on the fly. * Is supposed to wrap the stream to allow compression on the fly.
* *
* @param out OutputStream to wrap, will never be null. * @param out OutputStream to wrap, will never be null.
* @return a compressed outputstream.
* @throws IOException if there is a problem.
*/ */
protected abstract OutputStream wrapStream(OutputStream out) protected abstract OutputStream wrapStream(OutputStream out)
throws IOException; throws IOException;


+ 1
- 0
src/main/org/apache/tools/ant/types/resources/PropertyResource.java View File

@@ -51,6 +51,7 @@ public class PropertyResource extends Resource {


/** /**
* Construct a new PropertyResource with the specified name. * Construct a new PropertyResource with the specified name.
* @param p the project to use.
* @param n the String name of this PropertyResource (Ant property name/key). * @param n the String name of this PropertyResource (Ant property name/key).
*/ */
public PropertyResource(Project p, String n) { public PropertyResource(Project p, String n) {


+ 0
- 1
src/main/org/apache/tools/ant/types/resources/Sort.java View File

@@ -18,7 +18,6 @@
package org.apache.tools.ant.types.resources; package org.apache.tools.ant.types.resources;


import java.util.Stack; import java.util.Stack;
import java.util.Vector;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Collection; import java.util.Collection;


+ 0
- 7
src/main/org/apache/tools/ant/types/resources/selectors/Compare.java View File

@@ -18,14 +18,7 @@
package org.apache.tools.ant.types.resources.selectors; package org.apache.tools.ant.types.resources.selectors;


import java.util.Stack; import java.util.Stack;
import java.util.Vector;
import java.util.TreeMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Collection;
import java.util.Comparator;
import java.util.Collections;
import java.util.AbstractCollection;
import java.util.NoSuchElementException;


import org.apache.tools.ant.Project; import org.apache.tools.ant.Project;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;


Loading…
Cancel
Save