ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20768] New: - ChainReaderHelper.getAssembledReader bad code
Date Fri, 13 Jun 2003 21:33:27 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20768>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20768

ChainReaderHelper.getAssembledReader bad code

           Summary: ChainReaderHelper.getAssembledReader bad code
           Product: Ant
           Version: 1.5.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: jeremyw-ant-bugzilla@igmus.org


ChainReaderHelper.getAssembledReader has bad code in simple use of custom 
filterreaders.

The following code is reached by my attached custom filterreader -- and by my 
reckoning, can never work.  The index 'j' is always past the end of 
array 'constructors' when 'constructors[j]' is used.

see org.apache.tools.ant.filters.util.ChainReaderHelper.getAssembledReader:

185                                              final Constructor[] 
constructors =
186                                                  clazz.getConstructors();
187                                              int j = 0;
188                                              for (; j < 
constructors.length; j++) {
189                                                  Class[] types = 
constructors[j]
190                                                                    .getParam
eterTypes();
191                                                  if (types.length == 1 &&
192                                                      types
[0].isAssignableFrom(Reader.class)) {
193                                                      break;
194                                                  }
195                                              }
196                                              final Reader[] rdr = 
{instream};
197                                              instream =
198 umagesh 1.1                                      (Reader) constructors
[j].newInstance(rdr);

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


Mime
View raw message