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

Summary: Allow to determine origin of a symbol
Product: java Reporter: Svata Dedic <sdedic>
Component: SourceAssignee: Svata Dedic <sdedic>
Severity: normal CC: dbalek, tzezula
Priority: P3 Keywords: API, API_REVIEW_FAST
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 256404    
Attachments: Proposed changes
Changes (with issue# in apichanges)

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