Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 227607 - Add ClassIndex.getDeclaredSymbols
Add ClassIndex.getDeclaredSymbols
Status: RESOLVED FIXED
Product: java
Classification: Unclassified
Component: Source
7.4
PC Linux
: P3 (vote)
: 7.4
Assigned To: apireviews
issues@java
: API, API_REVIEW_FAST
Depends on:
Blocks: 226064
  Show dependency treegraph
 
Reported: 2013-03-18 11:36 UTC by Jan Lahoda
Modified: 2013-03-28 15:20 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments
Proposed API change. (9.09 KB, patch)
2013-03-18 11:36 UTC, Jan Lahoda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2013-03-18 11:36:04 UTC
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.
Comment 1 Jan Lahoda 2013-03-18 11:36:49 UTC
Created attachment 132747 [details]
Proposed API change.
Comment 2 Jan Lahoda 2013-03-18 11:37:20 UTC
Please review. Thanks.
Comment 3 Tomas Zezula 2013-03-27 11:47:29 UTC
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.
Comment 4 Jan Lahoda 2013-03-28 15:20:08 UTC
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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo