ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From umag...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/filters/util ChainReaderHelper.java
Date Tue, 17 Jun 2003 15:49:00 GMT
umagesh     2003/06/17 08:49:00

  Modified:    src/main/org/apache/tools/ant/filters/util
                        ChainReaderHelper.java
  Log:
  Throw a build exception if a public constructor that takes in a Reader as its
  sole argument is absent.
  
  PR: 20768
  
  Revision  Changes    Path
  1.14      +7 -0      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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ChainReaderHelper.java	15 Apr 2003 17:23:16 -0000	1.13
  +++ ChainReaderHelper.java	17 Jun 2003 15:49:00 -0000	1.14
  @@ -185,13 +185,20 @@
                                   final Constructor[] constructors =
                                       clazz.getConstructors();
                                   int j = 0;
  +                                boolean consPresent = false;
                                   for (; j < constructors.length; j++) {
                                       Class[] types = constructors[j]
                                                         .getParameterTypes();
                                       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.");
                                   }
                                   final Reader[] rdr = {instream};
                                   instream =
  
  
  

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


Mime
View raw message