commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IMAGING-165) TiffReader.Collector adds values to a field List<TiffField> but never uses it
Date Thu, 19 Feb 2015 06:50:11 GMT

    [ https://issues.apache.org/jira/browse/IMAGING-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14327050#comment-14327050
] 

Benedikt Ritter commented on IMAGING-165:
-----------------------------------------

If the said code can be removed with out breaking the tests, this may indicate that the code
isn't useful at all. Note that the test environment is not that good in imaging... 

> TiffReader.Collector adds values to a field List<TiffField> but never uses it
> -----------------------------------------------------------------------------
>
>                 Key: IMAGING-165
>                 URL: https://issues.apache.org/jira/browse/IMAGING-165
>             Project: Commons Imaging
>          Issue Type: Improvement
>          Components: Format: TIFF
>            Reporter: Michael GroƟ
>             Fix For: Discussion
>
>
> org.apache.commons.imaging.formats.tiff.TiffReader.Collector adds values to a field List<TiffField>
but never uses it. This could be the cause of some problems reported elsewhere.
> TiffReader contains an embedded class named Collector. This class has a private field
named
> {noformat}
> private static class Collector implements Listener {
>         private final List<TiffField> fields = new ArrayList<TiffField>();
> {noformat}
> There are values added in a method named
> {noformat}
> public boolean addField(final TiffField field) {
>      fields.add(field);
>      return true;
> }
> {noformat}
> This method is the only which uses this field so these values are never used. Is there
a getter missing? Or was it intended to use these values in class TiffContents like "tiffHeader"
and "directories"?
> {noformat}
> public TiffContents getContents() {
>     return new TiffContents(tiffHeader, directories);
> }
> {noformat}
> At least the method "addField" seems unused but necessary to implement the "Listener"
interface.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message