You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/06/13 23:33:27 UTC

DO NOT REPLY [Bug 20768] New: - ChainReaderHelper.getAssembledReader bad code

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