ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java
Date Fri, 10 Dec 2004 21:49:32 GMT
mbenson     2004/12/10 13:49:32

  Modified:    src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  More LOC bumming
  
  Revision  Changes    Path
  1.36      +14 -27    ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- AbstractFileSet.java	10 Dec 2004 18:28:45 -0000	1.35
  +++ AbstractFileSet.java	10 Dec 2004 21:49:32 -0000	1.36
  @@ -54,8 +54,8 @@
    * <p>Common base class for DirSet and FileSet.</p>
    *
    */
  -public abstract class AbstractFileSet extends DataType implements Cloneable,
  -        SelectorContainer {
  +public abstract class AbstractFileSet extends DataType
  +    implements Cloneable, SelectorContainer {
   
       private PatternSet defaultPatterns = new PatternSet();
       private Vector additionalPatterns = new Vector();
  @@ -127,10 +127,7 @@
        * @return <code>File</code>.
        */
       public File getDir(Project p) {
  -        if (isReference()) {
  -            return getRef(p).getDir(p);
  -        }
  -        return dir;
  +        return (isReference()) ? getRef(p).getDir(p) : dir;
       }
   
       /**
  @@ -400,12 +397,10 @@
           }
           Object o = getRefid().getReferencedObject(p);
           if (!getClass().isAssignableFrom(o.getClass())) {
  -            String msg = getRefid().getRefId() + " doesn\'t denote a "
  -                + getDataTypeName();
  -            throw new BuildException(msg);
  -        } else {
  -            return (AbstractFileSet) o;
  +            throw new BuildException(getRefid().getRefId()
  +                + " doesn\'t denote a " + getDataTypeName());
           }
  +        return (AbstractFileSet) o;
       }
   
       // SelectorContainer methods
  @@ -416,10 +411,8 @@
        * @return whether any selectors are in this container.
        */
       public boolean hasSelectors() {
  -        if (isReference() && getProject() != null) {
  -            return getRef(getProject()).hasSelectors();
  -        }
  -        return !(selectors.isEmpty());
  +        return (isReference() && getProject() != null)
  +            ? getRef(getProject()).hasSelectors() : !(selectors.isEmpty());
       }
   
       /**
  @@ -450,10 +443,8 @@
        * @return the number of selectors in this container as an <code>int</code>.
        */
       public int selectorCount() {
  -        if (isReference() && getProject() != null) {
  -            return getRef(getProject()).selectorCount();
  -        }
  -        return selectors.size();
  +        return (isReference() && getProject() != null)
  +            ? getRef(getProject()).selectorCount() : selectors.size();
       }
   
       /**
  @@ -462,10 +453,8 @@
        * @return a <code>FileSelector[]</code> of the selectors in this container.
        */
       public FileSelector[] getSelectors(Project p) {
  -        if (isReference()) {
  -            return getRef(p).getSelectors(p);
  -        }
  -        return (FileSelector[])(selectors.toArray(
  +        return (isReference())
  +            ? getRef(p).getSelectors(p) : (FileSelector[])(selectors.toArray(
               new FileSelector[selectors.size()]));
       }
   
  @@ -475,10 +464,8 @@
        * @return an <code>Enumeration</code> of selectors.
        */
       public Enumeration selectorElements() {
  -        if (isReference() && getProject() != null) {
  -            return getRef(getProject()).selectorElements();
  -        }
  -        return selectors.elements();
  +        return (isReference() && getProject() != null)
  +            ? getRef(getProject()).selectorElements() : selectors.elements();
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message