Bug 47982 - Fails to compile aFile.listFiles(anExampleFileFilter)
Summary: Fails to compile aFile.listFiles(anExampleFileFilter)
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 M6   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-03 10:22 EST by wes maciorowski CLA
Modified: 2003-12-03 14:19 EST (History)
0 users

See Also:


Attachments
complete testcase (3.08 KB, application/x-zip-compressed)
2003-12-03 10:44 EST, wes maciorowski CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description wes maciorowski CLA 2003-12-03 10:22:47 EST
In the following snippet, the last line is marked as an error in the IDE even
though I can compile it using Ant's build file:

		File aFile = new File(baseDir + File.pathSeparator +
aSelectTemplateForm.getSelectedTemplate());
		String[] tmp = {"htm","html"};
		ExampleFileFilter anExampleFileFilter = new ExampleFileFilter(tmp,""); 
		File[] templateFiles = aFile.listFiles(anExampleFileFilter);
...
ExampleFileFilter is a sample implementation provided by Sun.  The system fails
to realize that ExampleFileFilter is an extension of FileFilter or fails to
allow for arguments to be extended from FileFilter.
Comment 1 wes maciorowski CLA 2003-12-03 10:25:00 EST
I found it in 3.0 M5
Comment 2 Olivier Thomann CLA 2003-12-03 10:28:18 EST
Could you please provide a complete test case that reproduces the problem and
attach it to this bug report?
Thanks.
Comment 3 wes maciorowski CLA 2003-12-03 10:44:48 EST
Created attachment 7047 [details]
complete testcase

add attached 2 files to a project and open Bug47982.java in Eclipse.
Comment 4 Olivier Thomann CLA 2003-12-03 11:08:31 EST
ExampleFileFilter extends the FileFilter from the swing package
javax.swing.filechooser, but doesn't implement java.io.FileFilter. The method
listFiles expects an object that implements java.io.FileFilter, not a subclass
of the Swing class.
If you add implements java.io.FileFilter in the declaration of ExampleFileFilter
then the compile error is fixed.
I would close as INVALID.
Comment 5 Olivier Thomann CLA 2003-12-03 14:19:24 EST
Close as INVALID.