ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/types PatternSet.java
Date Fri, 18 Jul 2003 14:21:24 GMT
conor       2003/07/18 07:21:24

  Modified:    src/main/org/apache/tools/ant/filters BaseFilterReader.java
                        HeadFilter.java StripJavaComments.java
                        TailFilter.java
               src/main/org/apache/tools/ant/filters/util
                        ChainReaderHelper.java
               src/main/org/apache/tools/ant/taskdefs Untar.java
                        WaitFor.java
               src/main/org/apache/tools/ant/taskdefs/optional/dotnet
                        CSharp.java DotnetBaseMatchingTask.java
                        DotnetCompile.java DotnetDefine.java Ilasm.java
                        ImportTypelib.java NetCommand.java
                        VisualBasicCompile.java WsdlToDotnet.java
               src/main/org/apache/tools/ant/types PatternSet.java
  Log:
  Last for a while ... :-)
  
  Revision  Changes    Path
  1.14      +6 -4      ant/src/main/org/apache/tools/ant/filters/BaseFilterReader.java
  
  Index: BaseFilterReader.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/BaseFilterReader.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -u -r1.13 -r1.14
  --- BaseFilterReader.java	6 Jul 2003 09:57:35 -0000	1.13
  +++ BaseFilterReader.java	18 Jul 2003 14:21:21 -0000	1.14
  @@ -65,8 +65,10 @@
    *
    * @author Magesh Umasankar
    */
  -public abstract class BaseFilterReader
  -    extends FilterReader {
  +public abstract class BaseFilterReader extends FilterReader {
  +    /** Buffer size used when reading */
  +    private static final int BUFFER_SIZE = 8192;
  +
       /** Have the parameters passed been interpreted? */
       private boolean initialized = false;
   
  @@ -116,7 +118,7 @@
        *
        * @exception  IOException  If an I/O error occurs
        */
  -    public final int read(final char cbuf[], final int off,
  +    public final int read(final char[] cbuf, final int off,
                             final int len) throws IOException {
           for (int i = 0; i < len; i++) {
               final int ch = read();
  @@ -232,6 +234,6 @@
        *            reading
        */
       protected final String readFully() throws IOException {
  -        return FileUtils.readFully(in, 8192);
  +        return FileUtils.readFully(in, BUFFER_SIZE);
       }
   }
  
  
  
  1.11      +2 -3      ant/src/main/org/apache/tools/ant/filters/HeadFilter.java
  
  Index: HeadFilter.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/HeadFilter.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -u -r1.10 -r1.11
  --- HeadFilter.java	6 Jul 2003 09:57:35 -0000	1.10
  +++ HeadFilter.java	18 Jul 2003 14:21:21 -0000	1.11
  @@ -70,8 +70,7 @@
    *
    * @author Magesh Umasankar
    */
  -public final class HeadFilter
  -    extends BaseParamFilterReader
  +public final class HeadFilter extends BaseParamFilterReader
       implements ChainableReader {
       /** Parameter name for the number of lines to be returned. */
       private static final String LINES_KEY = "lines";
  @@ -83,7 +82,7 @@
       private long linesRead = 0;
   
       /** Default number of lines to show */
  -    private static int DEFAULT_NUM_LINES = 10;
  +    private static final int DEFAULT_NUM_LINES = 10;
   
       /** Number of lines to be returned in the filtered stream. */
       private long lines = DEFAULT_NUM_LINES;
  
  
  
  1.12      +2 -0      ant/src/main/org/apache/tools/ant/filters/StripJavaComments.java
  
  Index: StripJavaComments.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/StripJavaComments.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -u -r1.11 -r1.12
  --- StripJavaComments.java	23 Apr 2003 15:12:13 -0000	1.11
  +++ StripJavaComments.java	18 Jul 2003 14:21:21 -0000	1.12
  @@ -62,6 +62,8 @@
    * (if you have more complex Java parsing needs, use a real lexer).
    * Since this class heavily relies on the single char read function,
    * you are reccomended to make it work on top of a buffered reader.
  + *
  + * @author Not Specified.
    */
   public final class StripJavaComments
       extends BaseFilterReader
  
  
  
  1.12      +11 -7     ant/src/main/org/apache/tools/ant/filters/TailFilter.java
  
  Index: TailFilter.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/TailFilter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -u -r1.11 -r1.12
  --- TailFilter.java	17 Jul 2003 15:44:36 -0000	1.11
  +++ TailFilter.java	18 Jul 2003 14:21:21 -0000	1.12
  @@ -73,8 +73,7 @@
    *
    * @author Magesh Umasankar
    */
  -public final class TailFilter
  -    extends BaseParamFilterReader
  +public final class TailFilter extends BaseParamFilterReader
       implements ChainableReader {
       /** Parameter name for the number of lines to be returned. */
       private static final String LINES_KEY = "lines";
  @@ -85,8 +84,11 @@
       /** Number of lines currently read in. */
       private long linesRead = 0;
   
  +    /** Default number of lines to show */
  +    private static final int DEFAULT_NUM_LINES = 10;
  +
       /** Number of lines to be returned in the filtered stream. */
  -    private long lines = 10;
  +    private long lines = DEFAULT_NUM_LINES;
   
       /** Number of lines to be skipped. */
       private long skip = 0;
  @@ -150,15 +152,17 @@
           while (line == null || line.length() == 0) {
               line = lineTokenizer.getToken(in);
               line = tailFilter(line);
  -            if (line == null)
  +            if (line == null) {
                   return -1;
  +            }
               linePos = 0;
           }
   
           int ch = line.charAt(linePos);
           linePos++;
  -        if (linePos == line.length())
  +        if (linePos == line.length()) {
               line = null;
  +        }
           return ch;
       }
   
  @@ -183,7 +187,7 @@
       /**
        * Sets the number of lines to be skipped in the filtered stream.
        *
  -     * @param lines the number of lines to be skipped in the filtered stream
  +     * @param skip the number of lines to be skipped in the filtered stream
        */
       public final void setSkip(final long skip) {
           this.skip = skip;
  
  
  
  1.17      +12 -10    ant/src/main/org/apache/tools/ant/filters/util/ChainReaderHelper.java
  
  Index: ChainReaderHelper.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/util/ChainReaderHelper.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -w -u -r1.16 -r1.17
  --- ChainReaderHelper.java	17 Jul 2003 15:44:37 -0000	1.16
  +++ ChainReaderHelper.java	18 Jul 2003 14:21:21 -0000	1.17
  @@ -178,8 +178,8 @@
                               }
                               if (clazz != null) {
                                   if (!FilterReader.class.isAssignableFrom(clazz)) {
  -                                    throw new BuildException(className +
  -                                        " does not extend java.io.FilterReader");
  +                                    throw new BuildException(className
  +                                        + " does not extend java.io.FilterReader");
                                   }
                                   final Constructor[] constructors =
                                       clazz.getConstructors();
  @@ -188,16 +188,17 @@
                                   for (; j < constructors.length; j++) {
                                       Class[] types = constructors[j]
                                                         .getParameterTypes();
  -                                    if (types.length == 1 &&
  -                                        types[0].isAssignableFrom(Reader.class)) {
  +                                    if (types.length == 1
  +                                        && types[0].isAssignableFrom(Reader.class))
{
                                           consPresent = true;
                                           break;
                                       }
                                   }
                                   if ( !consPresent) {
  -                                    throw new BuildException( className +
  -                                            " does not define a public constructor" +
  -                                            " that takes in a Reader as its single argument.");
  +                                    throw new BuildException(className
  +                                        + " does not define a public constructor"
  +                                        + " that takes in a Reader as its "
  +                                        + "single argument.");
                                   }
                                   final Reader[] rdr = {instream};
                                   instream =
  @@ -235,8 +236,9 @@
        * classes, even if they have public methods.
        */
       private void setProjectOnObject(Object obj) {
  -        if (project == null)
  +        if (project == null) {
               return;
  +        }
           if (obj instanceof BaseFilterReader) {
               ((BaseFilterReader) obj).setProject(project);
               return;
  
  
  
  1.35      +4 -2      ant/src/main/org/apache/tools/ant/taskdefs/Untar.java
  
  Index: Untar.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Untar.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -w -u -r1.34 -r1.35
  --- Untar.java	6 Jul 2003 09:57:37 -0000	1.34
  +++ Untar.java	18 Jul 2003 14:21:22 -0000	1.35
  @@ -146,7 +146,9 @@
               if (tis != null) {
                   try {
                       tis.close();
  -                } catch (IOException e) {}
  +                } catch (IOException e) {
  +                    // ignore
  +                }
               }
           }
       }
  
  
  
  1.18      +12 -10    ant/src/main/org/apache/tools/ant/taskdefs/WaitFor.java
  
  Index: WaitFor.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/WaitFor.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -w -u -r1.17 -r1.18
  --- WaitFor.java	6 Jul 2003 09:57:37 -0000	1.17
  +++ WaitFor.java	18 Jul 2003 14:21:22 -0000	1.18
  @@ -88,10 +88,11 @@
    */
   
   public class WaitFor extends ConditionBase {
  -    private long maxWaitMillis = 1000l * 60l * 3l; // default max wait time
  -    private long maxWaitMultiplier = 1l;
  -    private long checkEveryMillis = 500l;
  -    private long checkEveryMultiplier = 1l;
  +    /** default max wait time */
  +    private long maxWaitMillis = 1000L * 60L * 3L;
  +    private long maxWaitMultiplier = 1L;
  +    private long checkEveryMillis = 500L;
  +    private long checkEveryMultiplier = 1L;
       private String timeoutProperty;
   
       /**
  @@ -159,6 +160,7 @@
                   try {
                       Thread.sleep(checkEveryMillis);
                   } catch (InterruptedException e) {
  +                    // ignore
                   }
               }
   
  @@ -192,12 +194,12 @@
           private Hashtable timeTable = new Hashtable();
   
           public Unit() {
  -            timeTable.put(MILLISECOND, new Long(1l));
  -            timeTable.put(SECOND,      new Long(1000l));
  -            timeTable.put(MINUTE,      new Long(1000l * 60l));
  -            timeTable.put(HOUR,        new Long(1000l * 60l * 60l));
  -            timeTable.put(DAY,         new Long(1000l * 60l * 60l * 24l));
  -            timeTable.put(WEEK,        new Long(1000l * 60l * 60l * 24l * 7l));
  +            timeTable.put(MILLISECOND, new Long(1L));
  +            timeTable.put(SECOND,      new Long(1000L));
  +            timeTable.put(MINUTE,      new Long(1000L * 60L));
  +            timeTable.put(HOUR,        new Long(1000L * 60L * 60L));
  +            timeTable.put(DAY,         new Long(1000L * 60L * 60L * 24L));
  +            timeTable.put(WEEK,        new Long(1000L * 60L * 60L * 24L * 7L));
           }
   
           public long getMultiplier() {
  
  
  
  1.34      +4 -4      ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java
  
  Index: CSharp.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -w -u -r1.33 -r1.34
  
  
  
  1.5       +10 -9     ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetBaseMatchingTask.java
  
  Index: DotnetBaseMatchingTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetBaseMatchingTask.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -u -r1.4 -r1.5
  --- DotnetBaseMatchingTask.java	17 Jul 2003 15:44:40 -0000	1.4
  +++ DotnetBaseMatchingTask.java	18 Jul 2003 14:21:22 -0000	1.5
  @@ -133,7 +133,8 @@
        */
       protected int buildFileList(NetCommand command, Hashtable filesToBuild, long outputTimestamp)
{
           int filesOutOfDate=0;
  -        boolean scanImplicitFileset=getSrcDir()!=null || filesets.size()==0;
  +        boolean scanImplicitFileset
  +            = getSrcDir() != null || filesets.size() == 0;
           if (scanImplicitFileset) {
               //scan for an implicit fileset if there was a srcdir set
               //or there was no srcDir set but the @
  
  
  
  1.10      +20 -20    ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java
  
  Index: DotnetCompile.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -u -r1.9 -r1.10
  --- DotnetCompile.java	17 Jul 2003 15:44:40 -0000	1.9
  +++ DotnetCompile.java	18 Jul 2003 14:21:22 -0000	1.10
  @@ -579,8 +579,8 @@
       public void setTargetType(String ttype)
                throws BuildException {
           ttype = ttype.toLowerCase();
  -        if (ttype.equals("exe") || ttype.equals("library") ||
  -                ttype.equals("module") || ttype.equals("winexe")) {
  +        if (ttype.equals("exe") || ttype.equals("library")
  +            || ttype.equals("module") || ttype.equals("winexe")) {
               targetType = ttype;
           } else {
               throw new BuildException("targetType " + ttype
  @@ -847,8 +847,8 @@
           fillInSharedParameters(command);
           addResources(command);
           addCompilerSpecificOptions(command);
  -        int referencesOutOfDate=addReferenceFilesets(command,
  -                getOutputFileTimestamp());
  +        int referencesOutOfDate
  +            = addReferenceFilesets(command, getOutputFileTimestamp());
           //if the refs are out of date, force a build.
           boolean forceBuild= referencesOutOfDate > 0;
           addFilesAndExecute(command, forceBuild);
  
  
  
  1.4       +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetDefine.java
  
  Index: DotnetDefine.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetDefine.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -u -r1.3 -r1.4
  
  
  
  1.29      +5 -3      ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java
  
  Index: Ilasm.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -w -u -r1.28 -r1.29
  --- Ilasm.java	18 Apr 2003 23:40:24 -0000	1.28
  +++ Ilasm.java	18 Jul 2003 14:21:23 -0000	1.29
  @@ -160,6 +160,7 @@
        *  any extra command options?
        */
       protected String extraOptions;
  +
       /**
        * filesets of references
        */
  @@ -245,7 +246,8 @@
        * @ant.attribute ignore="true"
        */
       public void setOwner(String s) {
  -        log("This option is not supported by ILASM as of Beta-2, and will be ignored",
Project.MSG_WARN);
  +        log("This option is not supported by ILASM as of Beta-2, "
  +            + "and will be ignored", Project.MSG_WARN);
       }
   
   
  
  
  
  1.5       +10 -12    ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/ImportTypelib.java
  
  Index: ImportTypelib.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/ImportTypelib.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -u -r1.4 -r1.5
  --- ImportTypelib.java	17 Jul 2003 15:44:41 -0000	1.4
  +++ ImportTypelib.java	18 Jul 2003 14:21:23 -0000	1.5
  @@ -185,8 +185,8 @@
               +" to assembly "+destFile
               +" in namespace "+namespace, Project.MSG_VERBOSE);
           //rebuild unless the dest file is newer than the source file
  -        if (srcFile.exists() && destFile.exists() &&
  -                srcFile.lastModified() <= destFile.lastModified()) {
  +        if (srcFile.exists() && destFile.exists()
  +            && srcFile.lastModified() <= destFile.lastModified()) {
               log("The typelib is up to date",Project.MSG_VERBOSE);
               return;
           }
  @@ -205,7 +205,5 @@
               command.addArgument("/unsafe");
           }
           command.addArgument(extraOptions);
  -
  -
       }
   }
  
  
  
  1.21      +3 -3      ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
  
  Index: NetCommand.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -w -u -r1.20 -r1.21
  
  
  
  1.6       +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/VisualBasicCompile.java
  
  Index: VisualBasicCompile.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/VisualBasicCompile.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -u -r1.5 -r1.6
  --- VisualBasicCompile.java	17 Jul 2003 15:44:41 -0000	1.5
  +++ VisualBasicCompile.java	18 Jul 2003 14:21:23 -0000	1.6
  @@ -213,7 +213,7 @@
   
       /**
        * Specifies the root namespace for all type declarations.
  -     * @param  a root namespace.
  +     * @param rootNamespace a root namespace.
        */
       public void setRootNamespace(String rootNamespace) {
           this.rootNamespace = rootNamespace;
  
  
  
  1.15      +4 -4      ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java
  
  Index: WsdlToDotnet.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -w -u -r1.14 -r1.15
  --- WsdlToDotnet.java	17 Jul 2003 15:44:41 -0000	1.14
  +++ WsdlToDotnet.java	18 Jul 2003 14:21:23 -0000	1.15
  @@ -242,8 +242,8 @@
           if (srcFile!=null) {
               command.addArgument(srcFile.toString());
               //rebuild unless the dest file is newer than the source file
  -            if (srcFile.exists() && destFile.exists() &&
  -                srcFile.lastModified() <= destFile.lastModified()) {
  +            if (srcFile.exists() && destFile.exists()
  +                && srcFile.lastModified() <= destFile.lastModified()) {
                   rebuild = false;
               }
           } else {
  
  
  
  1.30      +31 -31    ant/src/main/org/apache/tools/ant/types/PatternSet.java
  
  Index: PatternSet.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/PatternSet.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -w -u -r1.29 -r1.30
  --- PatternSet.java	7 Mar 2003 11:23:07 -0000	1.29
  +++ PatternSet.java	18 Jul 2003 14:21:24 -0000	1.30
  @@ -473,8 +473,8 @@
       }
   
       public String toString() {
  -        return "patternSet{ includes: " + includeList + 
  -            " excludes: " + excludeList + " }";
  +        return "patternSet{ includes: " + includeList
  +                + " excludes: " + excludeList + " }";
       }
   
   }
  
  
  

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


Mime
View raw message