Summary: | [JSR269] Error in EclipseFileManager.collectAllMatchingFiles | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dmitry Balzer <balzerd> | ||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | Olivier_Thomann | ||||
Version: | 3.6 | ||||||
Target Milestone: | 3.6 M6 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Dmitry Balzer
2010-02-02 12:22:40 EST
Would you have an example where the wrong result is reported? I would add it as a regression test. Thanks for the report. (In reply to comment #1) > Would you have an example where the wrong result is reported? I would add it as > a regression test. > Thanks for the report. Hello, for example, if you have different .java files in some directory, then the following code will print out just the directory name many times instead of file names: === public class EclipseFileManagerTest { @SuppressWarnings({ "unchecked", "restriction" }) public static void main(String[] args) throws IOException { StandardJavaFileManager fileManager = new org.eclipse.jdt.internal.compiler.tool.EclipseFileManager(null, null); LinkedList<File> fins = new LinkedList<File>(); fins.add(new File("C:\\CheckDepBin\\1\\autoCheckOut\\src")); JavaFileManager.Location sourceLoc = javax.tools.StandardLocation.SOURCE_PATH; fileManager.setLocation(sourceLoc, fins); HashSet<JavaFileObject.Kind> fileTypes = new HashSet<JavaFileObject.Kind>(); fileTypes.add(JavaFileObject.Kind.SOURCE); Iterable<? extends JavaFileObject> compilationUnits = fileManager.list( sourceLoc, "", fileTypes, true); Iterator it = compilationUnits.iterator(); while (it.hasNext()) { System.out.println(it.next()); } } } === Created attachment 158095 [details]
Proposed fix + regression tests
Thanks for the test case. Patch is ready. Released for 3.6M6. Regression tests added in both compiler.tools and compiler.apt tests. Verified for 3.6M6 using build I20100307-2000. |