You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benoit Sigoure (JIRA)" <ji...@apache.org> on 2010/03/02 07:11:27 UTC
[jira] Created: (IO-230) DirectoryWalker needs to use generics to
avoid compilation warnings
DirectoryWalker needs to use generics to avoid compilation warnings
-------------------------------------------------------------------
Key: IO-230
URL: https://issues.apache.org/jira/browse/IO-230
Project: Commons IO
Issue Type: Improvement
Components: Utilities
Affects Versions: 1.4
Reporter: Benoit Sigoure
Priority: Minor
When overriding methods such as {{handleFile}}, a generic {{Collection}} object is passed in argument. One is expected to add something to it, such as in this excerpt from [{{DirectoryWalker}}'s own javadoc|http://commons.apache.org/io/api-release/org/apache/commons/io/DirectoryWalker.html]:
{code}
protected void handleFile(File file, int depth, Collection results) {
[...]
results.add(file); // This lines triggers a warning.
}
{code}
This code triggers a {{warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.Collection}}. I believe the right fix is to change {{DirectoryWalker}} to be parameterized by a type {{T}} so that the signature of {{handleFile}} (and other similar methods) can be changed to receive a {{Collection<T>}} in argument.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IO-230) DirectoryWalker needs to use generics to
avoid compilation warnings
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IO-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840086#action_12840086 ]
Niall Pemberton commented on IO-230:
------------------------------------
Already done:
http://svn.apache.org/viewvc?view=revision&revision=897578
> DirectoryWalker needs to use generics to avoid compilation warnings
> -------------------------------------------------------------------
>
> Key: IO-230
> URL: https://issues.apache.org/jira/browse/IO-230
> Project: Commons IO
> Issue Type: Improvement
> Components: Utilities
> Affects Versions: 1.4
> Reporter: Benoit Sigoure
> Priority: Minor
>
> When overriding methods such as {{handleFile}}, a generic {{Collection}} object is passed in argument. One is expected to add something to it, such as in this excerpt from [{{DirectoryWalker}}'s own javadoc|http://commons.apache.org/io/api-release/org/apache/commons/io/DirectoryWalker.html]:
> {code}
> protected void handleFile(File file, int depth, Collection results) {
> [...]
> results.add(file); // This lines triggers a warning.
> }
> {code}
> This code triggers a {{warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.Collection}}. I believe the right fix is to change {{DirectoryWalker}} to be parameterized by a type {{T}} so that the signature of {{handleFile}} (and other similar methods) can be changed to receive a {{Collection<T>}} in argument.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (IO-230) DirectoryWalker needs to use generics to
avoid compilation warnings
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IO-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton resolved IO-230.
--------------------------------
Resolution: Fixed
Fix Version/s: 2.0
Also see http://markmail.org/message/b7nb3ygsll7j736c
> DirectoryWalker needs to use generics to avoid compilation warnings
> -------------------------------------------------------------------
>
> Key: IO-230
> URL: https://issues.apache.org/jira/browse/IO-230
> Project: Commons IO
> Issue Type: Improvement
> Components: Utilities
> Affects Versions: 1.4
> Reporter: Benoit Sigoure
> Priority: Minor
> Fix For: 2.0
>
>
> When overriding methods such as {{handleFile}}, a generic {{Collection}} object is passed in argument. One is expected to add something to it, such as in this excerpt from [{{DirectoryWalker}}'s own javadoc|http://commons.apache.org/io/api-release/org/apache/commons/io/DirectoryWalker.html]:
> {code}
> protected void handleFile(File file, int depth, Collection results) {
> [...]
> results.add(file); // This lines triggers a warning.
> }
> {code}
> This code triggers a {{warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.Collection}}. I believe the right fix is to change {{DirectoryWalker}} to be parameterized by a type {{T}} so that the signature of {{handleFile}} (and other similar methods) can be changed to receive a {{Collection<T>}} in argument.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IO-230) DirectoryWalker needs to use generics to
avoid compilation warnings
Posted by "Benoit Sigoure (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IO-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840252#action_12840252 ]
Benoit Sigoure commented on IO-230:
-----------------------------------
Nice, I didn't see any JIRA on this issue so I didn't notice it was already fixed.
This commit didn't update the javadoc though :-/
> DirectoryWalker needs to use generics to avoid compilation warnings
> -------------------------------------------------------------------
>
> Key: IO-230
> URL: https://issues.apache.org/jira/browse/IO-230
> Project: Commons IO
> Issue Type: Improvement
> Components: Utilities
> Affects Versions: 1.4
> Reporter: Benoit Sigoure
> Priority: Minor
> Fix For: 2.0
>
>
> When overriding methods such as {{handleFile}}, a generic {{Collection}} object is passed in argument. One is expected to add something to it, such as in this excerpt from [{{DirectoryWalker}}'s own javadoc|http://commons.apache.org/io/api-release/org/apache/commons/io/DirectoryWalker.html]:
> {code}
> protected void handleFile(File file, int depth, Collection results) {
> [...]
> results.add(file); // This lines triggers a warning.
> }
> {code}
> This code triggers a {{warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.Collection}}. I believe the right fix is to change {{DirectoryWalker}} to be parameterized by a type {{T}} so that the signature of {{handleFile}} (and other similar methods) can be changed to receive a {{Collection<T>}} in argument.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.