This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Build 1039 from deadlock, Mac OS X. 1. Mount a directory that contains subdirectories in the Favorites tab 2. Launch the Find dialog in this directory. Leave 'Containing Text' empty, and put the name of some subdirectory of the mounted directory in 'File Name Patterns' => Search does not find the subdirectory. The expected result is that the subdirectory is found.
Too bad this was reclassified as an enhancement and set to 'future' (meaning it won't be done anytime soon). I was hoping NetBeans could replace the search functionality in Total Commander (as I can't use Total Commander now after switching to Mac), but unfortunately it's still far from usable.
I still think this is a (P3) defect, not an enhancement.
I had a short look. At org.netbeans.api.search.provider.impl.SimpleSearchIterator.update() there is code like if (file.isFolder()) { processFolder(file); } If you insert the check like fileNameMatcher.pathMatches(file) to match the directory name to the given pattern, then it would not be possible to traverse the children if a directory with the given name is found. @NB-Devs: Any ideas to solve the dilemma?
> @NB-Devs: Any ideas to solve the dilemma? I think it could be solved. This change in SimpleSearchIterator should work (needs some tests before applying). @@ -149,7 +149,11 @@ do { if (childrenEnum.hasMoreElements()) { FileObject file = childrenEnum.nextElement(); - if (file.isFolder()) { + if (fileNameMatcher.pathMatches(file) && file.isFolder()) { + processFolder(file); + nextObject = file; + break; + } else if (file.isFolder()) { processFolder(file); } else if (searchInArchives && isArchive(file)) { listener.directoryEntered(file.getPath()); (Some other changes that enable working with folders in search results would be needed). The main reason why I'm not very inclined to implementing this enhancement is that I don't find it very practical. We would need another check box "find folders", which would make the dialog more complicated. Anyway, users that need to find files in a folder of specified name can check "File Path Regular expression" and enter file name pattern e.g. "/myFolder/". So, the only thing the IDE currently cannot do is to find empty folder of specified name. I would rather keep this issue open. If there is a lot of votes some time in the future, we can consider implementing it and discuss the concrete implementation. Thank you for looking into it, Benno. What do you think? Would you find this feature helpful? If so, what's your use case?
> Thank you for looking into it, Benno. What do you think? Would you find this > feature helpful? If so, what's your use case? @Jaroslav: For me it not yet useful. Leave it open and wait for votes. I've never tried to search for directories using the search dialog. I had the module open and watched for some open issue which could be solved easily. This seemed to be one, but it wasn't...