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 223265 - Overriding methods of Viewable.view() does not work correctly
Summary: Overriding methods of Viewable.view() does not work correctly
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.3
Hardware: PC Mac OS X
: P2 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on: 223917
Blocks:
  Show dependency tree
 
Reported: 2012-12-04 15:28 UTC by Petr Jiricka
Modified: 2013-01-03 02:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2012-12-04 15:28:28 UTC
1. Open project 'html' from NetBeans sources
2. Go to HtmlDataObject.ViewSupport and go to super-implementation for the view() method. org.netbeans.api.actions.Viewable will be opened.
3. Find overriding methods of the Viewable.view() method in all open project

=> Nothing is found, I expect the overriding method in HtmlDataObject.ViewSupport to be found.

At the same time, when I click the "I" icon in the gutter (which displays the "Has Implementations" tooltip), it correctly opens the usage in HtmlDataObject.ViewSupport.
Comment 1 Ralph Ruijs 2012-12-04 19:53:05 UTC
Refactoring asks the classindex for references to the element, but nothing is returned.

It queries the my local lucene for:
  references: org.netbeans.api.actions.Viewable?+???

but it only contains the term:
  org.netbeans.api.actions.Viewable--+-+


Please evaluate, thanks.
Comment 2 Tomas Zezula 2012-12-07 14:22:51 UTC
Which is OK.
The org.netbeans.api.actions.Viewable--+-+ is correct, it means that in the root there is only a type which has reference and member access to org.netbeans.api.actions.Viewable. But the refactoring is asking about implements relation. However there is no such a relation in html/src sources.
The org.netbeans.api.actions.Viewable--+-+ reference is for org.netbeans.modules.html.api.HtmlDataNode which is the only type which uses the org.netbeans.api.actions.Viewable. The HtmlDataObject$ViewSupport does not directly implement org.netbeans.api.actions.Viewable it implements org.openide.cookies.ViewCookie which implements the org.netbeans.api.actions.Viewable.
So the correct query should be "references:org.openide.cookies.ViewCookie?+???" as the index is not  transitive.


For  org.openide.cookies.ViewCookie there are 2 references in the html/src root:

org.openide.cookies.ViewCookie-+--- -> org.netbeans.modules.html.HtmlDataObject$ViewSupportC
org.openide.cookies.ViewCookie----+ -> org.netbeans.modules.html.HtmlDataObjectC

The first one is describing that "class org.netbeans.modules.html.HtmlDataObject$ViewSupport" implements org.openide.cookies.ViewCookie" which is exactly what Petr is looking for.

In the openide.nodes/src there is following relation:
org.netbeans.api.actions.Viewable-+--+ -> org.openide.cookies.ViewCookieI

So: Viewable<-extends-ViewCookie<-implements-ViewSupport
Comment 3 Ralph Ruijs 2012-12-31 09:42:20 UTC
http://hg.netbeans.org/jet-main/rev/a500a6a597a3
Author:    Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Date:      2012-12-31 10:40
Comment 4 Quality Engineering 2013-01-03 02:40:43 UTC
Integrated into 'main-golden', will be available in build *201301030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a500a6a597a3
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: Issue #223265 - Overriding methods of Viewable.view() does not work correctly