You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Michael Wooten (JIRA)" <ji...@apache.org> on 2010/03/01 22:08:05 UTC

[jira] Created: (IO-229) Convert AndFileFilter Constructor to Use Varargs

Convert AndFileFilter Constructor to Use Varargs
------------------------------------------------

                 Key: IO-229
                 URL: https://issues.apache.org/jira/browse/IO-229
             Project: Commons IO
          Issue Type: Improvement
          Components: Filters
    Affects Versions: 2.0
         Environment: Java 1.5+
            Reporter: Michael Wooten
            Priority: Minor
             Fix For: 2.0


I suggest converting the AndFileFilter(IOFileFilter filter1, IOFileFilter filter2) constructor to use varargs and instead have the signature AndFileFilter(IOFileFilter... filters). The benefit is that new AndFileFilters could be created without having to create a list or limit the initial number of filters to two.
Ex: 
IOFileFilter hiddenNonEmptyTextFileFilter = new AndFileFilter(HiddenFileFilter.HIDDEN, EmptyFileFilter.NOT_EMPTY, new SuffixFileFilter(".txt"));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IO-229) Convert AndFileFilter and OrFileFilter Constructors to Use Varargs

Posted by "Michael Wooten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Wooten updated IO-229:
------------------------------

           Description: 
I suggest converting the AndFileFilter(IOFileFilter filter1, IOFileFilter filter2) and OrFileFilter(IOFileFilter filter1, IOFileFilter filter2) constructors to use varargs and instead have the signatures AndFileFilter(IOFileFilter... filters) and OrFileFilter(IOFileFilter... filters). The benefit is that new And/OrFileFilters could be created without having to create a list or limit the initial number of filters to two.
Ex: 
IOFileFilter hiddenNonEmptyTextFileFilter = new AndFileFilter(HiddenFileFilter.HIDDEN, EmptyFileFilter.NOT_EMPTY, new SuffixFileFilter(".txt"));

If backwards compatibility is an issue, then the varargs constructors could be added alongside the two argument constructors.

  was:
I suggest converting the AndFileFilter(IOFileFilter filter1, IOFileFilter filter2) constructor to use varargs and instead have the signature AndFileFilter(IOFileFilter... filters). The benefit is that new AndFileFilters could be created without having to create a list or limit the initial number of filters to two.
Ex: 
IOFileFilter hiddenNonEmptyTextFileFilter = new AndFileFilter(HiddenFileFilter.HIDDEN, EmptyFileFilter.NOT_EMPTY, new SuffixFileFilter(".txt"));

    Remaining Estimate: 2h  (was: 0.03h)
     Original Estimate: 2h  (was: 0.03h)
               Summary: Convert AndFileFilter and OrFileFilter Constructors to Use Varargs  (was: Convert AndFileFilter Constructor to Use Varargs)

> Convert AndFileFilter and OrFileFilter Constructors to Use Varargs
> ------------------------------------------------------------------
>
>                 Key: IO-229
>                 URL: https://issues.apache.org/jira/browse/IO-229
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Filters
>    Affects Versions: 2.0
>         Environment: Java 1.5+
>            Reporter: Michael Wooten
>            Priority: Minor
>             Fix For: 2.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I suggest converting the AndFileFilter(IOFileFilter filter1, IOFileFilter filter2) and OrFileFilter(IOFileFilter filter1, IOFileFilter filter2) constructors to use varargs and instead have the signatures AndFileFilter(IOFileFilter... filters) and OrFileFilter(IOFileFilter... filters). The benefit is that new And/OrFileFilters could be created without having to create a list or limit the initial number of filters to two.
> Ex: 
> IOFileFilter hiddenNonEmptyTextFileFilter = new AndFileFilter(HiddenFileFilter.HIDDEN, EmptyFileFilter.NOT_EMPTY, new SuffixFileFilter(".txt"));
> If backwards compatibility is an issue, then the varargs constructors could be added alongside the two argument constructors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IO-229) Convert AndFileFilter and OrFileFilter Constructors to Use Varargs

Posted by "Michael Wooten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Wooten updated IO-229:
------------------------------

    Attachment: varargs-and-or-filters.patch

This patch was generated using Eclipse. The patch replaces the AndFileFilter(IOFileFilter, IOFileFilter) constructor with a AndFileFilter(IOFileFilter...) one, and likewise for OrFileFilter. The utility methods in FileFilterUtils have also been updated to accept a variable number of arguments. Minor changes were made to the test cases to test accepting more than two arguments.

> Convert AndFileFilter and OrFileFilter Constructors to Use Varargs
> ------------------------------------------------------------------
>
>                 Key: IO-229
>                 URL: https://issues.apache.org/jira/browse/IO-229
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Filters
>    Affects Versions: 2.0
>         Environment: Java 1.5+
>            Reporter: Michael Wooten
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: varargs-and-or-filters.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I suggest converting the AndFileFilter(IOFileFilter filter1, IOFileFilter filter2) and OrFileFilter(IOFileFilter filter1, IOFileFilter filter2) constructors to use varargs and instead have the signatures AndFileFilter(IOFileFilter... filters) and OrFileFilter(IOFileFilter... filters). The benefit is that new And/OrFileFilters could be created without having to create a list or limit the initial number of filters to two.
> Ex: 
> IOFileFilter hiddenNonEmptyTextFileFilter = new AndFileFilter(HiddenFileFilter.HIDDEN, EmptyFileFilter.NOT_EMPTY, new SuffixFileFilter(".txt"));
> If backwards compatibility is an issue, then the varargs constructors could be added alongside the two argument constructors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (IO-229) FileFilterUtils - add varargs methods for AndFileFilter and OrFileFilter

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved IO-229.
--------------------------------

      Assignee: Niall Pemberton
    Resolution: Fixed

Thanks for the patch, but I implemented this as new and(IOFileFilter...) and or(IOFileFilter...)  methods in FileFilterUtils and deprecated the andFileFilter(IOFileFilter, IOFileFilter) and orFileFilter(IOFileFilter, IOFileFilter) methods

http://svn.apache.org/viewvc?view=revision&revision=1002394

> FileFilterUtils - add varargs methods for AndFileFilter and OrFileFilter
> ------------------------------------------------------------------------
>
>                 Key: IO-229
>                 URL: https://issues.apache.org/jira/browse/IO-229
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Filters
>    Affects Versions: 1.4
>         Environment: Java 1.5+
>            Reporter: Michael Wooten
>            Assignee: Niall Pemberton
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: varargs-and-or-filters.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I suggest converting the AndFileFilter(IOFileFilter filter1, IOFileFilter filter2) and OrFileFilter(IOFileFilter filter1, IOFileFilter filter2) constructors to use varargs and instead have the signatures AndFileFilter(IOFileFilter... filters) and OrFileFilter(IOFileFilter... filters). The benefit is that new And/OrFileFilters could be created without having to create a list or limit the initial number of filters to two.
> Ex: 
> IOFileFilter hiddenNonEmptyTextFileFilter = new AndFileFilter(HiddenFileFilter.HIDDEN, EmptyFileFilter.NOT_EMPTY, new SuffixFileFilter(".txt"));
> If backwards compatibility is an issue, then the varargs constructors could be added alongside the two argument constructors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IO-229) FileFilterUtils - add varargs methods for AndFileFilter and OrFileFilter

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton updated IO-229:
-------------------------------

              Summary: FileFilterUtils - add varargs methods for AndFileFilter and OrFileFilter  (was: Convert AndFileFilter and OrFileFilter Constructors to Use Varargs)
    Affects Version/s: 1.4
                           (was: 2.0)

> FileFilterUtils - add varargs methods for AndFileFilter and OrFileFilter
> ------------------------------------------------------------------------
>
>                 Key: IO-229
>                 URL: https://issues.apache.org/jira/browse/IO-229
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Filters
>    Affects Versions: 1.4
>         Environment: Java 1.5+
>            Reporter: Michael Wooten
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: varargs-and-or-filters.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I suggest converting the AndFileFilter(IOFileFilter filter1, IOFileFilter filter2) and OrFileFilter(IOFileFilter filter1, IOFileFilter filter2) constructors to use varargs and instead have the signatures AndFileFilter(IOFileFilter... filters) and OrFileFilter(IOFileFilter... filters). The benefit is that new And/OrFileFilters could be created without having to create a list or limit the initial number of filters to two.
> Ex: 
> IOFileFilter hiddenNonEmptyTextFileFilter = new AndFileFilter(HiddenFileFilter.HIDDEN, EmptyFileFilter.NOT_EMPTY, new SuffixFileFilter(".txt"));
> If backwards compatibility is an issue, then the varargs constructors could be added alongside the two argument constructors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.