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.
Our ClassIndex is currently able to find all symbols (methods, contructors and fields) for a given simple name (or prefix/regexp of thereof). But there is not API method to invoke that functionality outside of java.source. I am proposing to add such a method (ClassIndex.getDeclaredSymbols), so that we can implement import resolution also for static imports.
Created attachment 132747 [details] Proposed API change.
Please review. Thanks.
Seems Ok to me. One possible change regarding the future inclusion of the full index which will introduce a new method like getSymbols(). If the getDeclaredSymbols() is changed to getSymbols(...,SymbolKind) where enum SymbolKind { DECLARED } the API can be extended to full index by just adding ALL to SymbolKind.
I think having a separate method for full text index would be better, so several reasons. First, it may not be appropriate to have it in ClassIndex/java.source. Second, the current getDeclaredSymbol returns ElementHandles containing a sub-element with the given name. For full text index, we will likely want to return FileObjects rather than ElementHandles. Integrated: http://hg.netbeans.org/jet-main/rev/69b858bd531b