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.

Bug 262281 - Allow to determine origin of a symbol
Summary: Allow to determine origin of a symbol
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks: 256404
  Show dependency tree
 
Reported: 2016-05-31 11:23 UTC by Svata Dedic
Modified: 2016-06-17 08:48 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed changes (8.47 KB, patch)
2016-05-31 11:23 UTC, Svata Dedic
Details | Diff
Changes (with issue# in apichanges) (8.47 KB, patch)
2016-05-31 11:24 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2016-05-31 11:23:20 UTC
Created attachment 159926 [details]
Proposed changes

I need to find out what Element/Tree in the source introduces a symbol in order to report possible conflicts etc when the code is about to introduce a new method or a field.  The task is pretty tricky because of inheritance/hiding rules so I thought the code could be useful in general.

The added method works similar to getLocalMembersAndVars, but instead of just Elements, it returns a Map or Elements to the Scope that introduced them into the source. It is then possible to find if e.g. a TypeElement corresponding to unqalified "Foo" is made available by import, or by inheriting Foo from some superclass.

Please review the attached diff.
Comment 1 Svata Dedic 2016-05-31 11:24:53 UTC
Created attachment 159927 [details]
Changes (with issue# in apichanges)
Comment 2 Svata Dedic 2016-06-17 08:48:46 UTC
Fixed in jet-main#a494d90e587c